1 Packageinterface;2 Importjava.awt.*;3 4 ImportJavax.swing.JFrame;5 Importjavax.swing.*;6 //import javax.swing.table.*;7 8 9 Public classDmgl_interfaceextendsjframe{Ten One A //defining buttons and labels - JLabel L_header,l_language,l_type,l_title; - JComboBox Language,type; the JTextField Title; - JTextArea Code; - JButton confirm,cancle; - + - Publicdmgl_interface () + { A at - - //Layout -Container ContentPane = Getcontentpane ();//Defining container class objects -SetLayout (NewFlowLayout ());//do not set layout -Settitle ("Add Code"); in //Language Box -JPanel p_header=NewJPanel (); toString [] slanguage=Newstring[]{"Default", "Java", "JavaScript", "C", +"C + +", "C #", "PHP", "Delphi", "SAS", "pl/sq", "Web", "ABAP"}; -L_header =NewJLabel ("Language"); theLanguage=NewJComboBox (slanguage); * $ Panax Notoginseng P_header.add (l_header); - P_header.add (Language); the + //Type box AL_type =NewJLabel ("type"); theString [] stype=Newstring[]{"Default", "function", "Knowledge", "Module", "program",}; +Type=NewJComboBox (stype); - $ P_header.add (l_type); $ P_header.add (Type); - Add (p_header); - //Title Box theJPanel p_title=NewJPanel (); -L_title =NewJLabel ("Please enter title");WuyiTitle =NewJTextField ("", 20); the P_title.add (l_title); - P_title.add (Title); Wu Add (p_title); - //text Field AboutCode =NewJTextArea ("", 20,32); $JScrollPane G_code =NewJScrollPane (code,jscrollpane.vertical_scrollbar_always,jscrollpane.horizontal_scrollbar_always); - Add (g_code); - - A //Button +JPanel p_button=NewJPanel (); theconfirm=NewJButton ("Save"); -cancle=NewJButton ("Cancel"); $ P_button.add (Confirm); the P_button.add (cancle); the Add (P_button); the //To set the window's visible words and size theSetSize (400,550); -SetVisible (true); in } the the About the the the + //Main function - Public Static voidMain (String args[]) the {Bayi Newdmgl_interface (); the } the -}
Java Simple page Authoring