201671010131 2016-2017-2 "Java Programming"

Source: Internet
Author: User

Although the use of abstract classes is to make the code concise, but you define the abstract class, but do not know what the abstract class specifically what to write.

This week you learned the fill of the frame content.

Adds a button to the content box, and a background color when the button executes.

JButton Yellowbutton = new JButton ("Yellow");//Tag string

Buttonpanel = new JPanel ();

Buttonpanel.add (Yellowbutton); button is added to the panel.

Coloraction yellowaction = new coloraction (Color. YELLOW); Create a Color object

Yellowbutton.addactionlistener (yellowaction);//Listener, Listener button object

A method that maps buttons and keyboard actions to action objects in a GUI program.

Mouse click: When the mouse click on the window to produce a small box, when the mouse inside the small box, the cursor becomes a 10 glyph. The mouse can stall small blocks to move. When you double-click a small square, wipe the small square.

201671010131 2016-2017-2 "Java Programming"

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.