• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying panels...

 
celine mcgowan
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone,

Sorry to bother you all again. I am again having probs with an accursed LED panel thingy. I have finally got it to compile etc - thanks everyone for your help with that (see post here:Non-default constructor problem)! Anyway, I have a method which updates the gifs which are in an LEDPanel:


I am calling the above method 8 times in another class in order to output 8 LED displays. Here's that code:


When i run LEDPanel, i only get one panel displaying. It seems to be the last panel, but i'm not sure! Does anyone know why there is only one LED displaying, and not all 8?

Thanks again all.
Celine
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read up about layout managers in your Swing reference. You need to use one.

Jules
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it's the size, possible this line
setBorder( BorderFactory.createEmptyBorder( 20, 20, 20, 20 ) );

should be
ledPanel.setBorder( BorderFactory.createEmptyBorder( 20, 20, 20, 20 ) );
 
celine mcgowan
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Thanks for your help. I have changed the code in LEDPanel so that there is a GridLayout manager (one row, eight columns) on the main Panel:


This still only outputs one LED... Am i doing something really silly?

Thanks,
Celine
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Swing / JFC / AWT forum...
[ August 20, 2004: Message edited by: Dirk Schreckmann ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic