• Post Reply Bookmark Topic Watch Topic
  • New Topic

Container

 
kedar parundekar
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we add frame into another frame?
Can we add window into another window?
what is top level window?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> Can we add frame into another frame?

it would take you no longer than a few seconds to write a test program

JFrame f = new JFrame();
f.add(new JFrame());

and see the result for yourself
 
kedar parundekar
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Michael Dunn:
> Can we add frame into another frame?

it would take you no longer than a few seconds to write a test program

JFrame f = new JFrame();
f.add(new JFrame());

and see the result for yourself



If I run above program then I have one runtime exception i.e java.lang.IllegalArgumentException
 
kedar parundekar
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Michael Dunn:
> Can we add frame into another frame?

it would take you no longer than a few seconds to write a test program

JFrame f = new JFrame();
f.add(new JFrame());

and see the result for yourself



If I run above program then I have one runtime exception i.e java.lang.IllegalArgumentException
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't be coy: what's the whole error message:

Exception in thread "main" java.lang.IllegalArgumentException: adding a window to a container

Hmmm... adding a window to a container causes an error because the window argument is illegal. Hmmm.... :roll:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!