|
用JAVA SOCKET制作一个广播信使的程序(6) import Java.net.*; import Java.awt.*; import Java.awt.image.*; import Java.awt.event.*; import Javax.swing.*; import Javax.swing.event.*; public class ChatClient implements Runnable, WindowListener, ActionListener, ListSelectionListener { protected String host; protected int port; public TextArea output; protected TextField input; String yourname; SketchFrame window; public ChatClient (String host, int port, SketchFrame window) { //CONSTRUCTOR INITIALIZING THE ChatClient CLASS this.host = host; //host AND port WILL BE USED TO OPEN THE //SOCKET this.port = port; this.yourname=JOptionPane.showInputDialog("Enter Login name:"); //TO CREATE AN INPUT DIALOG BOX window.setSize(100,100); //TO SET THE SIZE OF THE CLIENT //WINDOW
|