Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying Frames inside a Frame

 
Raghav Mathur
Ranch Hand
Posts: 641
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Mike Dahmus
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Raghav Mathur
Ranch Hand
Posts: 641
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 641
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Mike Dahmus
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic