• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Displaying Frames inside a Frame

 
Ranch Hand
Posts: 641
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic