| 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: 32839
|
|
|
Your setVisible() call should be last. Otherwise you can try validate() or revalidate().
|
 |
Darryl Burke
Bartender
Joined: May 03, 2008
Posts: 4206
|
|
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: 32839
|
|
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: 32839
|
|
|
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.
|
 |
 |
|
|
subject: Components not showing in Applet
|
|
|