NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Java FX FXML application Not starting - No error messages

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
Morons



Joined: 08 Nov 2016
Posts: 7
Location: South Africa

PostPosted: Thu Mar 02, 2017 2:40 pm    Post subject: Java FX FXML application Not starting - No error messages Reply with quote

It baffles me

It compiles run but no screen is opened !

I am prolly making a rooky mistake?

Code:
package za.co.zone.ffefx.views;

import java.io.IOException;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;

/**
 * @author Morons
 */
public class Main extends Application {

    @Override
    public void start(Stage stage) throws Exception {
        try {
            FXMLLoader loader = new FXMLLoader();
            loader.setLocation(Main.class.getResource("CustomerMainFXML.fxml"));
            AnchorPane root = (AnchorPane) loader.load();
            Scene scene = new Scene(root);
            stage.setScene(scene);
            stage.setTitle("Customer Management");
            stage.getIcons().add(new Image(Main.class.getResourceAsStream("img/ico.png")));
            stage.setResizable(false);
            stage.sizeToScene();
            stage.show();
        } catch (IOException e) {
            e.getMessage();
        }
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        launch(args);
    }

}


Code:
ant -f C:\\Development\\NetBeansProjects\\FoodFrontEndFx jfx-rebuild
init:
deps-clean:
Updating property file: C:\Development\NetBeansProjects\FoodFrontEndFx\build\built-clean.properties
Deleting directory C:\Development\NetBeansProjects\FoodFrontEndFx\build
clean:
init:
deps-jar:
Created dir: C:\Development\NetBeansProjects\FoodFrontEndFx\build
Updating property file: C:\Development\NetBeansProjects\FoodFrontEndFx\build\built-jar.properties
Created dir: C:\Development\NetBeansProjects\FoodFrontEndFx\build\classes
Created dir: C:\Development\NetBeansProjects\FoodFrontEndFx\build\classes\META-INF
Copying 1 file to C:\Development\NetBeansProjects\FoodFrontEndFx\build\classes\META-INF
Created dir: C:\Development\NetBeansProjects\FoodFrontEndFx\build\empty
Created dir: C:\Development\NetBeansProjects\FoodFrontEndFx\build\generated-sources\ap-source-output
Compiling 14 source files to C:\Development\NetBeansProjects\FoodFrontEndFx\build\classes
Copying 6 files to C:\Development\NetBeansProjects\FoodFrontEndFx\build\classes
compile:
Created dir: C:\Development\NetBeansProjects\FoodFrontEndFx\dist
Copying 25 files to C:\Development\NetBeansProjects\FoodFrontEndFx\dist\lib
Detected JavaFX Ant API version 1.3
Launching <fx:jar> task from C:\Program Files\Java\jdk1.8.0_121\jre\..\lib\ant-javafx.jar
Warning: From JDK7u25 the Codebase manifest attribute should be used to restrict JAR repurposing.
         Please set manifest.custom.codebase property to override the current default non-secure value '*'.
Launching <fx:deploy> task from C:\Program Files\Java\jdk1.8.0_121\jre\..\lib\ant-javafx.jar
No base JDK. Package will use system JRE.
No base JDK. Package will use system JRE.
jfx-deployment-script:
jfx-deployment:
jar:
jfx-rebuild:
BUILD SUCCESSFUL (total time: 3 second
Back to top
Francisco Ernesto Teixeir
Posted via mailing list.





PostPosted: Thu Mar 02, 2017 9:17 pm    Post subject: Java FX FXML application Not starting - No error messages Reply with quote

Hello,

Like Jack, cutting the code, the really main is:


Code:
package za.co.zone.ffefx.views;import java.io.IOException;import javafx.application.Application;import javafx.fxml.FXMLLoader;import javafx.scene.Scene;import javafx.scene.layout.AnchorPane;import javafx.stage.Stage;/** * @author Morons */public class Main extends Application {    @Override    public void start(Stage stage) throws Exception {        try {            FXMLLoader loader = FXMLLoader.load(this.getClass().getClassLoader().getResource("CustomerMainFXML.fxml"));
Scene scene = new Scene(page);            Scene scene = new Scene(root);            stage.setScene(scene);            stage.setTitle("Customer Management");            stage.show();        } catch (IOException e) {            e.getMessage();        }    }    /**     * @param args the command line arguments     */    public static void main(String[] args) {        launch(Main.class, args);    }}





loader.setLocation is wrong too. You need to load.



2017-03-02 11:40 GMT-03:00 Morons <address-removed ([email]address-removed[/email])>:
Quote:
It baffles me

It compiles run but no screen is opened !

I ap prolly making a rooky mistake?


Code:
package za.co.zone.ffefx.views;

import java.io.IOException;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;

/**
 * @author Morons
 */
public class Main extends Application {

    @Override
    public void start(Stage stage) throws Exception {
        try {
            FXMLLoader loader = new FXMLLoader();
            loader.setLocation(Main.class.getResource("CustomerMainFXML.fxml"));
            AnchorPane root = (AnchorPane) loader.load();
            Scene scene = new Scene(root);
            stage.setScene(scene);
            stage.setTitle("Customer Management");
            stage.getIcons().add(new Image(Main.class.getResourceAsStream("img/ico.png")));
            stage.setResizable(false);
            stage.sizeToScene();
            stage.show();
        } catch (IOException e) {
            e.getMessage();
        }
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        launch(args);
    }

}





Code:
ant -f C:\\Development\\NetBeansProjects\\FoodFrontEndFx jfx-rebuild
init:
deps-clean:
Updating property file: C:\Development\NetBeansProjects\FoodFrontEndFx\build\built-clean.properties
Deleting directory C:\Development\NetBeansProjects\FoodFrontEndFx\build
clean:
init:
deps-jar:
Created dir: C:\Development\NetBeansProjects\FoodFrontEndFx\build
Updating property file: C:\Development\NetBeansProjects\FoodFrontEndFx\build\built-jar.properties
Created dir: C:\Development\NetBeansProjects\FoodFrontEndFx\build\classes
Created dir: C:\Development\NetBeansProjects\FoodFrontEndFx\build\classes\META-INF
Copying 1 file to C:\Development\NetBeansProjects\FoodFrontEndFx\build\classes\META-INF
Created dir: C:\Development\NetBeansProjects\FoodFrontEndFx\build\empty
Created dir: C:\Development\NetBeansProjects\FoodFrontEndFx\build\generated-sources\ap-source-output
Compiling 14 source files to C:\Development\NetBeansProjects\FoodFrontEndFx\build\classes
Copying 6 files to C:\Development\NetBeansProjects\FoodFrontEndFx\build\classes
compile:
Created dir: C:\Development\NetBeansProjects\FoodFrontEndFx\dist
Copying 25 files to C:\Development\NetBeansProjects\FoodFrontEndFx\dist\lib
Detected JavaFX Ant API version 1.3
Launching <fx:jar> task from C:\Program Files\Java\jdk1.8.0_121\jre\..\lib\ant-javafx.jar
Warning: From JDK7u25 the Codebase manifest attribute should be used to restrict JAR repurposing.
         Please set manifest.custom.codebase property to override the current default non-secure value '*'.
Launching <fx:deploy> task from C:\Program Files\Java\jdk1.8.0_121\jre\..\lib\ant-javafx.jar
No base JDK. Package will use system JRE.
No base JDK. Package will use system JRE.
jfx-deployment-script:
jfx-deployment:
jar:
jfx-rebuild:
BUILD SUCCESSFUL (total time: 3 second










--
Francisco Ernesto TeixeiraOCJP/OCSOAII/ZCE-PHP/ABC...Z/QSFAV/PPM/On Demand Specialist


Hey! You can meet me at my personal page: http://francisco.pro


Get the most simple and powerful MySQL manager at
http://www.heidisql.com/

Astah: Changing how you design software and systems through UML and mind mapping integrated tools
http://astah.net/
[url=http://www.heidisql.com/][/url]
Back to top
Francisco Ernesto Teixeir
Posted via mailing list.





PostPosted: Thu Mar 02, 2017 9:18 pm    Post subject: Java FX FXML application Not starting - No error messages Reply with quote

AnchorPane root = (AnchorPane) lFXMLLoader.load(this.getClass().getClassLoader().getResource("CustomerMainFXML.fxml"));
Scene scene = new Scene(root);
stage.setScene(scene);
stage.setTitle("Customer Management");
stage.show();


2017-03-02 18:16 GMT-03:00 Francisco Ernesto Teixeira <address-removed ([email]address-removed[/email])>:
Quote:
Hello,

Like Jack, cutting the code, the really main is:


Code:
package za.co.zone.ffefx.views;import java.io.IOException;import javafx.application.Application;import javafx.fxml.FXMLLoader;import javafx.scene.Scene;import javafx.scene.layout.AnchorPane;import javafx.stage.Stage;/** * @author Morons */public class Main extends Application {    @Override    public void start(Stage stage) throws Exception {        try {            FXMLLoader loader = FXMLLoader.load(this.getClass().getClassLoader().getResource("CustomerMainFXML.fxml"));
Scene scene = new Scene(page);            Scene scene = new Scene(root);            stage.setScene(scene);            stage.setTitle("Customer Management");            stage.show();        } catch (IOException e) {            e.getMessage();        }    }    /**     * @param args the command line arguments     */    public static void main(String[] args) {        launch(Main.class, args);    }}





loader.setLocation is wrong too. You need to load.



2017-03-02 11:40 GMT-03:00 Morons <address-removed ([email]address-removed[/email])>:
Quote:
It baffles me

It compiles run but no screen is opened !

I ap prolly making a rooky mistake?


Code:
package za.co.zone.ffefx.views;

import java.io.IOException;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;

/**
 * @author Morons
 */
public class Main extends Application {

    @Override
    public void start(Stage stage) throws Exception {
        try {
            FXMLLoader loader = new FXMLLoader();
            loader.setLocation(Main.class.getResource("CustomerMainFXML.fxml"));
            AnchorPane root = (AnchorPane) loader.load();
            Scene scene = new Scene(root);
            stage.setScene(scene);
            stage.setTitle("Customer Management");
            stage.getIcons().add(new Image(Main.class.getResourceAsStream("img/ico.png")));
            stage.setResizable(false);
            stage.sizeToScene();
            stage.show();
        } catch (IOException e) {
            e.getMessage();
        }
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        launch(args);
    }

}





Code:
ant -f C:\\Development\\NetBeansProjects\\FoodFrontEndFx jfx-rebuild
init:
deps-clean:
Updating property file: C:\Development\NetBeansProjects\FoodFrontEndFx\build\built-clean.properties
Deleting directory C:\Development\NetBeansProjects\FoodFrontEndFx\build
clean:
init:
deps-jar:
Created dir: C:\Development\NetBeansProjects\FoodFrontEndFx\build
Updating property file: C:\Development\NetBeansProjects\FoodFrontEndFx\build\built-jar.properties
Created dir: C:\Development\NetBeansProjects\FoodFrontEndFx\build\classes
Created dir: C:\Development\NetBeansProjects\FoodFrontEndFx\build\classes\META-INF
Copying 1 file to C:\Development\NetBeansProjects\FoodFrontEndFx\build\classes\META-INF
Created dir: C:\Development\NetBeansProjects\FoodFrontEndFx\build\empty
Created dir: C:\Development\NetBeansProjects\FoodFrontEndFx\build\generated-sources\ap-source-output
Compiling 14 source files to C:\Development\NetBeansProjects\FoodFrontEndFx\build\classes
Copying 6 files to C:\Development\NetBeansProjects\FoodFrontEndFx\build\classes
compile:
Created dir: C:\Development\NetBeansProjects\FoodFrontEndFx\dist
Copying 25 files to C:\Development\NetBeansProjects\FoodFrontEndFx\dist\lib
Detected JavaFX Ant API version 1.3
Launching <fx:jar> task from C:\Program Files\Java\jdk1.8.0_121\jre\..\lib\ant-javafx.jar
Warning: From JDK7u25 the Codebase manifest attribute should be used to restrict JAR repurposing.
         Please set manifest.custom.codebase property to override the current default non-secure value '*'.
Launching <fx:deploy> task from C:\Program Files\Java\jdk1.8.0_121\jre\..\lib\ant-javafx.jar
No base JDK. Package will use system JRE.
No base JDK. Package will use system JRE.
jfx-deployment-script:
jfx-deployment:
jar:
jfx-rebuild:
BUILD SUCCESSFUL (total time: 3 second












--
Francisco Ernesto TeixeiraOCJP/OCSOAII/ZCE-PHP/ABC...Z/QSFAV/PPM/On Demand Specialist


Hey! You can meet me at my personal page: http://francisco.pro


Get the most simple and powerful MySQL manager at
http://www.heidisql.com/

Astah: Changing how you design software and systems through UML and mind mapping integrated tools
http://astah.net/
[/url]









--
Francisco Ernesto TeixeiraOCJP/OCSOAII/ZCE-PHP/ABC...Z/QSFAV/PPM/On Demand Specialist


Hey! You can meet me at my personal page: [url=http://francisco.pro/]http://francisco.pro


Get the most simple and powerful MySQL manager at
http://www.heidisql.com/

Astah: Changing how you design software and systems through UML and mind mapping integrated tools
http://astah.net/
[url=http://www.heidisql.com/][/url]
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo