• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Changing Beetwen Scenes.

 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, I found that code at Youtube which allows you to change window by clicking button.
How do i edit this to works without event , ex. at public void initialize(URL url, ResourceBundle rb) {}


So this is the code.

How do i change this to work outside events because i need to use there event to getSource ?
 
Rancher
Posts: 387
30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> How do i change this to work outside events because i need to use there event to getSource ?

Can you provide an example of where you would like to do this outside the context of the event?
Perhaps a description of the use-case or a code snippet or mcve (https://stackoverflow.com/help/mcve) with a comment in it, "// how do I change scene here...".
 
Arek Wróbel
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

John Damien Smith wrote:> How do i change this to work outside events because i need to use there event to getSource ?

Can you provide an example of where you would like to do this outside the context of the event?
Perhaps a description of the use-case or a code snippet or mcve (https://stackoverflow.com/help/mcve) with a comment in it, "// how do I change scene here...".


Because to let this code work I need to use some kind of event example:

But I want to put this code:

In initialize() method. But it won't work because there is no variable like event in there.  - >>

So how do i can change this code to work outside Event handlers?
 
Rancher
Posts: 5008
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

how do i can change this code to work


Where can it get a reference to the Stage object that it needs?
 
reply
    Bookmark Topic Watch Topic
  • New Topic