ok, so I am using JLabel to have 75 numbers show up on the users screen, the thing is though, is that on occassion 1 of the JLables doesn't show up?? It doesnt seem to be any certain one as once it was the number 8, another time it was 61, etc...
I am building the JLabels as so:
public JLabel GB[] = new JLabel[75]; // before the constructor
//in the constructor
for(int i = 0;i<GB.length;i++) {
y = y + 30;
if(i==15) { x = x + 30; y = 218; }
if(i==30) { x = x + 30; y = 218; }
if(i==45) { x = x + 30; y = 218; }
if(i==60) { x = x + 30; y = 218; }
GB[i] = new JLabel(Integer.toString(i+1), JLabel.CENTER);
GB[i].setForeground(Color.LIGHT_GRAY);
GB[i].setFont(new Font("Verdana", Font.BOLD, 15));
GB[i].setBounds(x,y,28,28);
}
//in the method when I want it to appear
for(int i = 0;i<GB.length;i++) {
Mainwindow.getContentPane().add(GB[i]);
GB[i].setVisible(true);
}
the wierd thing is that most of the time they all show up, but just occassionally one doesn't?
is there something im not doing right?
is there a way to check to be sure they all load properly?
Thank you for any help..

New Topic/Question
Reply


MultiQuote



|