//Chat WindowImportjava.awt.*;Importjavax.swing.*; Public classJiemian9extendsjframe{JTextArea Wby;//text FieldJPanel MB;//PanelJComboBox xlk;//Drop- down boxJButton an;//ButtonJTextField wbk;//text BoxJScrollPane GD;//scrolling Public Static voidMain (string[] args) {//to run this class of construction methodsJiemian9 Jiemian =NewJiemian9 (); } PublicJiemian9 () {//AddWby =NewJTextArea (); MB=NewJPanel (); String[] LT= {"Goku", "Eight commandments", "Sand Monk", "Tang priest"}; Xlk=NewJComboBox (LT); an=NewJButton ("Send"); WBK=NewJTextField (10); GD=NewJScrollPane (Wby); //Add to PanelMb.add (XLK); Mb.add (WBK); Mb.add (an); This. Add (GD); This. Add (Mb,borderlayout.south); //Set Window caption This. settitle ("Chat window"); //Set the width height of the window This. SetSize (500,350); //add title bar picture This. Seticonimage (NewImageIcon ("Image/1.jpg") . GetImage ()); //The Settings window appears for the location of the screen This. setlocation (100,100); //no pulling the big pull small This. setresizable (false); //releasing a resource after closing a window This. Setdefaultcloseoperation (Jframe.exit_on_close); //Output Window This. setvisible (true); } }
JAVA Chat Window