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 Swing components not shown 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 "Swing components not shown" Watch "Swing components not shown" New topic

Swing components not shown

Ashok Pradhan
Ranch Hand

Joined: Dec 17, 2007
Posts: 180

I have created a JFrame in which a JPanel and some JLabel,JPasswordField and JButton is added when I run my program my App does not show some of the components,when I minimize it and again restore it then it shows all the components and OK.

My program is:

My System Config is:

Win XP,JDK 1.6

"I don't understand what is the problem with my program it works when I minimize and restore it"

Please someone help me
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9995

Make the last statement in your run() method.

In principle, you create a frame/container, add its children and then make it visible.

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Ashok Pradhan
Ranch Hand

Joined: Dec 17, 2007
Posts: 180

Thanks now it works,I got it!!
I agree. Here's the link:
subject: Swing components not shown
Similar Threads
method declaration
How to set FoucsTraversalPolicy in GridLayout
create screen comaptible for all resoluions?
Unable to set label icon
Expanding JPanel