| Author |
Getting a Component to show?
|
James Hodgkiss
Ranch Hand
Joined: Jan 22, 2004
Posts: 401
|
|
My JApplet creates a JPanel and adds it to the display. I then try to add a JLabel to that JPanel, but the JLabel doesn't show. I've called validate() on the JPanel, but no change. How can I get the JLabel to show? Thanks, James
|
 |
Sam Codean
Ranch Hand
Joined: Feb 26, 2006
Posts: 194
|
|
|
Have you tried the repaint() method. A Code snippet would be more useful if you could share it.
|
-Sam Codean<br />SCJP 1.4 (98%)<br />SCJD 5.0 (87.5%)
|
 |
James Hodgkiss
Ranch Hand
Joined: Jan 22, 2004
Posts: 401
|
|
Cheers for the reply. I've sorted it now. Problem was that the method I created to do it was (stupidly) called add(), and it was calling Container's add method instead of my method - which is why it wasn't showing up... Thanks again, James
|
 |
Sam Codean
Ranch Hand
Joined: Feb 26, 2006
Posts: 194
|
|
|
Congrats!! You cracked it ;-)
|
 |
 |
|
|
subject: Getting a Component to show?
|
|
|