ImageVerifierCode 换一换
格式:DOCX , 页数:171 ,大小:406.08KB ,
资源ID:13011353      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-13011353.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(《Java语言程序设计基础篇》第10版梁勇著第十六章练习题答案.docx)为本站会员(b****6)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

《Java语言程序设计基础篇》第10版梁勇著第十六章练习题答案.docx

1、Java语言程序设计基础篇第10版梁勇著第十六章练习题答案Java 语言程序设计(基础篇) (第 10 版 梁勇 著)第十六章 练习题答案16.1import javafx.application.Application;import javafx.geometry.Pos;import javafx.scene.Scene;import javafx.scene.control.Button;import javafx.scene.control.RadioButton;import javafx.scene.control.ToggleGroup;import javafx.scene.l

2、ayout.BorderPane;import javafx.scene.layout.HBox;import javafx.scene.layout.Pane;import javafx.scene.paint.Color;import javafx.scene.text.Font;import javafx.scene.text.Text;import javafx.stage.Stage;extends Application public class Exercise16_01private double paneWidth = 500;private double paneHeigh

3、t = 150;Override / Override the start method in the Application class public void start(Stage primaryStage) Text text = new Text(20, 40, Programming is fun );text.setFont( new Font( Times , 20);Pane paneForText = new Pane();paneForText.getChildren().add(text);paneForText.setStyle( -fx-border-color:

4、gray );new RadioButton( Red );new RadioButton( Green );ToggleGroup group = new ToggleGroup();rbRed.setToggleGroup(group); rbYellow.setToggleGroup(group); rbBlack.setToggleGroup(group); rbBlack.setSelected( true ); rbOrange.setToggleGroup(group);rbGreen.setToggleGroup(group);HBox hBox = new HBox(5);h

5、Box.getChildren().addAll(rbRed, rbYellow, rbBlack, rbOrange, rbGreen); hBox.setAlignment(Pos.CENTER);Button btLeft = new Button( );HBox hBoxForButtons = new HBox(5);hBoxForButtons.getChildren().addAll(btLeft, btRight); hBoxForButtons.setAlignment(Pos.CENTER);BorderPane borderPane = new BorderPane();

6、borderPane.setTop(hBox);borderPane.setCenter(paneForText); borderPane.setBottom(hBoxForButtons);/ Create a scene and place it in the stageScene scene = new Scene(borderPane, paneWidth, paneHeight + 40);primaryStage.setTitle( Exercise16_01 ); / Set the stage title primaryStage.setScene(scene); / Plac

7、e the scene in the stage primaryStage.show(); / Display the stagerbRed.setOnAction(e - text.setStroke(Color.RED); rbYellow.setOnAction(e - text.setStroke(Color.YELLOW);rbBlack.setOnAction(e - text.setStroke(Color.BLACK); rbOrange.setOnAction(e - text.setStroke(Color.ORANGE);rbGreen.setOnAction(e - t

8、ext.setStroke(Color.GREEN);btLeft.setOnAction(e - text.setX(text.getX() - 1); btRight.setOnAction(e - text.setX(text.getX() + 1);/* The main method is only needed for the IDE with limited* JavaFX support. Not needed for running from the command line.*/public static void main(String args) launch(args

9、);16.1附加import javafx.application.Application;import javafx.scene.Scene;import javafx.scene.layout.*;import javafx.scene.paint.Color;import javafx.scene.control.*;import javafx.stage.Stage;import javafx.geometry.Pos;public class Exercise16_01Extra extends Application final static double PANEL_WIDTH

10、= 400;final static double PANEL_HEIGHT = 140;Override / Override the start method in the Application classpublic void start(Stage primaryStage) GridPane paneForOriginal =GridPane paneForInversed =new GridPane(); new GridPane();TextField tfOriginal =TextField tfInversed =new TextField33;new TextField

11、33;for ( int i = 0; i 3; i+) for ( int j = 0; j double A = new double 33;for ( int i = 0; i 3; i+)for ( int j = 0; j 3; j+) Aij = Double.parseDouble(tfOriginalij.getText();double inverseA = Exercise08_03Extra.inverse(A);if (inverseA = null )lblStatus.setText( Invered matrix: No inverse matrix );else

12、 for ( int i = 0; i 3; i+)for ( int j = 0; j pane.getChildren().clear(); pane.getChildren().add(circle);if (chkFill.isSelected() circle.setFill(Color.BLACK);else circle.setFill(Color.WHITE););rbRectangle.setOnAction(e - pane.getChildren().clear(); pane.getChildren().add(rectangle);if (chkFill.isSele

13、cted() rectangle.setFill(Color.BLACK);else rectangle.setFill(Color.WHITE););rbEllipse.setOnAction(e - pane.getChildren().clear(); pane.getChildren().add(ellipse);if (chkFill.isSelected() ellipse.setFill(Color.BLACK);else ellipse.setFill(Color.WHITE););chkFill.setOnAction(e - if (chkFill.isSelected()

14、 circle.setFill(Color.BLACK);rectangle.setFill(Color.BLACK);ellipse.setFill(Color.BLACK); else circle.setFill(Color.WHITE); rectangle.setFill(Color.WHITE);ellipse.setFill(Color.WHITE););/* The main method is only needed for the IDE with limited* JavaFX support. Not needed for running from the comman

15、d line. */public static void main(String args) launch(args);16.2附加importjavafx.application.Application;importjavafx.scene.Scene;importjavafx.scene.layout.*;importjavafx.scene.paint.Color;importjavafx.scene.control.*;importjavafx.stage.Stage;importjavafx.geometry.Pos;publicclass Exercise16_02Extraext

16、ends Application finalstatic double PANEL_WIDTH = 400;finalstatic double PANEL_HEIGHT = 140;Override / Override the start method in the Application classpublic void start(Stage primaryStage) GridPane paneForOriginal =GridPane paneForInversed =new GridPane(); new GridPane();TextField tfA = new TextFi

17、eld33;TextField tfB = new TextField3;for ( int i = 0; i 3; i+) for ( int j = 0; j 3; j+) tfAij = new TextField();tfAij.setPrefColumnCount(4);tfBi = new TextField(); tfBi.setPrefColumnCount(4);HBox hBoxes = new HBox3;for ( int i = 0; i double A = new double 33;double B = new double 3;for ( int i = 0; i 3; i+) for ( int j = 0; j 3; j+) Aij = Double.parseDouble(tfAij.getText();Bi = Double.parseDouble(tfBi.getText();double result = Exercise08_02Extra.getSolution(A, B);if (result =null )lblStatus.setText(No solutions );elselblStatus.set

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2