Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejavafx
titleExample4.fxml
<?xml version="1.0" encoding="UTF-8"?>
<?emfs /fxcontroller/Example4.fxml; ?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.layout.HBox?>

<HBox xmlns:fx="http://javafx.com/fxml"
    fx:controller="fxcontroller.Example4ControllerExample3Controller">
    <TextField fx:id="textField" text="Type something here!"/>
    <Button text="Click me!" onAction="#handleUpcaseAction"/>
</HBox>

 

 

Code Block
languagejavafx
titleExample4.java
package fxcontroller;

import java.io.IOException;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class Example4 extends Application {
    @Override
    public void start(Stage primaryStage) throws IOException {
        Parent root = FXMLLoader.load(this.getClass().getResource("Example4.fxml"));
        primaryStage.setScene(new Scene(root));
        primaryStage.show();
    }
    
    public static void main(String[] args) {
        launch(args);
    }
}

...