Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #1186 > unrolled thread
| Started by | "Noobie & Newbie" <noobie.&.newbie@THRWHITE.remove-dii-this> |
|---|---|
| First post | 2011-04-27 15:31 +0000 |
| Last post | 2011-04-27 15:32 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.java.gui
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
| From | "Noobie & Newbie" <noobie.&.newbie@THRWHITE.remove-dii-this> |
|---|---|
| Date | 2011-04-27 15:31 +0000 |
| Subject | MDI Application Help |
| Message-ID | <1174023150.166496.158950@e65g2000hsc.googlegroups.com> |
To: comp.lang.java.gui
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.
---
* 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
[toc] | [next] | [standalone]
| From | "Jeff Higgins" <jeff.higgins@THRWHITE.remove-dii-this> |
|---|---|
| Date | 2011-04-27 15:32 +0000 |
| Message-ID | <P8mLh.245$IO2.196@newsfe04.lga> |
| In reply to | #1186 |
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
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.gui
csiph-web