Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » Beginner needs some help (Problems running JavaFX project with Scene Builder)
Beginner needs some help [message #1805111] Sun, 07 April 2019 14:56 Go to next message
Michel Simeon is currently offline Michel SimeonFriend
Messages: 130
Registered: December 2009
Senior Member
I am trying to learn using JavaFX. I am running a clean install of Eclipse Java 03-019 with Java JDK 11.02 from Oracle, ava JRE 11 from Oracle, javafx-sdk-11.0.2 from Gluon, SceneBuilder 11.0.1.0 from Gluon and e(fx)clipse 3.5.

I made it to create a JavaFX project and link with SceneBuilder. There I created two buttons and a TextField controls, and a MyController class. My Main program includes the following:
Parent root = FXMLLoader.load(getClass().getResource("sample1.fxml"));
When I run it I got errors, including
Exception in Application start method
java.lang.reflect.InvocationTargetException
at .....
Caused by: javafx.fxml.LoadException:
/C:/Users/msime/eclipse-workspace-2019/FXTest1/bin/application/sample1.fxml
....
Caused by: java.lang.ClassNotFoundException: com.gluonhq.charm.glisten.control.TextField

I do not know how to fix the TextField !!!
==================
below is a copy of the fxml file:

<?xml version="1.0" encoding="UTF-8"?>

<?import com.gluonhq.charm.glisten.control.TextField?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.text.Font?>

<AnchorPane prefHeight="400.0" prefWidth="500.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.MyController">
<children>
<Button id="HelloBtn" fx:id="helloBtn" contentDisplay="CENTER" layoutX="35.0" layoutY="35.0" mnemonicParsing="false" onAction="#sayHello" prefHeight="61.0" prefWidth="112.0" text="Hello" textAlignment="CENTER">
<font>
<Font size="20.0" />
</font>
</Button>
<Button id="ShowBtn" fx:id="showDTimeBtn" layoutX="355.0" layoutY="35.0" mnemonicParsing="false" onAction="#showDateTime" prefHeight="61.0" prefWidth="112.0" text="Sow Date Time">
<font>
<Font size="14.0" />
</font>
</Button>
<TextField fx:id="dateTimeTextField" layoutX="180.0" layoutY="180.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="35.0" prefWidth="140.0" />
</children>
</AnchorPane>



Re: Beginner needs some help [message #1805171 is a reply to message #1805111] Tue, 09 April 2019 08:36 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 482
Registered: December 2010
Location: Germany
Senior Member
You could change <?import com.gluonhq.charm.glisten.control.TextField?> to <?import javafx.scene.control.TextField?> using the default JavaFX textfield or you need to put the Gluon Charm library on the classpath (or module path).
Re: Beginner needs some help [message #1805222 is a reply to message #1805171] Wed, 10 April 2019 07:49 Go to previous message
Michel Simeon is currently offline Michel SimeonFriend
Messages: 130
Registered: December 2009
Senior Member
Thank you for your reply. Indeed it solved my problem.
Thanks again
MS
Previous Topic:CSS editor not working as expected on Eclipse Photon
Next Topic:Succeeded migrating E4 project that uses GEF/JavaFX to OpenJFX 11
Goto Forum:
  


Current Time: Fri Sep 20 08:39:21 GMT 2019

Powered by FUDForum. Page generated in 0.01694 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top