Regardless of which version you choose, this code will help get you started!
import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.text.TextAlignment;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.control.Button;
import javafx.scene.layout.GridPane;
//import javafx.event.EventHandler;
import javafx.geometry.Pos;
import javafx.geometry.HPos;
public class Project8_template extends Application
{
public static int cel2far(int c) {
return c * 9 / 5 + 32;
}
public static int far2cel(int f) {
return ( f - 32 ) * 5 / 9;
}
@Override
public void start(Stage primaryStage) {
Label l1, l2;
TextField tf1, tf2;
Button b1, b2;
GridPane pane = new GridPane();
Scene scene = new Scene(pane, 500, 200);
b1.setOnAction( event -> {
// button work goes here.
});
/*
If you are doing 8a, with two buttons, this is for the second button.
b2.setOnAction ( event -> {
// button work goes here.
});
*/
System.out.println(pane);
primaryStage.setTitle("Temperature Conversion");
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}