Java Reference
In-Depth Information
figure 11-31  
Now you can fill this scene with some actors. Just as with Swing, JavaFX also has several layout
managers you can use. A simple VBox layout is used here:
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;
import javafx.stage.Stage;
public class BMICalculatorFX extends Application {
private final TextField txtMass = new TextField();
private final TextField txtHeight = new TextField();
private final Button btnCalc = new Button("Calculate BMI");
public BMICalculatorFX() {
/*
btnCalc.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
Search WWH ::




Custom Search