java-Graphical interface Components

Source: Internet
Author: User

java-Graphical Interface a common class
Non-container components must be placed on the container component
JFrame window container class
JPanel panel placed on window non-container class


JButton button placed on panel non-container class


JTextField text box non-container class


JLabel Label non-container class

Two commonly used methods

1 f.setsize (500, 500); set size

2 f.setvisible (true); setting
is not visible

3 f.setdefaultcloseoperation (jframe.exit_on_close); Set default exit status

4 p.add (t); Panel add component

5 F.getcontentpane (). Add (P); window adding panel

6 Font ft = new Font ("Microsoft Jas Black", font.bold);


java-Graphical interface Components

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.