| |

VerySource

 Forgot password?
 Register
Search
View: 1100|Reply: 7

Several basic problems of java interface development!

[Copy link]

2

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-2-10 18:30:02
| Show all posts |Read mode
As I am learning Java GUI development for the first time, there are a lot of concepts that are a bit confusing. I hope you can give pointers!
1. Swing container class: Is JFrame equivalent to the form in VB? If not, when will JFrame be used?
2. Is JPanel placed on top of the JFrame as an intermediate container? What role does he have? If you only use JFrame without Jpanel, is it not allowed to put controls?
3. JScrollpane is a scroll, is it basically the same as Jpanel?
4. Layout managers: FlowLayout, BorderLayout, GridLayout, I feel particularly difficult to use, because it is not easy to design the interface, is not how to use these management layout managers most of the time? Is it a more flexible layout manager used most of the time? For example: GridBagLayout.
Well, that's all for now. Waiting online!
Reply

Use magic Report

0

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 Invalid IP Address

Post time: 2020-4-13 22:30:01
| Show all posts
1yes
2yes intermediate container no
3yes
4 Each container has a default Layout. If the default does not meet the requirements, you must define the Layout yourself.
Reply

Use magic Report

0

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 Invalid IP Address

Post time: 2020-4-13 22:45:02
| Show all posts
1Y
2Y intermediate container N
3Y
4 Each container has a default layout. If it is not suitable, customize the layout.
Reply

Use magic Report

1

Threads

51

Posts

32.00

Credits

Newbie

Rank: 1

Credits
32.00

 China

Post time: 2020-4-18 19:15:01
| Show all posts
1.VB looks almost -.- JFRAME is one of the four upper components of SWING
2. No! JFrame.getContainer () can be filled with components, adding JAPNEL is only JPANEL easy to operate
3. No, basically the same, there will be no two things
4. Set the layout to NULL and drag freely
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-5-11 18:00:01
| Show all posts
The process of using panel is your process of dividing the window layout. This process must consider at any resolution,
Drag to any size, your window looks the most natural, this is the beauty of the layout manager.
for example:
There is an order window, the upper part is to display the header information with labels, text baskets, etc., and the lower part is to display the details of the goods with a table.
It is easy to achieve with the layout manager.When you pull down the large window, only the table will grow, and the header will not be long or necessary (because the header information is fixed).
You can degenerate to VB state by setting the layout manager to null, but personally feel that you should not do that.
Reply

Use magic Report

2

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-6-29 18:45:01
| Show all posts
Can it be set to boxbaglayout? Does this show the same effect on different machines?
Reply

Use magic Report

0

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-7-24 22:00:01
| Show all posts
1Y
2Y intermediate container N
3Y
4 If you want to design a beautiful interface, then you can use BorderLayout, GridBagLayout, etc. according to your needs. In fact, there is an example that you can understand once you use it yourself. GridBagLayout is flexible and powerful. It feels troublesome to use for the first time, but it's good to get used to it.
Reply

Use magic Report

0

Threads

23

Posts

17.00

Credits

Newbie

Rank: 1

Credits
17.00

 China

Post time: 2020-7-29 17:30:01
| Show all posts
Third: There is a JViewPort class in JScrollPane, which is very different from JPanel
Fourth: The layout is more than just what you listed. Haha, Box and Spring in the swing package are also important tools for participating in layout. With them, you can replace many Layouts, and BorderLayout is also a commonly used layout tool
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list