this code is part of client. the part of getting information from the server is working, but it's not calling to repaint function (line 6).
public class Client extends JPanel implements Runnable{
public Client() throws IOException{
f = new JFrame("Bad Ice Cream by - Rotem Hanoch");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(this.width,this.height);
f.setResizable(false);
f.setFocusable(false);
f.setVisible(true);
initBoard();
f.add(this);
}
public void run(){
while(true){
try {
Board.Type mat[][] = (Board.Type[][]) this.objectInputStream.readObject();
updateBoard(mat);
this.repaint();
} catch (IOException ex) {} catch (ClassNotFoundException ex) {}
}
}
public void paintComponent(Graphics g){
System.out.println("hello");
}
}
I tried to figure out why it doesn't work because it doesn't recognize the function. I expect it to print me a message so I know it has reached the function.