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

Thread: frame deactivation

  1. #1
    Member
    Join Date
    Jan 2012
    Posts
    57
    My Mood
    Fine
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default frame deactivation

    how to inactive one frame on creation of second frame in netbeans............ but i dont wanna to hide the first frame.....its like when we open notepad and write some text and without saving we some time close it ,then a new small frame is generated and asks to save don't save and cancel ...at that time the notepad is disabled unless we click on one of the options , as i mentioned....
    plzzz specify .........
    Thanks


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: frame deactivation

    What do you mean by "to inactive"? Do you mean to have the second frame be modal and keep control until it is closed?
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Member
    Join Date
    Jan 2012
    Posts
    57
    My Mood
    Fine
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default Re: frame deactivation

    yes its like that .. the control will be returned to the first frame when the second frame is closed or after an appropriate action has taken....

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: frame deactivation

    Use a JDialog that is modal instead of a second frame.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Member
    Join Date
    Jan 2012
    Posts
    57
    My Mood
    Fine
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default Re: frame deactivation

    but how i can add my own code if i want to add to JDialog .....actually i m developing a notepad application and in that if user type some text and directly closed the notepad without saving the data then it should be prompt the same message as in actual window notepad like save,don't save and cancel button..but how to add these functionality to the JDialog ?????

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: frame deactivation

    Have you tried putting your code into a JDialog? What problems are you having?

    closed the notepad without saving the data
    There are listeners you can use to catch a user closing a window.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Image without a frame, is it possible?
    By knightmetal in forum AWT / Java Swing
    Replies: 5
    Last Post: August 15th, 2012, 03:52 AM
  2. Text and picture in a frame
    By wfalcon2012 in forum AWT / Java Swing
    Replies: 2
    Last Post: February 20th, 2012, 11:21 AM
  3. problem developing a frame help me...
    By bluestar_me in forum AWT / Java Swing
    Replies: 3
    Last Post: February 18th, 2012, 05:18 AM
  4. Replies: 1
    Last Post: January 19th, 2012, 03:44 PM
  5. Filling the frame
    By Metadeth in forum AWT / Java Swing
    Replies: 2
    Last Post: July 11th, 2011, 03:28 PM