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 5 of 5

Thread: Change JAVA Swing GUI Window in NetBeans

  1. #1
    Junior Member
    Join Date
    Aug 2014
    Location
    New Zealand
    Posts
    8
    My Mood
    Amazed
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Change JAVA Swing GUI Window in NetBeans

    Hi, Bradley here.

    I am currently learning JAVA GUI programming in NetBeans and was wondering how you go about changing the GUI window, or moving to a different one, and then going back.

    Any help would be much appreciated!

    Regards, Bradley.


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Change JAVA Swing GUI Window in NetBeans

    You're using the NetBeans GUIBuilder (graphical, drag and drop GUI creation), or have you coded the GUI "by hand?"

    While knowing that will be helpful, the typical process is a parent window is open, a choice is made in that window that opens another, and a choice is made in the new window that either closes it and reverts to the parent or causes another window to open with the same possible outcomes. This can go on forever (boring and tedious), or stay close to the original parent. How you accomplish that is dependent on your answer to my question.

    If you're using the GUIBuilder, then most here will not be able to help you, because that's an IDE question, not a Java coding question. If you're coding by hand, post a short, runnable example of an attempt to do what I've described above, and we'll help you sort it out whether it currently works or not.

  3. The Following User Says Thank You to GregBrannon For This Useful Post:

    tazeunite00 (August 29th, 2014)

  4. #3
    Senior Member
    Join Date
    Jul 2013
    Location
    Europe
    Posts
    666
    Thanks
    0
    Thanked 121 Times in 105 Posts

    Default Re: Change JAVA Swing GUI Window in NetBeans

    You can either create a new JFrame as an additional, independent window, or a JDialog if you want a popup. If you want the popup you could also use JOptionPane if its just something simple like an error message or a notification. Read the API's for these classes to learn how to use them properly.

  5. The Following User Says Thank You to Cornix For This Useful Post:

    tazeunite00 (August 29th, 2014)

  6. #4
    Junior Member
    Join Date
    Aug 2014
    Location
    New Zealand
    Posts
    8
    My Mood
    Amazed
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Change JAVA Swing GUI Window in NetBeans

    Hi Guys.

    I really appreciate your help. I am using the NetBeans GUIBuilder.

    That is OK if you aren't able to help me out.

    Regards, Bradley.

  7. #5
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Change JAVA Swing GUI Window in NetBeans

    Thread moved.

    There are multiple online Netbeans GUIBuilder references and tutorials. Just search for them.

    Good luck!

Similar Threads

  1. Replies: 2
    Last Post: May 2nd, 2013, 03:35 AM
  2. SWING GUI CONSOLE WINDOW DISPLAY
    By Khadafi in forum Java Theory & Questions
    Replies: 5
    Last Post: January 10th, 2012, 09:15 AM
  3. Problem with java swing JButton in Netbeans IDE
    By vrp in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 12th, 2011, 11:38 PM

Tags for this Thread