permaculture playing cards
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
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: 10824

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
It's not a secret anymore!