|
|
|
|
|
|
Re: Jar file not running on double click. [message #1598854 is a reply to message #1598806] |
Tue, 03 February 2015 02:46  |
Eclipse User |
|
|
|
Did you inspect the jar file and is the fxml file there? Do you by
chance have a typo with upper/lower case which works in eclipse because
the windows filesystem is caseinsenstive?
Tom
On 03.02.15 08:01, Swati Sharma wrote:
> Hi Tom,
>
> Thanks
> The code in Main looks something like this:
>
>
> public class iAF_UI extends Application {
>
> public static int threadcount1;
> public static String jarDir;
> public static iAF_Controller controller;
> private Stage stage;
> private BorderPane root;
> @Override public void start(final Stage stage) throws Exception {
>
> CodeSource codeSource =
> iAF_UI.class.getProtectionDomain().getCodeSource();
> File jarFile = new
> File(codeSource.getLocation().toURI().getPath());
> jarDir = jarFile.getParentFile().getPath();
>
> final FXMLLoader loader = new
> FXMLLoader(getClass().getResource("iAF_GUI.fxml"));
> root = (BorderPane) loader.load();
> controller = (iAF_Controller)loader.getController();
> controller.setMainApp(this);
>
> Platform.setImplicitExit(false);
> //stage.setMaximized(true);
> stage.setTitle("IAF-Draft!"); stage.setScene(new
> Scene(root));
> stage.initStyle(StageStyle.UNIFIED);
> stage.getIcons().add(new
> Image(getClass().getResourceAsStream("logo.png")));
> stage.show();
> stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
> @Override
> public void handle(WindowEvent t) {
> Platform.exit();
> System.exit(0);
> }
> });
>
>
>
> }
>
> public Stage getStage() {
> return stage;
> }
>
> public static void main(String[] args) { launch(args); }
> }
>
>
> Thanks,
> Swati
>
|
|
|
Powered by
FUDForum. Page generated in 0.26694 seconds