30
Oct
LOAD_FILE Generated when a File is loaded. LOST_FOCUS Generated when a Component loses the focus. MOUSE_DOWN Generated when the mouse button is pressed down. MOUSE_DRAG Generated if the mouse moves while being clicked (dragged). MOUSE_ENTER Generated when the mouse enters a Component. MOUSE_EXIT Generated when the mouse leaves a Component. MOUSE_MOVE Generated when the user moves the mouse without pressing the button. MOUSE_UP Generated when the mouse button is released. PGDN Generated when the key is pressed. PGUP Generated when the key is pressed. RIGHT Generated when the right arrow key is pressed. SAVE_FILE Generated when a file is saved by the AWT. SHIFT_MASK Indicates that the key is down. UP Generated when the up arrow key is pressed. Implementing the Client Chat Room Applet Code First, let s get rid of all of the mundane steps. The ChatClient.java Startup File Start with a file called ChatClient.java and put this skeleton in it. It includes all of the global variables we will eventually need. You may not recognize them all now, but don t worry, you will. import java.applet.*; import java.net.*; import java.lang.*; import java.io.*; import java.awt.*; import java.util.*; public class ChatClient extends Applet { /* network stuff first */ Socket sock; DataInputStream dis; PrintStream ps; String name, theHost; int thePort; /* now the Thread */ Thread kicker = null; /* And finally the AWT stuff */
Note: If you are looking for good and quality webspace to host and run your java application check Actions java hosting services
This entry was posted
on Monday, October 30th, 2006 at 12:23 am and is filed under java jsp tomcat.
You can follow any responses to this entry through the RSS 2.0 feed.
Responses are currently closed, but you can trackback from your own site.