Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


FXML problems when open a new Stage Scene..! filter_list
Author
Message
FXML problems when open a new Stage Scene..! #1
Hello brothers  first of all I apreciated the post from @Ex094  he open my eyes  to create amazing gui's with FX Scene Builder.
Now I 'm  codding a program for Web Masters  and I'got a problem when I open a new Stage.

I've got  three fxml  one for the main , the second fxml has  two label (with imageviews) , the thirds fxml only has and Webview

For the label I had create  onmouseClicked method  it looks like this
@FXML
   private void openIconFinder(MouseEvent event) throws IOException {
       try {
       FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("FXMLIcon_Finder.fxml"));
               Parent root1 = (Parent) fxmlLoader.load();
               Stage stage = new Stage();          
               stage.setScene(new Scene(root1));  
               stage.show();
       } catch(Exception e) {
          e.printStackTrace();
   
   }
}
okey,  as you can see as I want is open a new Stage  including in its the Scene created in my "FXMLIcon_Finder.fxml". but
for some reasons i cann't understand  why doesn't works for me

[Image: 241se2x.png]

In my Webview java controler  class the code is :

public class FXMLWebViewController implements Initializable {
   @FXML
   private WebView webview;

   /**
    * Initializes the controller class.
    */
   @Override
   public void initialize(URL url, ResourceBundle rb) {
      webview.getEngine().load("https://www.google.com");
   }    
   
Thanks for read me and  for your time
[Image: oAnNAVY.png]

[+] 1 user Likes Hu3c0's post
Reply

RE: FXML problems when open a new Stage Scene..! #2
Thanks Smile

About the problem, Are you sure the .fxml file is in the same package as your main controller?

Location is not set means that you have not provided a valid path to your .fxml file and remember file names are case sensitive too so check that just in case
My Blog: http://www.procurity.wordpress.com
Donations: 1HLjiSbnWMpeQU46eUVCrYdbkrtduX7snG

Reply

RE: FXML problems when open a new Stage Scene..! #3
Yes it's brother i attach an image project
[Image: 552rg5.png]

From the SceneController I call FXMLIconFinder as you apreciate it's in the same packege I'm very ofuscated with this I cann't foward with my project.
[Image: oAnNAVY.png]

Reply

RE: FXML problems when open a new Stage Scene..! #4
Try CLEAN AND BUILD on the project and then run it again, then report back
My Blog: http://www.procurity.wordpress.com
Donations: 1HLjiSbnWMpeQU46eUVCrYdbkrtduX7snG

Reply

RE: FXML problems when open a new Stage Scene..! #5
I did it and the same result
[Image: oAnNAVY.png]

Reply

RE: FXML problems when open a new Stage Scene..! #6
I see your .fxml file name is different than the one you put in your file "FXMLIcon_Finder.fxml" or did you changed it just now?
My Blog: http://www.procurity.wordpress.com
Donations: 1HLjiSbnWMpeQU46eUVCrYdbkrtduX7snG

Reply

RE: FXML problems when open a new Stage Scene..! #7
i have question what is FXML ?
Expalin it to me pls!
And you use java yes? Wich IDE you use?
Die  But Don't Lie
“Oh Abu Dharr! Don’t look at the smallness of the sin but look at the one you disobeyed.” Prophet Muhammad (pbuh)
[Image: p_237m2jx1.png]
Click for Free VPN

Reply

RE: FXML problems when open a new Stage Scene..! #8
This is definitely a problem with the path that you are providing, Also try this:
Code:
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/Scenes/FXMLIconFinder.fxml"));

@Mr.Kurd Check out my tutorial on JavaFX https://sinister.ly/Thread-Tutorial-Java...evelopment
My Blog: http://www.procurity.wordpress.com
Donations: 1HLjiSbnWMpeQU46eUVCrYdbkrtduX7snG

[+] 1 user Likes Ex094's post
Reply

RE: FXML problems when open a new Stage Scene..! #9
thank buddy really thank.

thank buddy really thank i read it all with my matmatic. Hhhh
(This post was last modified: 08-11-2016, 07:19 PM by Mr.Kurd.)
Die  But Don't Lie
“Oh Abu Dharr! Don’t look at the smallness of the sin but look at the one you disobeyed.” Prophet Muhammad (pbuh)
[Image: p_237m2jx1.png]
Click for Free VPN

Reply

RE: FXML problems when open a new Stage Scene..! #10
(08-11-2016, 07:01 PM)Ex094 Wrote: This is definitely a problem with the path that you are providing, Also try this:
Code:
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/Scenes/FXMLIconFinder.fxml"));

@Mr.Kurd Check out my tutorial on JavaFX https://sinister.ly/Thread-Tutorial-Java...evelopment



No  it isn't  the reasons  look at the  image

[Image: f3zfa.png]

[Image: vfh3ma.png]

What can be the problem...?   I'm figthing with it three days. For first time i was wondering the same  of you the fxml path.
One think more if you see the image in the code there is a method call it base64Method and its works
[Image: oAnNAVY.png]

Reply







Users browsing this thread: 2 Guest(s)