• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Illegal state exception in Java assignment

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Code:

The Issue:

Any help would be best
 
Ranch Hand
Posts: 570
3
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Put your fxml file to resources folder, not in src.
 
Rancher
Posts: 387
30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unfortunately there are many reasons why loading the FXML file may go wrong, so it is not possible to say exactly what your issue is here.

This question on StackOverflow details some of the issues others have encountered in the past:
 http://stackoverflow.com/questions/17228487/javafx-location-is-not-set-error-message

Issues range from your IDE not copying the file to the target directly, spelling errors in the FXML filename, not placing the FXML in the same compile output directory as your loading class, etc.

The basic issue is that Main.class.getResource("Test.fxml") is returning null because it can't find the related fxml class.

If your app is being built into a jar, run jar tvf on your jar and check that Text.fxml is in the same folder within the jar as your application/Main.class
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic