Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPanel

 
Dean Kiely
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a problem, I have created a JFrame right and also had an applet created and I wanted to join the applet up with my jframe. I now want to break down the applet to put it on as a jpanel.
So i am trying to put a JPanel onto the JFrame but I am getting the following error.
java.lang.IllegalArgumentException: adding a window to a container
can anyone help or advise me please.
Tanx
 
Craig Wood
Ranch Hand
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this what you are trying to do?
 
Craig Wood
Ranch Hand
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops, I used a font that is not in the JRE. This one should be okay.
And the "loading an applet" part may be more in alignment with you question...
 
Dean Kiely
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for replying Craig, ye i am trying to do something like this. I am still having problems with the actual joining of the two components. I have two seperate running components i.e a japplet and then a jframe (which consists of a textare, textfield and some buttons) and no matter what I try I can not figure out a good way to have the both of them on a single container.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic