• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Changing Beetwen Scenes.

 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • 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 ?
 
Ranch Hand
Posts: 374
24
  • Mark post as helpful
  • send pies
  • 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
  • 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: 3394
33
  • Mark post as helpful
  • send pies
  • 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?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!