1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help.../ How Can I Stop Opening Multiple JInternalFrames Of Same Instance/Kind!

Discussion in 'Java' started by Ali Raza, Jul 6, 2011.

  1. Ali Raza

    Ali Raza New Member

    Joined:
    Jul 6, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi,
    1) I'm making project in java API 6. I'm using "Net Beans 6.5.1".
    2) I want to use "JInternalFrame" in my project
    3) I made another package and made "JInternalFrame" there. And then call it in my main application window by firing action performed event on "JMenuItem".
    4) It works fine but only one problem occurs that is, if i click on "JMenuItem" again and again, new "JInternalFrame" of same instance are opening, How can i stop that?
    5) I want that, if I open "JInternalFrame" once and then i again click on "JMenuItem" to open the same "JInternalFrame", it Should do nothing or it shows the window which already opened and minimized.


    Thanks In Advance!
     
  2. virxen

    virxen New Member

    Joined:
    Nov 24, 2009
    Messages:
    387
    Likes Received:
    90
    Trophy Points:
    0
    define one global JInternalFrame

    public JInternalFrame frame1;

    in the JMenuItem action listener do not use
    something like ---> new JInternalFrame();
    refer to frame1 instead.


    for more i must see your code.
     
  3. ManzZup

    ManzZup New Member

    Joined:
    May 9, 2009
    Messages:
    278
    Likes Received:
    43
    Trophy Points:
    0
    Occupation:
    Production Manager:Software @ ZONTEK
    Location:
    Sri Lanka
    Home Page:
    i bit of your action performed coding would be of help for further help :)
     

Share This Page