This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes trying to add label Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "trying to add label" Watch "trying to add label" New topic
Author

trying to add label

Candy Bortniker
Ranch Hand

Joined: Mar 17, 2003
Posts: 123
I have a small simple window that is just to test my bean with. I tried to add a label but it does not show on the window. What do I need to do differently?
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

You are creating lblGAN, and are adding it to the content pane, but you never call setBounds() on it. This is one (of many) reasons using a null layout is discouraged.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: trying to add label
 
Similar Threads
"add" method
Resizing components
making a class visible
JDialog Opens Very Tiny
Save information in SQL database using timer