groovygarden
Programmer
- Aug 23, 2001
- 63
Hi, could someone help me work out what I'm doing wrong...?
I'm trying to get a frame to "pop-up" showing the highest test marks.
The code to create the frame is below. A frame does appear but it is empty...
displayBoard is called like this:
As I said, a frame appears but it is completly empty...
Any suggestions gratefuly received...!
I'm trying to get a frame to "pop-up" showing the highest test marks.
The code to create the frame is below. A frame does appear but it is empty...
Code:
import javax.swing.*;
import java.awt.*;
public class displayBoard extends JFrame {
ScoreBoard gamescores;
displayBoard(ScoreBoard scores){
gamescores = scores;
}
public displayBoard() {
JLabel[] theScores = new JLabel[5];
JPanel scorePane = new JPanel();
setContentPane(scorePane);
for (int i=0; i<gamescores.noScores; i++){
theScores[i]= new JLabel();
theScores[i].setText(Long.toString
(gamescores.highScore[i].getTime()));
scorePane.add(theScores[i]);
}
}
}
Code:
displayBoard display = new displayBoard(this);
display.show();
Any suggestions gratefuly received...!