[6044] in java-interest
cpu load
daemon@ATHENA.MIT.EDU (Brian Compston)
Mon Mar 18 12:44:46 1996
Date: Mon, 18 Mar 1996 16:57:01 GMT
Reply-To: Java Interest <JAVA-INTEREST@javasoft.com>
From: Brian Compston <brian1@CAMTEK.CO.UK>
To: Multiple recipients of list JAVA-INTEREST
<JAVA-INTEREST@JAVASOFT.COM>
System = Sparc5 Solaris 2.5
Can anyone tell me what I am doing wrong (or is this a Bug ?), but when
I compile and try this simple bit of code the cpu meter goes to 100%
and the load starts to increase, every time the mouse moves onto the
java window. Change the TextField to a Label and everything is OK.
Regards
Brian Compston
----------------
import java.awt.*;
import java.net.*;
public class Client {
String DestinationServerName = new String("mymachinename");
TextField server_name;
public static void main(String args[])
{
Client myclient = new Client();
ClientPopup f = new ClientPopup("Client");
f.setLayout(new FlowLayout());
myclient.server_name = new TextField(myclient.DestinationServerName);
f.add(myclient.server_name);
f.resize(300, 250);
f.show();
}
}
class ClientPopup extends Frame {
private String title;
ClientPopup(String title)
{
super();
setTitle(title);
this.title = title;
MenuBar mb = new MenuBar();
Menu m = new Menu("File");
m.add(new MenuItem("Quit"));
mb.add(m);
setMenuBar(mb);
}
}