Template
Updated dependencies, activates PMD Plugin again: new version supports Java 21.
This commit is contained in:
@@ -3,7 +3,6 @@ package de.kneitzel;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.TextField;
|
||||
|
||||
import java.net.URL;
|
||||
@@ -11,20 +10,24 @@ import java.util.ResourceBundle;
|
||||
|
||||
public class MainWindow implements Initializable {
|
||||
|
||||
|
||||
private int counter = 0;
|
||||
|
||||
@FXML
|
||||
private TextField textField;
|
||||
public Button button;
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle resourceBundle) {
|
||||
if (button == null) {
|
||||
textField.setText("Button is null");
|
||||
} else {
|
||||
textField.setText("Button is not null");
|
||||
}
|
||||
public void initialize(URL location, ResourceBundle resources) {
|
||||
displayCounter();
|
||||
}
|
||||
|
||||
private void displayCounter() {
|
||||
textField.setText("Click counter: " + counter);
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void onButtonClick(ActionEvent actionEvent) {
|
||||
|
||||
counter++;
|
||||
displayCounter();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<AnchorPane prefHeight="127.0" prefWidth="209.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.kneitzel.MainWindow">
|
||||
<children>
|
||||
<Button fx:id="button" layoutX="44.0" layoutY="70.0" mnemonicParsing="false" onAction="#onButtonClick" text="Button" />
|
||||
<Button fx:id="button" layoutX="44.0" layoutY="70.0" mnemonicParsing="false" onAction="#onButtonClick" text="Click Me" />
|
||||
<TextField fx:id="textField" layoutX="14.0" layoutY="24.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
|
||||
Reference in New Issue
Block a user