wood burning stoves*
The moose likes Swing / AWT / SWT and the fly likes Components not showing in Applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Components not showing in Applet" Watch "Components not showing in Applet" New topic
Author

Components not showing in Applet

Stanley Mungai
Ranch Hand

Joined: Dec 09, 2011
Posts: 155

I am making an Applet and After the Login, the following Form Should Show. The form is showing Properly bu the Components are not visible. Can anyone tell me why?

This is My class:




The Button, The labels and the TextField Are not visible.


Give a beggar a fish; feed him for a day. Teach him how to fish; Feed him for a lifetime.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
Your setVisible() call should be last. Otherwise you can try validate() or revalidate().
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4664
    
    5

Actually, an Applet doesn't need a setVisible(true) at all.

Additionally, you need to learn how to use layout managers: http://docs.oracle.com/javase/tutorial/uiswing/layout/index.html

It's good practice to remove inane IDE generated comments and your own comments that aren't relevant to the stated problem before posting here; anything extraneous just adds clutter.


luck, db
There are no new questions, but there may be new answers.
Stanley Mungai
Ranch Hand

Joined: Dec 09, 2011
Posts: 155

Guys I actually Do not think This is the Problem because the Applet Shows all The components on its own. I think It is how I am calling it from the Login Class. I used This Method




Is this enough to make the Applet start or there s something I am Misiing??
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
Have you altered the original code to remove the setVisible call? You mustn’t do that.
Stanley Mungai
Ranch Hand

Joined: Dec 09, 2011
Posts: 155

I was FOllowing Burke's Advice, But My Issue is that When the Applet is run On its own, the components displays. It is Suppossed to be started after Login from another Applet. What I a Getting is a blank Form.

Returned the SetVisible(true) function....Nothing
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
I didn’t mean the code you are using, I meant the code you had posted. Sorry for not being clear. You mustn’t change the code in a post after it has been answered.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Components not showing in Applet