Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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 The Software Craftsman this week in the Agile 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.
 
Have you tried LearnNowOnline? http://www.learnnowonline.com/
 
subject: trying to add label