Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #1220

Re: MDI Application Help

From "Jeff Higgins" <jeff.higgins@THRWHITE.remove-dii-this>
Subject Re: MDI Application Help
Message-ID <P8mLh.245$IO2.196@newsfe04.lga> (permalink)
Newsgroups comp.lang.java.gui
References <1174023150.166496.158950@e65g2000hsc.googlegroups.com>
Date 2011-04-27 15:32 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui

"Noobie & Newbie" <jimmychankokchern1@msn.com> wrote in message 
news:1174023150.166496.158950@e65g2000hsc.googlegroups.com...
> Hi guys, I am building a MDI application. In my MainClass(Parent),
> there is a toolbar which contain many Jbutton. When I click
> New(JButton in Toolbar), it will show a new JInternalFrame(Child) into
> the JDesktopPanel. When i click Add(another JButton in ToolBar), it
> will insert a pic into the JInternalFrame. The problem lies with that
> when I call two JInternalFrame out (Frame_A & Frame_B), I am only able
> to Insert pic in Frame_B since it is call out later. I know the
> problem lies within this code of lines
>
> <code>
> public App app;
>
> private void newApp( java.awt.event.ActionEvent evt) // button new
> event
> {
>  app = new App();
>  app.setVisible(true);
>  jDesktopPane1.add(app);
> }
> </code>
> It overwrite Frame_A when Frame_B is created
> How can I solve this problem.
>
> Thanks.
>

I may be way off base here but...
maybe use JInternalFrame.setSelected(true) at some point.

from InternalFrameDemo.java
http://java.sun.com/docs/books/tutorial/uiswing/components/examples/index.html#InternalFrameDemo

 //Create a new internal frame.
    protected void createFrame() {
        MyInternalFrame frame = new MyInternalFrame();
        frame.setVisible(true); //necessary as of 1.3
        desktop.add(frame);
        try {
            frame.setSelected(true);
        } catch (java.beans.PropertyVetoException e) {}
    }

I'm sure you've seen the 'How to Use Internal Frames' tutorial.
http://java.sun.com/docs/books/tutorial/uiswing/components/internalframe.html

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

MDI Application Help "Noobie & Newbie" <noobie.&.newbie@THRWHITE.remove-dii-this> - 2011-04-27 15:31 +0000
  Re: MDI Application Help "Jeff Higgins" <jeff.higgins@THRWHITE.remove-dii-this> - 2011-04-27 15:32 +0000

csiph-web