正在加载图片...
Creating gul objects // Create a button with text OK J Button jbtOK-new JButton"OK); l Create a label with text Enter your name JLabel jlbIName = new JLabel("Enter your name: " abel Text Check Rad field Button Display GUI Components Button OK Enter your name: Type Name Here [ Bold O Red Red Green l Create a text field with text" Type Name Here Combo JText F ield jtfName =new JTextField("Type Name Here") l Create a check box with text bold JCheck Box jchk Bold=new JCheck Box("Bold") // Create a radio button with text red JRadioButton jrbRed=new JRadio Button("Red"); l Create a combo box with choices red, green, and blue JComboBox jco Color==new JComboBox(new Stringl("Red Green"," Blue")) Introduction to Java Programming, revised by Dai-kaiyuLiang,Introduction to Java Programming,revised by Dai-kaiyu 5 Creating GUI Objects // Create a button with text OK JButton jbtOK = new JButton("OK"); // Create a label with text "Enter your name: " JLabel jlblName = new JLabel("Enter your name: "); // Create a text field with text "Type Name Here" JTextField jtfName = new JTextField("Type Name Here"); // Create a check box with text bold JCheckBox jchkBold = new JCheckBox("Bold"); // Create a radio button with text red JRadioButton jrbRed = new JRadioButton("Red"); // Create a combo box with choices red, green, and blue JComboBox jcboColor = new JComboBox(new String[]{"Red", "Green", "Blue"}); Button Label Text field Check Box Radio Button Combo Box
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有