*
The moose likes Swing / AWT / SWT and the fly likes Displaying Frames inside a Frame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Displaying Frames inside a Frame" Watch "Displaying Frames inside a Frame" New topic
Author

Displaying Frames inside a Frame

Raghav Mathur
Ranch Hand

Joined: Jan 12, 2001
Posts: 641
Hi
1) I have a class A
2) I have a class a1 which resides inside class A
3) I have a class a2 which resides inside class A
4) Class a1 and a2 extend the Frame class
How can i produce a Frame for class A , which would comprise of these 2 frames( a1 and a2)
Please guide me a bit
Thanks in advance


Raghav.
Mike Dahmus
Greenhorn

Joined: Mar 07, 2002
Posts: 29
The simplest way to achieve the goal I think you want is to have your outer frame include a JDesktopPane as its client area; and then reimplement each of your other two frames as a JInternalFrame; which gives you most of what a JFrame gives you.


-----Mike Dahmus mike@dahmus.org
Raghav Mathur
Ranch Hand

Joined: Jan 12, 2001
Posts: 641
Mike
Can you be a bit more elaborate. I,am using the Frame class not the JFrame class.
Thanks in advance
Originally posted by Mike Dahmus:
The simplest way to achieve the goal I think you want is to have your outer frame include a JDesktopPane as its client area; and then reimplement each of your other two frames as a JInternalFrame; which gives you most of what a JFrame gives you.

[ April 17, 2003: Message edited by: raghav mathur ]
Raghav Mathur
Ranch Hand

Joined: Jan 12, 2001
Posts: 641
HI Mike
1 more question
With InternalFrames can i use the same KeyListener interface as it is being used in the Frame class .
Thanks in advance
Kindly guide me a bit..... i,am new to swings
[ April 17, 2003: Message edited by: raghav mathur ]
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Frame is an AWT class... there's no MDI widgets for AWT, so you'll have to move to Swing. (MDI stands for Multiple Document Interface - basically an interior desktop containing frames like you describe...)

Could you elaborate what KeyListener interface are you talking about with Frames?


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Mike Dahmus
Greenhorn

Joined: Mar 07, 2002
Posts: 29
Originally posted by raghav mathur:
HI Mike
1 more question
With InternalFrames can i use the same KeyListener interface as it is being used in the Frame class .
Thanks in advance
Kindly guide me a bit..... i,am new to swings
[ April 17, 2003: Message edited by: raghav mathur ]

Yes, you should be able to use KeyListener in JInternalFrames. I've simulated a version of Windows inside Java that way; and obviously keyboard events are important.
The API for JFrames is practically identical to Frames; so that shouldn't pose a big problem.
Regards,
Mike
 
jQuery in Action, 2nd edition
 
subject: Displaying Frames inside a Frame