Java第十版第十五章答案_java语言程序的设计基础篇第十版第十四章练习答案

01

import javafx.application.Application;

import javafx.geometry.Pos;

import javafx.scene.Scene;

import http://www.doczj.com/doc/ccd36bf2a200a6c30c22590102020740bf1ecdfb.htmlyout.GridPane;

import javafx.stage.Stage;

import javafx.scene.image.ImageView;

public class Exercise14_01 extends Application {

Override // Override the start method in the Application class public void start(Stage primaryStage) {

GridPane pane = new GridPane();

pane.setAlignment(Pos.CENTER);

pane.setHgap(5);

pane.setVgap(5);

ImageView imageView1 = new ImageView("image/uk.gif");

ImageView imageView2 = new ImageView("image/ca.gif");

ImageView imageView3 = new ImageView("image/china.gif");

ImageView imageView4 = new ImageView("image/us.gif");

pane.add(imageView1, 0, 0);

pane.add(imageView2, 1, 0);

pane.add(imageView3, 0, 1);

pane.add(imageView4, 1, 1);

// Create a scene and place it in the stage

Scene scene = new Scene(pane);

primaryStage.setTitle("Exercise14_01"); // Set the stage title

primaryStage.setScene(scene); // Place the scene in the stage

primaryStage.show(); // Display the stage

}

/**

* 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);

}

}

02

import javafx.application.Application;

import javafx.geometry.Pos;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值