CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2008
    Posts
    16

    Unhappy Spawn new window on button click: how?

    How do I do that? I have a button that when clicked shows up another window, and the previous window will close. Upon closing the new window shall the previous window be brought back again.

    Can NetBeans help in creating those kinds of applications?

  2. #2
    Join Date
    Apr 2007
    Posts
    442

    Re: Spawn new window on button click: how?

    You have setVisible(...) which takes a boolean param, so set the previous window not visible, have the noew Window grab focus, and give the code which handles these windows a WindowListener / WindowAdapter that will detect when the new window closes. Upon closing set the old window visible again.

  3. #3
    Join Date
    Sep 2006
    Location
    Eastern, NC, USA
    Posts
    907

    Re: Spawn new window on button click: how?

    NetBeans can help construct the JFrames and JDialogs, but I don't think it will automate what you are trying to do. Regardless if it did or not, you don't want the tool to be hindering the learning. Go to the Sun Swing tutorials and read all you can about JFrames and JDialogs (and everything else!). Good luck.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured