On Sep 26, 10:58 pm, Knute Johnson <nos...@rabbitbrush.frazmtn.com>
wrote:
knguyen wrote:
Hello again,
Is there a proper way to repaint/refresh a JFrame? I tried calling
repaint() but it doesn't seem to work?
Thanks
-k
You are going to have to give us a little more of a clue than that.
How about posting a simple, compilable test program that shows your problem?
--
Knute Johnson
email s/nospam/knute/
Basically, I have a client and a server running. The JFrame displays
some basic information and a button to "Connect To Server". What I
want is so that after I click "Connect To Server" and all the jazz are
done, my frame will display something like "Client X Currently
Connected" instead of "Connected to none"....
Here is my frame code..all the GUI are done in myPanel with data
pulled from a_peer
public class ZigzagFrame extends JFrame implements Observer{
JPanel myPanel;
public ZigzagFrame(Peer a_peer){
myPanel = new ZigzagPanel(a_peer);
add(myPanel);
}
public void update(Observable obs, Object obj){
System.out.println("Updated Haha");
this.repaint();
myPanel.repaint();
}
}
Thanks a lot
-k
Connected"? A simple solution is to display the message in a JLabel.
After you connect to your client, change the text in the JLabel.