• 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

Doubt on JFrame

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear all,

Is it possible to embed an JFrame into an another JFrame. If we can, tell me the way of adding it. Looking forward your response.

Thanks,
Ram
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ramkumar Vaitheki:
... embed an JFrame into an another JFrame.



Use JInternalFrame
 
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you look through the API for JFrame and find the add() method, find out what type of parameter it can take. If that is JFrame or one of its superclasses, then you can embed a JFrame inside another JFrame, yes.

But why??? It seems pointless.
 
Campbell Ritchie
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, Maneesh, JInternalFrame is a much better idea.
 
Ramkumar Vaitheki
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By default in swing, all the components are containers. JFrame is a container as well as component. I should not use JInternalFramem,needed to use JFrame alone. It gives "Illegal argument exception" while trying it.

Ram
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> Is it possible to embed an JFrame into an another JFrame.

what happened when you tried it?

> I should not use JInternalFramem,needed to use JFrame alone.
> It gives "Illegal argument exception" while trying it.

JInternalFrames are (typically) added to a JDeskTopPane,
the desktopPane then being added to the JFrame
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic