jar,javafx,include,export , Exception with JavaFX jar


Exception with JavaFX jar

Question:

Tag: jar,javafx,include,export

I have export a FX Project as Jar, this exception show me.

http://www.bilder-upload.eu/show.php?file=4eae98-1432897954.png

http://www.bilder-upload.eu/show.php?file=aace07-1432898009.png

I have tested an easy FX project without includes without errors. I believe its about wrong includes path.

Do you have got any idea what i did wrong?

Update

Here is the code where the FXML is loaded:

public class MatchMaker_Main extends Application{

    @Override
    public void start(Stage stage) throws Exception {
        FXMLLoader loader = new FXMLLoader(getClass().getResource("/matchMakerView/matchMaker_MainScene.fxml"));
        Parent root = loader.load();

        Scene scene = new Scene(root);

        stage.setScene(scene);
        stage.setTitle("MatchMaker [email protected]");
        stage.show();
    }

    public static void main(String[] args) {
     launch(args);
    }

}

Answer:

The file name in your code matchMaker_MainScene.fxml does not match the name of the file MatchMaker_MainScene.fxml.

This will work when you are reading from a file system that doesn't distinguish file names that differ only in case (such as windows) but will not work on file systems that do (everything else) and will not work when the FXML file is bundled in a jar file.


Related:


Add Layouts on TabPane JavaFX


java,user-interface,javafx,tabpanel
i have a quick question. I want to build an UI with JavaFX. It should have tabs, each with some content. The problem that I have is, I dont know how to arrange the content in the tabs properly. Is there a possibility to add a Layout to the tabs?...

OutofMemoryErrory creating fat jar with sbt assembly


jar,cassandra,apache-spark,sbt
We are trying to make a fat jar file containing one small scala source file and a ton of dependencies (simple mapreduce example using spark and cassandra): import org.apache.spark.SparkContext import org.apache.spark.SparkContext._ import com.datastax.spark.connector._ import org.apache.spark.SparkConf object VMProcessProject { def main(args: Array[String]) { val conf = new SparkConf() .set("spark.cassandra.connection.host", "127.0.0.1") .set("spark.executor.extraClassPath",...

FXML file won't load even when file path is correct


java,eclipse,javafx
I am trying to load an FXML file: URL url = getClass().getClassLoader().getResource("/frontEnd/fxml/ModeScreen.fxml"); try { this.value = FXMLLoader.load(url); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } But when I run, I get: NullPointerException: Location is required the path to my fxml file is: src/frontEnd/fxml/ModeScreen.fxml and the path...

Chart JavaFX, my hover Label are hidden by the edges of chart


charts,javafx,popup,linechart
I have a problem again with the JavaFX Chart : D Context : I had Popup/Label on my chart to display the value on hover : JavaFX LineChart Hover Values (Jewelsea answer) Problem : But when the point are near the edges of chart, the popup is hidden by them....

How is the Point2D “angle” method to be understood?


javafx,geometry
I thought I'd use the Point2D class for calculating e. g. the angle betwen 2 points instead of creating a utility method. It turned out, it's not usable at all. Code example: Point2D p1; Point2D p2; p1 = new Point2D(0, 0); p2 = new Point2D(10, 10); System.out.println( "Point2D: " +...

JavaFX TextField : Automatically transform text to uppercase


java,javafx,fxml,keyevent
I have a JavaFX TextField control on my FXMl that looks like this... <TextField fx:id="input_search" onKeyPressed="#keyListener" prefHeight="25.0" prefWidth="197.0" /> I want to automatically change all characters to uppercase when the user is typing. The code in my controller : public void keyListener(KeyEvent event){ //maybe transform the pressed key to uppercase...

Filter JDK Bug System by JavaFX


java,javafx,openjdk
Is there a way (filter settings, etc) to see only JavaFX related bugs in the JDK Bug System? Also, the Reporter names seem to be gone. Now I'm "J. Duke", I guess like everyone else that doesn't have an acount there. So how do I find the bugs I reported?...

Rotate line segment with Button


math,javafx,geometry,coordinates
I have a line which has points (x1,y1) and (x2,y2). I wanted to attach a Button to it, it should align with the line by rotating based on the line segment points. I need some help in calculating the rotation angle for the Button.

JavaFx TreeCell how to expand nodes after one second


javafx,nodes,expand,treecell
i'm implementing the Drag&Drop on a generic TreeView. My purpose is to expand a folder during DragEntered event after a second of stationing, actual code: setOnDragEntered(e -> { TreeItem<TreeItemContent> enteredItem = getSourceItem(e); if(model.isFolder(enteredItem)){ enteredItem.setGraphic(images.getFolderOpened()); enteredItem.setExpanded(true); } e.consume(); }); desired: setOnDragEntered(e -> { TreeItem<TreeItemContent> enteredItem = getSourceItem(e); if(model.isFolder(enteredItem)){ if(dragDuration >= 1...

Javafx Tableview dont show data of ObservableList


user-interface,javafx
i have a Problem mit the Tableview in JavaFX. I know there are some other posts in the forum, but i checked them and tried to use the solutions, but nothing work for me ... I have 3 Classes. One Version class, the data model. The Class which populats the...

How to change the color of treeitem expand and collapse arrow in javafx?


javafx,treeview
I have got some trouble with treeitems of a treeview. There are expand and collapse icon-arrows, when you have child-treeitems. I only know how to change the background-color of this expand/collapse icons. But I don't know how to change the color of the arrow. .tree-cell .tree-disclosure-node { -fx-background-color: #CCCCCC; }...

What is wrong with this JavaFX/FXML custom component?


java,javafx,javafx-8,fxml,fxmlloader
I am learning to write FXML custom components for use with JavaFX 8 and Scene Builder. I wrote the FXML file shown below but Scene Builder will not open it, giving me the message "Open operation has failed" due to the exception: java.io.IOException: javafx.fxml.LoadException: mycustomcomponent.TicoTeco is not a valid type....

Splash screen not display when execute by Jar File but it works when execute from Netbeans IDE


java,netbeans,jar
Set application Splash Screen from Project properties -> Run Option SplashScreen which draw by StartApp Class public class StartApp { public static void main(String[] args) { new Thread(new Runnable() { public void run() { splashInit(); // initialize splash overlay drawing parameters appInit(); // simulate what an application would do before...

Import java package from Matlab deploytool to Android Studio App


java,android,image,matlab,jar
I managed to create a java package from a Matlab function (for image processing) using deploytool. I tested it in Eclipse and it runs perfectly. The problem is that I want to use this Matlab function for an Android Studio project and I can´t find any way to make it...

Gradle: Adding sources.jar file within /lib folder of published dist.zip along with all my other dependencies


java,maven,jar,gradle
I have a java project that I am building using gradle. I am releasing a dist.zip folder for my project and I want to add the sources.jar for my project to the /lib subfolder within dist.zip. I am able to create a sources.jar file along with my dist.zip file but...

How to identify web actions in JavaFX webview?


javascript,webview,javafx
I need to catch the actions like clicks, drag, right-click, double click etc, that are done by the user on JavaFX web view. How to achieve it?

JavaFX subclassed Button - How to make Label update work?


java,javafx
I want to have several JavaFX Buttons that update one Label in my Application with text. For testing purposes it's just Button Text. What I did at first worked fine and looked like this: String Text = "..."; public void kons() { System.out.println("Works..."); System.out.println(Text); Tekst.setText(Text); Button G4 = new Button("Spadantes");...

How would I connect to a MySQL database back-end from an Android device's application? [closed]


java,android,mysql,javafx,apk
I have developed a standalone JavaFx application in Netbeans with a MySQL database back-end which I want to also package as an APK package for running on Android. How would I go about porting the MySQL database script it uses to Android?

Opening frame that is under the JavaFX program category


eclipse,video,javafx,jframe,mp4
Most of program is using JFrames throughout the application for all the different windows that can appear. However, I have to play an instructional video for the user inside a JFrame. I couldn't find a way to do this, so I had to make a JavaFX program. Is there a...

How to accomplish 3 horizontal line menu in fxml


menu,javafx,overlay,fxml
I want to create menu like "Firefox (Three horizontal line - top right side) Menu". I don't know how to create this line of overlay menu in FXML. Have anybody any idea about this? Thank a lot....

Eclipse error using Maven filtering in persistence.xml


maven,jar,persistence,filtering
I have a Maven project with JPA using hibernate. I had to specify a jar file to load external classes in persistence.xml located in src/main/resources/META-INF <persistence unit name="PersistenceUnit" transaction-type="JTA" ... <jar-file>lib/${project.persistencejar}.jar</jar-file> using Maven filtering (the filename can change based on various Maven settings). I instruct then Maven to filter by...

JavaFX FilteredList, filtering based on property of items in the list


javafx,javafx-8
I have a case where I need to filter a ObservableList<Item> based on some properties of the items (i.e. the condition is internal and not external). I found out that javafx has FilteredList so I tried it. I could set the predicate and filtering works, until the property value that...

How to fill a JavaFX Sphere with two Colors


java,css,javafx,javafx-3d
How can I fill in JavaFX a 3D Sphere with a linear gradient like a 2d Circle? I work with the JavaFX Scene Builder. ...

Present node +LineChart + JavaFX


javafx,linechart
I am using LineChart in the javafx8 and I am able to get the series plotted dynamically in the graph and the symbols plotted for every input. But the problem is I just want to show the symbol for the present node and not for the nodes which are already...

JavaFX Input Validation Textfield


java,javafx
I'm using JavaFX and Scene Builder and I have a form with textfields. Three of these textfields are parsed from strings to doubles. I want them to be school marks so they should only be allowed to be between 1.0 and 6.0. The user should not be allowed to write...

Difference between Pane and Group


javafx,group,pane
My question is simple : in JavaFX, what is the difference between a Pane and a Group ? I can't make any difference ... Thank for your answer...

Exception when using CheckListView of Controls FX


javafx,controlfx
I have the error : Exception in thread "JavaFX Application Thread" java.lang.IndexOutOfBoundsException: Index: 0 I thought it was because I have to use Platform.runLater(), but it seems the errors does not come from this. Here's the function that I try to correct with Platform.runLater() : public void setListAirportForFilter(ListAirport listAirport){ this.myListAirport...

JavaFX : Button never sets a graphic


java,javafx,controller
EDIT : A MCVE version of my code has been made to help debug it. It reproduces my bug. The purpose of my code is doing a Memory game. Which means that when it is your turn, you "open" a card, then another one. If they form a pair, they...

javafx position elements around a central point


java,javafx,javafx-8
Apologies, as this is a rubbishy asked question, but I am totally flumped here about the best approach. I believe there must be something inbuilt or common practice for this but I can't find it and Google has turned up nothing of much value. I have a javafx scene with...

LayoutY of GridPane not affected by ScrollBar Listener


java,javafx
I have a GridPane that i fill dynamically, then I display it, the problem is: if the rows are so many, then the rows in the bottom don't get displayed, what i want is to add a scrollbar so that I can display all of the rows, here is the...

Connecting from Spark/pyspark to PostgreSQL


postgresql,jdbc,jar,apache-spark,pyspark
I've installed Spark on a Windows machine and want to use it via Spyder. After some troubleshooting the basics seems to work: import os os.environ["SPARK_HOME"] = "D:\Analytics\Spark\spark-1.4.0-bin-hadoop2.6" from pyspark import SparkContext, SparkConf from pyspark.sql import SQLContext spark_config = SparkConf().setMaster("local[8]") sc = SparkContext(conf=spark_config) sqlContext = SQLContext(sc) textFile = sc.textFile("D:\\Analytics\\Spark\\spark-1.4.0-bin-hadoop2.6\\README.md") textFile.count() textFile.filter(lambda...

FXML: ClassNotFoundException


javafx,fxml,fxmlloader
I'm very new to JavaFX and I'm having problem using my custom class in FXML. The console keeps giving me this exception when trying to load main.fxml: ... 1 more Caused by: java.lang.ClassNotFoundException: sample.View$BoardPane at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ... I created BoardPane class as a subclass of FlowPane in package sample.View and...

How to run multiple JAR files at differnt locations from a command prompt


java,jar,command-prompt
I have 2 jar files at different locations. I need to run both these jar files from a single command prompt window. I referred to many SO links and google links and created this batch job. START SET JPOS_DIR=D:\Installable\JPOS\Iso8583jPOSJavaAgent-0.0.11 cd /D %JPOS_DIR% "C:\Program Files\Java\jdk1.7.0_75\bin\java" -cp Iso8583jPOSJavaAgent-0.0.11.jar com.hp.sv.iso8583.jpos.ISOForwarderMain START SET JPOS_DIR=D:\Installable\JPOS_Instance-2\Iso8583jPOSJavaAgent-0.0.11...

Javafx TextField pseudoClassStateChanged method not working


java,javafx
I'm setting PseudoClass to TextField to highlight them when error occurs. The red border appears around TextField only when I click mouse inside it (to put text value), but I need to show border all time. there is how I sets border: element.pseudoClassStateChanged(PseudoClass.getPseudoClass("error"), true); It worked just fine till last...

JavaFX splash screen message and progress not updating


java,multithreading,javafx
I have a JavaFX application that checks for the presence of a database at startup. If the database is not found, a "seed" database must be created before the program can proceed. Since creating the seed database can be lengthy, I want to display a splash screen and show progress...

How to analyze incoming message (JavaFX on Android)


java,javafx,javafx-2,javafx-8,javafxports
I ported my JavaFX application to my Android device. I want my application to read incoming SMS messages and store it in a database. I found several questions here in StackOverflow but I don't know how to implement in a JavaFX approach. Please help!

Gradle Jar structure is different than the real project structure


java,jar,gradle,build
I'm trying to build my project with gradle but for some reason the resources are put on a different level than their real level. Here's the build: apply plugin: 'java' version = '1.1' archivesBaseName = 'DesktopOmegle' repositories { //mavenCentral() maven { url 'http://oss.sonatype.org/content/repositories/snapshots/' url "http://repo1.maven.org/maven2" } } dependencies { compile...

JavaFX - how to get background color of Tab, Button, etc


java,animation,colors,javafx,background
Problem description: I can't get background of object in JavaFX. I don't mean Shapes, but normal Nodes like Buttons, Tabs and others. I don't know how to access to theirs background color. What I want? I am developing IDE and I want to run Color animation on tab with file...

IntelliJ correctly using Libraries


java,intellij-idea,jar
I'm using IntelliJ without a build tool for a project, I build it as a jar. Now I'm using the iText library for PDF(s), if I put all the iText jars into a folder and add it in IntelliJ, I can use the iText functions and if the program works,...

Multi-Threading error when binding a StringProperty


java,multithreading,javafx,javafx-8
I have a question about multi-threading and the binding of a StringProperty. I have a class CacheManager, which contains a Thread which updates my cache with the changes on the server. Now, I want to notify the user with a text and percentage of the progress (which are a Label...

How to make a Javafx Image Crop App


java,image,canvas,graphics,javafx
I am building an application for my colleagues to crop image. I use FXML with Scene Builder to build the GUI. The user click a button to choose a image from his computer. Then, the image is shown in the GUI. User can zoom and move in the pane. At...

How to change ImageView on KeyPressed


javafx
I am having difficulty trying to solve this, I am currently trying to figure out how to change the ImageView to another ImageView when I press a certain Key on my keyboard but I have no idea how to, I have already looked around almost everywhere I can think of...

Getting a mouse position with JavaFX and Event


java,javafx
I'm trying to get the position of a mouse click in my JavaFX application. I have an EventHandler as so: EventHandler<Event> mouseHandler = new EventHandler<Event>() { @Override public void handle(Event event) { String eType = event.getEventType().toString(); if(eType.equals("MOUSE_PRESSED")){ //mouse position } } }; which is called on mouse press, release and...

UI4J - Get the entire document innerhtml


java,javafx,ui4j
Is there a way to get the innerhtml for the entire page, including html, head, body and so on. I am only able to call page.getDocument().getBody().getInnerHTML() ... there is no page.getDocument().getInnerHTML() ... shouldn't there be ?...

Array Out of Bounce Exception for Jar, but not Eclipse


java,eclipse,jar
When I convert my Java project into a Jar file, an ArrayIndexOutOfBounds exception of -2 occurs in line 3 of this section of code: for (int i = 0; i < copy.get(copy.size() - 2).size(); i++) { if (!copy.get(copy.size() - 2).get(i).toString().equals(" ")) { startLocations[index] = Integer.parseInt(copy.get(copy.size() - 2).get(i).toString()); index++; } }...

FX - Suggestions for aligning CheckBox in Grid


java,checkbox,javafx,grid,alignment
Converting from Swing to FX here. We have some CheckBoxes where the Label appears on the left side of the CheckBox. We are accomplishing this by calling setNodeOrientation(NodeOrientation.RIGHT_TO_LEFT); The problem is that in some GridPanes, we'll have a Label in column 0 with a Node in column 1 on row...

Why JavaFX requires Platform.runLater to change anything in it's UI inside a thread?


java,multithreading,swing,javafx
This code of a simple swing application: final JFrame jFrame = new JFrame(); final JLabel jLabel = new JLabel("Test"); jFrame.add(jLabel); jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jFrame.pack(); jFrame.setLocationRelativeTo(null); jFrame.setVisible(true); Thread thread = new Thread(){ @Override public void run() { while(true) { jLabel.setText("Time: " + System.currentTimeMillis()); try { Thread.sleep(1000);} catch(Exception ex) {} } } }; thread.setDaemon(true);...

Schedule to run a executable jar file on windows 7


jar,windows-7,scheduled-tasks
I created a task in task scheduler on Windows 7 system and made it repeatable every 10 minutes. In program, i selected the executable java jar file. But it does not run the jar file at the scheduled time. When i double click and run the jar file, it runs...

Access resource from inside jar


java,jar,classloader
I got a jar file test.jar that contains a folder resources which contains txtFile.txt. I'm trying to access the file but the file seems to be null. package main; import java.net.URL; public class Test { private Test() { URL file = this.getClass().getClassLoader().getResource("/resources/txtFile.txt"); System.out.println(file == null); } public static final void...

JavaFX8 : Single Controller for 1+1popup scene (Solved)


java,javafx,fxml
After following the tutorial at http://www.javafxtutorials.com/tutorials/switching-to-different-screens-in-javafx-and-fxml/, I have a functioning popup window, however, I am having difficulty figuring out how to interact with it with a controller. From the tutorial, I got the impression that there is to be a shared controller between the two FXML files, but I'm having...