Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Need help setting different scenes from button click in a SplitPane setup

  1. #1
    Junior Member
    Join Date
    Feb 2024
    Location
    Australia
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Need help setting different scenes from button click in a SplitPane setup

    GDay All,

    I am new here and new to JavaFX, so be gentle with me, please.

    To outline my issue, I have a stage with the following:

    AnchorPane (Main Scene/Window)
    MenuBar
    SplitPane
    --AnchorPane (fxcid=leftPane)
    --AnchorPane (fxcid=rightPane)

    The AnchorPane fxcid=leftPane contains buttons and icon images only. This pane remains static and does not need to change.

    When I click on a button in leftPane, I would like to load the scene.fxml for the AnchorPane (fxcid=rightPane) when I click on it's button in leftPane.

    First of all, how would I address the AnchorPane fxcid=rightPane specifically and load a new scene into it?

    All of the tutorials and code examples I have found and followed all seem to show how to switch 2 scenes (Panes) and fail when I try to expand them to cover 9 different scenes (Panes). Of course, all the tutorials all seem to address every type of pane except an AnchorPane within a SplitPane ... lol

    Am I going about this the wrong way?

    Clearly, I am missing something.

    I would appreciate any help you can offer.

    Thanks in advance!

  2. #2
    Member Helium c2's Avatar
    Join Date
    Nov 2023
    Location
    Kekaha, Kaua'i
    Posts
    102
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Need help setting different scenes from button click in a SplitPane setup

    Probably. Where's this AnchorPane window located? Is it in some browser you're on or do you have it on some NetBeans and working on it there? Is the network you're on allowing Windows to show the finished program compiled product? Java.

  3. #3
    Junior Member
    Join Date
    Feb 2024
    Location
    Australia
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Need help setting different scenes from button click in a SplitPane setup

    Sorry, I should have stated that I was using the Eclipse IDE.

    Needless to say, I solved my issue. It seems that all of the code I tried, may have been functional, but for some reason it would not work in Eclipse.

    I went to the Project menu and clicked on Clean and after that I was able to get things working ... sigh.

    Thanks for the help though
    Regards
    Andy M

Similar Threads

  1. Java Click button not working
    By sansandae in forum Other Programming Languages
    Replies: 1
    Last Post: July 27th, 2021, 06:13 AM
  2. How to display an image to a click of a button
    By syedjavidali in forum What's Wrong With My Code?
    Replies: 7
    Last Post: January 4th, 2014, 08:28 AM
  3. How can I incorporate images when I click a button
    By SwagKingzMon in forum Java Theory & Questions
    Replies: 1
    Last Post: May 18th, 2013, 07:17 PM
  4. add JTextField with a click of button
    By A4Andy in forum AWT / Java Swing
    Replies: 1
    Last Post: August 31st, 2011, 07:34 AM
  5. Lock up code to the click of a button!!!
    By Allen Walker in forum Java Theory & Questions
    Replies: 2
    Last Post: July 1st, 2011, 09:12 AM

Tags for this Thread