编程代写 | Advanced/Further Programming Practical Lab Week 9

本次澳洲代写是Advanced/Further Programming的一个Lab

1. Complete the program below to compute the area of a rectangle as shown below. If the
input values are non-numeric, print an appropriate error message

import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;

public class ComputeArea extends Application {
@Override
public void start(Stage primaryStage) {

GridPane pane = new GridPane();
pane.setAlignment(Pos.CENTER);
pane.setPadding(new Insets(11.5, 12.5, 13.5, 14.5));
pane.setHgap(10);
pane.setVgap(10);

// Your code goes here

Scene scene = new Scene(pane, 300, 200);

primaryStage.setTitle(“Calculate Area”);
primaryStage.setScene(scene);
primaryStage.show();

}

public static void main(String[] args) {
launch(args);
}
}

2. Complete the program below to drag the text “DRAG ME” to the text “DROP HERE” and
replace the text with “DRAG ME”.

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.text.Text;
import javafx.stage.Stage;

public class DragAndDropDemo extends Application {

@Override
public void start(Stage stage) {
stage.setTitle(“Drag And Drop”);

Group root = new Group();
Scene scene = new Scene(root, 400, 200);
scene.setFill(Color.LIGHTGREY);

final Text source = new Text(50, 100, “DRAG ME”);
source.setScaleX(1.5);
source.setScaleY(1.5);

final Text target = new Text(250, 100, “DROP HERE”);
target.setScaleX(1.5);
target.setScaleY(1.5);

// Your code goes here

root.getChildren().add(source);
root.getChildren().add(target);
stage.setScene(scene);
stage.setResizable(false);
stage.show();
}

public static void main(String[] args) {
Application.launch(args);
}
}

3. Write a program to choose an image from the desktop and display the image. Note “Clear”
option is only shown when there is an image displayed. You are required to use Scene
Builder to generate the FXML file.


程序代写代做C/C++/JAVA/安卓/PYTHON/留学生/PHP/APP开发/MATLAB


本网站支持淘宝 支付宝 微信支付  paypal等等交易。如果不放心可以用淘宝交易!

E-mail: itcsdx@outlook.com  微信:itcsdx


如果您使用手机请先保存二维码,微信识别。如果用电脑,直接掏出手机果断扫描。

blank

发表评论