• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why are my labels invisible?

 
Elouise Kivineva
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've got this:
public void init(){
Container container = getContentPane();
getContentPane().setBackground( Color.yellow );
container.setLayout( new BorderLayout() );
JPForm = new JPanel();
JPForm.setLayout( new GridLayout(3, 1, 2, 2) );
LblHeight = new JLabel(" Korkeus (mm): ");
LblWidth = new JLabel(" Leveys (mm): ");
LblSideSpace = new JLabel(" Sivutila (mm): ");
JPForm.add( LblHeight );
JPForm.add( LblWidth );
JPForm.add( LblSideSpace );
container.add( JPForm, BorderLayout.EAST );

The labels are never there and the background color command is also ignored. Why? It's so similar to applet's I've had work but now when I want the labels on a panel in an applet I can't get it to work.
[ May 13, 2002: Message edited by: Elouise Kivineva ]
[ May 13, 2002: Message edited by: Elouise Kivineva ]
[ May 13, 2002: Message edited by: Elouise Kivineva ]
[ May 13, 2002: Message edited by: Elouise Kivineva ]
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure of exactly how you are doing things. The following code creates an applet that looks like the following picture for me:
 
Elouise Kivineva
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your code & applet looks convencing but I just haven't had time yet to get back & find my errors. Thank you very much for your help though and I'll compare yours & mine ASAP.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic