Those years, learn together Java 9-2

Source: Internet
Author: User

2.import java.awt.flowlayout;import java.awt.gridlayout;import java.awt.menu;import  java.awt.menubar;import java.awt.menuitem;import javax.swing.jcheckbox;import  javax.swing.jcombobox;import javax.swing.jframe;import javax.swing.jpanel;import  javax.swing.jradiobutton;import javax.swing.jtextarea;public class test {public  static void main  (String[] args) {jframe test= new jframe (); Test.setLayout ( New gridlayout (2,1)); Final menu menu1 = new menu ("File");final menu  Menu2 = new menu ("edit"); Final menu menu3 = new menu ("help"); Menubar menubar = new menubar (); Menubar.add (menu1); Menubar.add (MENU2); Menubar.add (MENU3); Test.setmenubar (menubar); Jpanel pan1 = new jpanel (New flowlayout ()); string font[] = {"Song Body", "Ah du body", "Xiangyang body", "handsome handsome Body", "Pengcheng Body"}; String fontsize[] = {"", "" "," "", "",  "};final jcombobox cb1 = new jcombobox" (font); Final jcombobox cb2 = new jcombobox (fontSize); Jcheckbox kb1 = new jcheckbox ("bold"); Jcheckbox kb2 = new jcheckbox ("italic"); Jradiobutton rb1 = new jradiobutton ("Red",  true); Jradiobutton rb2 = new jradiobutton ("green"); Jradiobutton rb3 = new jradiobutton ("Blue");p An1.add (CB1);p an1.add (CB2);p an1.add (KB1); Pan1.add (KB2);p an1.add (RB1);p an1.add (RB2);p an1.add (RB3); Test.add (PAN1); Jtextarea text1 = new jtextarea ("welcome  Welcome", 35,25); Test.add (Text1); Test.setVisible ( true); Test.pack ();}}


Those years, learn together Java 9-2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.