Re: refresh/repain JFrame
- From: Knute Johnson <nospam@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 27 Sep 2007 09:49:55 -0700
knguyen wrote:
On Sep 26, 10:58 pm, Knute Johnson <nos...@xxxxxxxxxxxxxxxxxxxxxxx>
wrote:
knguyen wrote:Hello again,You are going to have to give us a little more of a clue than that.
Is there a proper way to repaint/refresh a JFrame? I tried calling
repaint() but it doesn't seem to work?
Thanks
-k
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
In what component do you want to display the "Client X Currently Connected"? A simple solution is to display the message in a JLabel. After you connect to your client, change the text in the JLabel.
--
Knute Johnson
email s/nospam/knute/
.
- References:
- refresh/repain JFrame
- From: knguyen
- Re: refresh/repain JFrame
- From: Knute Johnson
- Re: refresh/repain JFrame
- From: knguyen
- refresh/repain JFrame
- Prev by Date: Re: encrypted source file support in jdk?
- Next by Date: Re: encrypted source file support in jdk?
- Previous by thread: Re: refresh/repain JFrame
- Next by thread: Re: refresh/repain JFrame
- Index(es):