• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Why are my labels invisible?

 
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
This parrot is no more. It has ceased to be. Now it's a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic