Why am I NOT getting any scale transition in Java FX.? - java

I have been trying to get Scale Transition using Java Fx for an imageView . The code that I have written seems to be fine. But when i run this code I am not getting any transition effect and no errors too, the image stay in its respective position . Can somebody help me ???
In the below code I want to do scale transition for the image resumeBtn.
import java.io.IOException;
import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.input.KeyEvent;
import javafx.stage.Stage;
public class TryFXML extends Application{
#Override
public void start(Stage stage) throws IOException {
// TODO Auto-generated method stub
try {
Parent root = FXMLLoader.load(getClass().getResource("PauseScreen.fxml"));
Scene scene=new Scene(root);
stage.setScene(scene);
stage.setTitle("Pause Screen");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
My Controller class:
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.TitledPane;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.Pane;
import javafx.scene.shape.Circle;
import javafx.stage.Stage;
import javafx.util.Duration;
import java.io.IOException;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import javax.annotation.Resource;
import javafx.animation.AnimationTimer;
import javafx.animation.ScaleTransition;
import javafx.event.ActionEvent;
public class TimeController {
#FXML
private ImageView resumeBtn;
#FXML
private ImageView restartBtn;
#FXML
private ImageView saveBtn;
#FXML
public void initialize(Stage stage) throws IOException {
ScaleTransition rsm=new ScaleTransition(Duration.seconds(5),resumeBtn);
rsm.setAutoReverse(true);
rsm.setCycleCount(1000);
rsm.setFromX(1);
rsm.setToX(4);
rsm.setFromY(1);
rsm.setToY(4);
rsm.play();
}
#FXML
void restartClicked(MouseEvent event) {
System.out.println("you clicked here 1");
}
#FXML
void saveClicked(MouseEvent event) {
System.out.println("You clicked here 2");
}
}
My FXML code::
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.effect.ColorAdjust?>
<?import javafx.scene.effect.InnerShadow?>
<?import javafx.scene.effect.Light.Distant?>
<?import javafx.scene.effect.Lighting?>
<?import javafx.scene.effect.Shadow?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.Pane?>
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="850.0" prefWidth="580.0" style="-fx-background-color: rgb(41,41,41);" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="TimeController">
<children>
<ImageView fx:id="resumeBtn" accessibleRole="BUTTON" accessibleRoleDescription="Button " fitHeight="200.0" fitWidth="200.0" layoutX="190.0" layoutY="104.0" style="-fx-scale-x: 1;">
<image>
<Image url="#Image/PlayButton.png" />
</image>
<effect>
<InnerShadow choke="0.32" color="#5e5959" height="22.56" radius="11.1675" width="24.11" />
</effect>
</ImageView>
<ImageView fx:id="restartBtn" fitHeight="200.0" fitWidth="200.0" layoutX="190.0" layoutY="354.0" onMouseClicked="#restartClicked">
<image>
<Image url="#Image/RestartButton.png" />
</image>
<effect>
<Lighting diffuseConstant="1.63" specularConstant="0.15" specularExponent="40.0">
<bumpInput>
<Shadow />
</bumpInput>
<light>
<Light.Distant />
</light>
</Lighting>
</effect>
</ImageView>
<ImageView fx:id="saveBtn" fitHeight="168.0" fitWidth="166.0" layoutX="212.0" layoutY="611.0" onMouseClicked="#saveClicked">
<image>
<Image url="#Image/SaveButton.png" />
</image>
<effect>
<ColorAdjust brightness="0.45" contrast="0.09" hue="1.0" saturation="0.02" />
</effect>
</ImageView>
</children>
</Pane>

From the documentation of javafx.fxml.Initializable:
FXMLLoader will now automatically call any suitably annotated no-arg initialize() method defined by the controller.
Notice the no-arg part. You need to define an initialize() method which accepts zero arguments. Your current initialize method does not meet the stated requirement, so it is never being called.
Change this:
public void initialize(Stage stage) throws IOException {
to this:
public void initialize() throws IOException {

Related

I am having an error while trying to run a simple java fx program that displays the numbers in my array of integer [duplicate]

This question already has answers here:
Passing Parameters JavaFX FXML
(10 answers)
Applying MVC With JavaFx
(2 answers)
Closed 8 months ago.
the program should keep changing the number either by clicking "a" or "d" or clicking some of the buttons in the scene, the program works fine with the buttons on the scene but I'm having an error while trying to click either "a" or "d"
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException: Cannot invoke "javafx.scene.control.Label.setText(String)" because "this.label" is null
Main
import java.io.IOException;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.stage.Stage;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.BorderPane;
public class Main extends Application {
private Controller controller;
#Override
public void start(Stage primaryStage) throws IOException {
FXMLLoader loader = new FXMLLoader(getClass().getResource("MainScene.fxml"));
Parent root = loader.load();
Scene scene = new Scene(root);
primaryStage.setScene(scene);
primaryStage.show();
scene.addEventHandler(KeyEvent.KEY_PRESSED, (key) -> {
controller = new Controller();
controller.changeText(key);
});
}
public static void main(String[] args) {
launch(args);
}
}
controller
import javafx.fxml.FXML;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType;
import javafx.scene.control.Label;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.AnchorPane;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;
public class Controller {
#FXML
private Label label;
int counter=0;
int [] numbers= {1,2,3,4,5,6,7,8,9};
public Controller() {
}
public void onBackClick() {
if(counter==-1) {
counter=8;
}
String num=String.valueOf(numbers[counter]);
label.setText(num);
counter--;
}
public void onNextClick() {
if(counter==9) {
counter=0;
}
String num=String.valueOf(numbers[counter]);
label.setText(num);
counter++;
}
public void changeText(KeyEvent keyEvent){
KeyCode keyCode = keyEvent.getCode();
switch (keyCode){
case D:
onNextClick();
break;
case A:
onBackClick();
break;
default:
break;
}
}
}
MainScene
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.AnchorPane?>
<AnchorPane fx:id="scene" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="401.0" prefWidth="783.0" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.Controller">
<children>
<Label fx:id="label" layoutX="330.0" layoutY="170.0" prefHeight="39.0" prefWidth="106.0" />
<Button layoutX="90.0" layoutY="287.0" mnemonicParsing="false" onAction="#onBackClick" text="a" />
<Button layoutX="610.0" layoutY="300.0" mnemonicParsing="false" onAction="#onNextClick" text="d" />
</children>
</AnchorPane>
full Exception
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException: Cannot invoke "javafx.scene.control.Label.setText(String)" because "this.label" is null
at javafx/application.Controller.onBackClick(Controller.java:36)
at javafx/application.Controller.changeText(Controller.java:55)
at javafx/application.Main.lambda$0(Main.java:34)
at javafx.base#18.0.1/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
at javafx.base#18.0.1/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
at javafx.base#18.0.1/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
at javafx.base#18.0.1/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at javafx.base#18.0.1/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at javafx.base#18.0.1/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at javafx.base#18.0.1/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base#18.0.1/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base#18.0.1/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base#18.0.1/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at javafx.base#18.0.1/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.base#18.0.1/javafx.event.Event.fireEvent(Event.java:198)
at javafx.graphics#18.0.1/javafx.scene.Scene$KeyHandler.process(Scene.java:4089)
at javafx.graphics#18.0.1/javafx.scene.Scene.processKeyEvent(Scene.java:2146)
at javafx.graphics#18.0.1/javafx.scene.Scene$ScenePeerListener.keyEvent(Scene.java:2614)
at javafx.graphics#18.0.1/com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:218)
at javafx.graphics#18.0.1/com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:150)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at javafx.graphics#18.0.1/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleKeyEvent$1(GlassViewEventHandler.java:250)
at javafx.graphics#18.0.1/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
at javafx.graphics#18.0.1/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleKeyEvent(GlassViewEventHandler.java:249)
at javafx.graphics#18.0.1/com.sun.glass.ui.View.handleKeyEvent(View.java:542)
at javafx.graphics#18.0.1/com.sun.glass.ui.View.notifyKey(View.java:966)
at javafx.graphics#18.0.1/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics#18.0.1/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
at java.base/java.lang.Thread.run(Thread.java:831)

CheckBoxTableCell Can't be selected on javaFX

New to JavaFx I created a view table using Scene builder with a table column named checkedCol that's supposed to contain chekboxes , on my controller i created those checkbox this way :
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.geometry.Insets;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.TableCell;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.CheckBoxTableCell;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import javafx.util.Callback;
public class RecapController implements Initializable{
#FXML
private TableView<OMission> missionTable;
#FXML
private TableColumn<OMission, Boolean> checkedCol;
private ObservableList<OMission> UserMission =
FXCollections.observableArrayList();
private OMission mission=null;
#Override
public void initialize(URL arg0, ResourceBundle arg1) {
try {
load_recap();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void load_recap(){
.....
checkedCol.setCellFactory(
CheckBoxTableCell.forTableColumn(checkedCol)
);
checkedCol.setCellValueFactory(new PropertyValueFactory<>("remark"));
checkedCol.setEditable(true);
}
}
On class Model i have this code :
public class OMission {
private String ObjMission ;
private Boolean remark;
public OMission( String objMission ) {
This.objMission = ObjMission ;
remark = false;
}
public Boolean getRemark() {
return remark;
}
public void setRemark(Boolean remark) {
this.remark = remark;
}
public String getObjMission() {
return ObjMission;
}
public void setObjMission(String objMission) {
ObjMission = objMission;
}
}
fxml code :
<?xml version="1.0" encoding="UTF-8"?>
<?import com.jfoenix.controls.JFXButton?>
<?import javafx.scene.control.CheckBox?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.text.Font?>
<AnchorPane fx:id="pan" prefHeight="740.0" prefWidth="1258.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.RecapController">
<children>
<JFXButton layoutX="16.0" layoutY="22.0" onAction="#OpenMission" style="-fx-background-color: #0A4969;" text="Ajouter une nouvelle mission : " textFill="WHITE">
<font>
<Font size="14.0" />
</font>
</JFXButton>
<TableView fx:id="missionTable" layoutX="16.0" layoutY="64.0" prefHeight="659.0" prefWidth="1226.0">
<columns>
<TableColumn prefWidth="612.5" text="RAPPORT DE MISSION">
<columns>
<TableColumn fx:id="local" prefWidth="100.0" text="Localité" />
<TableColumn fx:id="objmission" prefWidth="243.0" text="Objet Mission" />
</columns>
</TableColumn>
<TableColumn fx:id="checkedCol" prefWidth="75.0" text="select" />
</columns>
</TableView>
<JFXButton layoutX="263.0" layoutY="25.0" onAction="#print_tab" text="print" />
<CheckBox fx:id="SelectAll" layoutX="1154.0" layoutY="41.0" mnemonicParsing="false" text="Select All" />
</children>
The problem is i don't get any erros but i can not even select/check the checkboxes i get on my view table , i can't figure out the issue :) any idea ? Thank's in advance .
Any idea ?
From your code is not clear if the Tableview is editable. Assuming the TableView is missionTable, try:
missionTable.setEditable(true);
Alternatively you can set the Tableview editable in your FXML by adding editable="true":
<TableView fx:id="missionTable" editable="true" layoutX="16.0" layoutY="64.0" prefHeight="659.0" prefWidth="1226.0">

JavaFX Windows needs resize to display content

I have this problem with my JavaFX windows, where I added a Scrollpan containing a graph. When I launch the app I need to resize the windows so that the content appears.
Here is the Model:
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<VBox xmlns:fx="http://javafx.com/fxml/1" prefHeight="544.0" prefWidth="788.0" xmlns="http://javafx.com/javafx/8.0.121"
fx:controller="Solution.SolutionController">
<MenuBar fx:id="menuBar">
<menus>
<Menu text="File">
<items>
<MenuItem text="Save"/>
</items>
</Menu>
</menus>
</MenuBar>
<VBox fx:id="contenu" alignment="CENTER">
<HBox alignment="CENTER">
<ScrollPane style="-fx-background: WHITE" fx:id="pane" focusTraversable="false" prefHeight="608.0"
prefWidth="700">
</ScrollPane>
</HBox>
<Label fx:id="counter">
</Label>
<VBox.margin>
<Insets top="17.0"/>
</VBox.margin>
</VBox>
<HBox alignment="CENTER" prefWidth="690.0">
<Button onAction="#handleGauche" text="Gauche"/>
<Button onAction="#handleDroite" text="Droite"/>
</HBox>
</VBox>
Here is the controller:
package Solution;
import Main.Individual;
import javafx.embed.swing.SwingNode;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.control.MenuBar;
import javafx.scene.control.ScrollPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;
public class SolutionController {
public VBox contenu;
public Label counter;
public MenuBar menuBar;
public ScrollPane pane;
ArrayList<Individual> graph;
JPanel panel;
int i;
public void init() {
i = 0;
panel = new JPanel();
panel.setBackground(Color.WHITE);
panel.add(graph.get(i).chopper.getContentPane());
panel.validate();
panel.repaint();
counter.setText((i+1) + "/" + graph.size());
SwingNode sn = new SwingNode();
sn.setContent(panel);
pane.setContent(sn);
}
#FXML
void handleDroite(ActionEvent event) {
i = (i + 1) % graph.size();
changeContent();
}
#FXML
void handleGauche(ActionEvent event) {
i = (graph.size() + (i - 1)) % graph.size();
changeContent();
}
public void changeContent(){
counter.setText((i+1) + "/" + graph.size());
panel.add(graph.get(i).chopper.getContentPane());
panel.repaint();
SwingNode sn = new SwingNode();
sn.setContent(panel);
pane.setContent(sn);
}
}
And here is the view:
package Solution;
import Main.Individual;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import java.io.IOException;
import java.util.ArrayList;
public class SolutionApplication extends Application{
ArrayList<Individual> graphI;
public SolutionApplication(ArrayList<Individual> graph) {
graphI = new ArrayList<>(graph);
}
public void start(Stage primaryStage) throws IOException {
FXMLLoader loader = new FXMLLoader(getClass().getResource("Solution.fxml"));
Parent root = loader.load();
SolutionController controller = loader.getController();
controller.graph = new ArrayList<>(graphI);
controller.init();
primaryStage.setTitle("Main Window");
primaryStage.setScene(new Scene(root));
primaryStage.show();
}
}
I did stumble on this post
javafx SwingNode not working until window is resized
However they say its a bug with the JDK? I use version 10
I'd like to know how I can fix this.
Thanks for reading.

Can't get anything to show up in my JavaFX using an FXML document

So I've been following a tutorial for JavaFX and I used SceneBuilder to make a FXML view for my application. However, I can't seem to get anything to show up when I run the application - what am I doing wrong? I get no exceptions, adn the code compiles and runs fine. Here's my code.
import java.io.IOException;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.geometry.Pos;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Pane;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class Driver extends Application {
public static void main(String[] args) {
launch(args);
}
#Override
public void start(Stage primaryStage) {
FXMLLoader loader = new FXMLLoader(getClass().getResource("interface.fxml"));
Pane root=null;
try {
root = (Pane) loader.load();
}
catch (IOException e) {
e.printStackTrace();
}
Scene scene = new Scene(root);
primaryStage.setTitle("Wiki Scraper");
primaryStage.setScene(scene);
primaryStage.show();
}
}
Here is interace.fxml:
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.text.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Button layoutX="500.0" layoutY="351.0" mnemonicParsing="false" prefHeight="35.0" prefWidth="86.0" text="Scrape!" />
<TextArea layoutX="185.0" layoutY="41.0" prefHeight="298.0" prefWidth="401.0" />
<Label layoutX="350.0" layoutY="6.0" text="Console">
<font>
<Font size="24.0" />
</font>
</Label>
<TextField layoutX="14.0" layoutY="41.0" />
<Label layoutX="14.0" layoutY="24.0" text="URL to Start From" />
</children>
</AnchorPane>

JavaFX showing view make in scene builder with controller

I have this controller:
package cz.vutbr.feec.bmds.cv2;
import java.awt.Button;
import java.awt.TextField;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Slider;
public class TestGuiController {
private int buttonPressed = 0;
#FXML
private Button tlacitko;
#FXML
private TextField textovePole;
#FXML
private Slider slider;
public void buttonPressed(ActionEvent e) {
buttonPressed++;
textovePole.setText(Integer.toString(buttonPressed));
}
}
this fxml:
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.layout.BorderPane?>
<AnchorPane prefHeight="200.0" prefWidth="200.0" xmlns:fx="http://javafx.com/fxml" fx:controller="cz.vutbr.feec.bmds.cv2.TestGuiController">
<children>
<Button fx:id="tlacitko" layoutX="30.0" layoutY="40.0" mnemonicParsing="false" onTouchPressed="#buttonPressed" text="Button" />
<Slider fx:id="slider" layoutX="157.0" layoutY="17.0" orientation="VERTICAL" />
<TextField fx:id="textovePole" layoutX="14.0" layoutY="89.0" prefWidth="134.0" />
</children>
</AnchorPane>
and this is my main class:
package cz.vutbr.feec.bmds.cv2;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class Main extends Application {
#Override
public void start(Stage primaryStage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("TestGui.fxml"));
primaryStage.setTitle("Titulek");
primaryStage.setScene(new Scene(root,300,275));
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
When I run this through ant I get message box with error (exception during running application). I tried simple fxml without controller and it works so I am guesing I do something wrong with controller. What I must change to have it working?
I must answer my own question. Problem was in TestGuiController where I used java.awt.Button and java.awt.TextField instead of javafx.scene.control.Button and javafx.scene.control.TextField.
I'm not 100% sure but try:
in FXML: Button: onAction instead of onTouchPressed
Please provide the exact Exception message.

Categories

Resources