How does Java swing place a button anywhere in the popup box? (Use of Absolute layout layouts)

Source: Internet
Author: User

Get ready:

Absolute layout absolute layouts, where controls can be placed anywhere in an absolute layout

How do I make a pop-up box like the one below?

--------------------------------------------

Create a new pop-up box, then select Getcontentpane (), and then set the shrimp's layout property to Absolute layout.

Then drag JButton from the left to the pop-up box on the right, and you'll find that JButton can be placed anywhere you want.

Homework:

1. Make one of the following pop-up boxes

The upper-left and lower-right corners are a jtextarea, respectively, A and B, the middle is a JButton

Requirements:

1. After entering the text in B, click on the button text to appear in a, and also in the console output B text, and finally empty the input in B

2. When there is too much content in a or B, you can scroll to see what is not displayed

How does Java swing place a button anywhere in the popup box? (Use of Absolute layout layouts)

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.