hi again!
thanks for your last advice, but when i do:
JLabel score = new JLabel((new Integer(num)).toString());
int num = 5;
it tells me "illegal forward reference"
i will give you the whole program if it is soemthing to do with soemthing elswhere:
import static java.lang.System.out;
import javax.swing.*;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
class GameScreen1 extends JFrame implements ActionListener{
JLabel label8 = new JLabel("hi! this is your score!");
JLabel label9 = new JLabel("feel free to look at your score any time");
JLabel score = new JLabel((new Integer(num)).toString());
JButton l = new JButton("ok");
int num = 5;
public GameScreen1(){
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) ;
setLayout(new FlowLayout()) ;
add(label8);
add(label9);
add(score);
score.setEnabled(false);
add(l);
l.addActionListener(this);
pack();
setVisible(true);
}
public void actionPerformed(ActionEvent e) {
l.setEnabled(false);
new GameChoose();
}
}
my main method is in another class
also, as a after note, how can you add 1 to score from another class whenit doesn't allow you to do ++ or +1 etc?
i'd be very gratefull if soem1 could help me
