• 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

JavaFX Using Multiple Stages with Netbeans JavaFX Designer

Ranch Hand
Posts: 352
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm at my wits end. I am developing an in-house application in JavaFx using Netbeans 6.9 and its Fx Designer tooling. All is well with the UI design, however, I have come across a problem. In Netbeans, I create two fx files (essentially two classes with their own stages, scenes and States etc) through the use of the design and source views in Netbeans fx Designer. The classes are named 'Login' and 'Homepage' respectively. In the Main.fx file which I selected to be auto-created when the fx project is created in Netbeans, I set the run functions design variable to point to the Login class, which then gets its design file accordingly. When I run all is well I can see my Login Class OK and the window is shown.

I have created a Login button and form that receives user credentials on this login view which will check the credentials entered against a database, but for now the login button function is intended just to open the Homepage view, and herein lies my issue. How on Earth do I do this?? I am not using scenes, I have a Hompage.fx file which has its own class and Stage, but in Netbeans the default Stage and class cannot be altered (in this case the one in the Login Class). I have tried many different approaches, offered by Good and awful examples stemming from a Google Search.

Pragmatically I need to create functionality in the login function which creates a new instance of the Homepage Class and then runs the stage in that class, closing the login stage (or at least removing it from memory). The issue seems to be exacerbated by the auto generated code of Netbeans, which is a double edged blade for me as I need the drag and drop designer to save copious development time(IM the only developer on this project) but on the other hand it seems in this case, to be obfuscating my ability to customize the code I need.

I would love to print out all the code here for a better context but there is much auto generated nonsense which would confuse things, however I will try to give a pseudo outline.

Posts: 22650
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please try to keep your lines a bit shorter. I've split the long comment over two lines so there's no longer a need for horizontal scrolling.
What's gotten into you? Could it be this tiny ad?
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic