Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

JavaFX GUI problems

$
0
0
So, I am new to javaFx, and I am getting a whole lot of troubles from trying to run my project.

so I am just trying to get it to run right now. and It won't even do that and I am tired of sitting here getting nothing done and hurting my head. If some one could point out or explain to me what I am doing wrong on the set up on this I would be grateful.

Here is my StackTrace
Page language not specified.
/C:/Users/dspecht/Dropbox/csc150finale/bin/mainMenu.fxml:44
  at javafx.fxml.FXMLLoader$Element.processEventHandlerAttributes(FXMLLoader.java:505)
  at javafx.fxml.FXMLLoader$ValueElement.processEndElement(FXMLLoader.java:589)
  at javafx.fxml.FXMLLoader.processEndElement(FXMLLoader.java:2430)
  at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2136)
  at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2028)
  at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2744)
  at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2723)
  at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2709)
  at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2696)
  at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2685)
  at GameStartUp.start(GameStartUp.java:17)
  at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
  at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:215)
  at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
  at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
  at java.security.AccessController.doPrivileged(Native Method)
  at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
  at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
  at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
  at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:73)
  at java.lang.Thread.run(Unknown Source)

LOADERS can not find the file
javafx.fxml.LoadException: Page language not specified.
	at javafx.fxml.FXMLLoader$Element.processEventHandlerAttributes(FXMLLoader.java:505)
	at javafx.fxml.FXMLLoader$ValueElement.processEndElement(FXMLLoader.java:589)
	at javafx.fxml.FXMLLoader.processEndElement(FXMLLoader.java:2430)
	at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2136)
	at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2028)
	at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2744)
	at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2723)
	at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2709)
	at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2696)
	at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2685)
	at GameStartUp.start(GameStartUp.java:17)
	at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
	at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:215)
	at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
	at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
	at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:73)
	at java.lang.Thread.run(Unknown Source)



I have tried putting the jfxrt.jar into the build path and it has not worked. I have tried different methods of writing the start methods, and I have tried re installing e(fx)clispe.

Also I want to note I do not want to see just copy and paste code to help me, that is not going to help me or the small team this project is working on. This is just the GUI start of it, not the whole thing and I don't want the project done for me. I would just like some explanation of why this is not working at all.

Here is what I am working with code wise

import java.io.IOException;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class GameStartUp extends Application {

	@Override
	public void start(Stage primaryStage) {
		try { 
			
		// Main Menu set up 
			Parent rootMenu = (Parent) FXMLLoader.load(getClass().getResource("mainMenu.fxml"));
		
		Scene mainMenuScene = new Scene(rootMenu);
		primaryStage.setScene(mainMenuScene);
		primaryStage.setTitle("Menu");
		primaryStage.show();
		
		// Options Set up 
			Parent rootOptions = (Parent) FXMLLoader.load(getClass().getResource("Options.fxml"));
			
			Stage OptionsStage = new Stage();
			OptionsStage.setTitle("Options Menu");
			OptionsStage.initOwner(primaryStage);
			
		Scene optionsMenuScene = new Scene(rootOptions);
		
		
		} catch(IOException e) { 
			System.err.println("LOADERS can not find the file");
			e.printStackTrace();
		}
	}

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



Thank you for the time of reading this and possible a helpful response

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>