Ecrit par
ibiiztera le dimanche 10 juin 2012 dans le thème :
Java
voila j'essaie le tout dernier javafx 2.2 beta et et javafx scene builder
je crée une interface avec scene builder:
l'interface
le code
package syphotron;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class Editor extends Application {
public static void main(String[] args) {
Application.launch(ImageView.class, args);
}
@Override
public void start(Stage stage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("objet editor.fxml"));
stage.setTitle("Image Viewer");
stage.setScene(new Scene(root, 300, 275));
stage.show();
}
}
le débogage:
init:
Deleting: C:\Users\Mary\Documents\dev\syphotron\build\built-jar.properties
deps-jar:
Updating property file: C:\Users\Mary\Documents\dev\syphotron\build\built-jar.properties
Duplicated project name in import. Project jfx-impl defined first in C:\Users\Mary\Documents\dev\syphotron\nbproject\jfx-impl.xml and again in C:\Users\Mary\Documents\dev\syphotron-Preloader\nbproject\jfx-impl.xml
syphotron-Preloader.init:
syphotron-Preloader.deps-jar:
Updating property file: C:\Users\Mary\Documents\dev\syphotron\build\built-jar.properties
syphotron-Preloader.compile:
Copying 1 file to C:\Users\Mary\Documents\dev\syphotron-Preloader\build
Copy libraries to C:\Users\Mary\Documents\dev\syphotron-Preloader\dist\lib.
To run this application from the command line without Ant, try:
C:\Program Files\Java\jdk1.7.0_04/bin/java -jar "C:\Users\Mary\Documents\dev\syphotron-Preloader\dist\syphotron-Preloader.jar"
Deleting directory C:\Users\Mary\Documents\dev\syphotron-Preloader\dist\lib
Detected JavaFX Ant API version 1.2
syphotron-Preloader.jfx-deployment:
syphotron-Preloader.jar:
Compiling 1 source file to C:\Users\Mary\Documents\dev\syphotron\build\classes
compile-single:
run-single:
Device "Mobile Intel(R) 4 Series Express Chipset Family" (\\.\DISPLAY1) initialization failed :
WARNING: bad driver version detected, device disabled. Please update your driver to at least version 8.15.10.2302
Page language not specified.
/C:/Users/Mary/Documents/dev/syphotron/build/classes/syphotron/LoadForm_1.fxml:13
at javafx.fxml.FXMLLoader$Element.processEventHandlerAttributes(Unknown Source)
at javafx.fxml.FXMLLoader$ValueElement.processEndElement(Unknown Source)
at javafx.fxml.FXMLLoader.processEndElement(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at syphotron.ImageView.start(ImageView.java:17)
at com.sun.javafx.application.LauncherImpl$5.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl$5.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl$4.run(Unknown Source)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$100(Unknown Source)
at com.sun.glass.ui.win.WinApplication$2$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:722)
Exception in Application start method
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at com.sun.javafx.application.LauncherImpl.access$000(Unknown Source)
at com.sun.javafx.application.LauncherImpl$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:722)
Caused by: javafx.fxml.LoadException: Page language not specified.
at javafx.fxml.FXMLLoader$Element.processEventHandlerAttributes(Unknown Source)
at javafx.fxml.FXMLLoader$ValueElement.processEndElement(Unknown Source)
at javafx.fxml.FXMLLoader.processEndElement(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at syphotron.ImageView.start(ImageView.java:17)
at com.sun.javafx.application.LauncherImpl$5.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl$5.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl$4.run(Unknown Source)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$100(Unknown Source)
at com.sun.glass.ui.win.WinApplication$2$1.run(Unknown Source)
... 1 more
Java Result: 1
BUILD SUCCESSFUL (total time: 11 seconds)
Classé sous : at,
javafx,
source,
unknown,
fxml