Detailed explanation of the use method of swing split window control jsplitpane

This article shares the usage of jsplitpane for your reference. The specific contents are as follows

1. Swing split window control jsplitpane is used to split the window into two parts.  

2. After the split window, only one control can be placed in each window. If you want more than one control, you can put a jpane panel on it, so that you can have more than one control. Swing split window control jsplitpane is used to split the window into two parts. Jsplitpane provides two constants for you to set whether to split vertically or horizontally. The two constants are: horizontal_ SPIT,VERTICAL_ SPLIT

3. Usage:

① . setdividersize (int size) sets the size of the splitter bar.

② , getdividersize() to get the size of the splitter bar.

③ Setdividerlocation (int size) sets the position of the splitter bar by percentage.

④ , getorientation to obtain the direction.

4. Construction method

Jsplitpane (): create a new jsplitpane, which contains two default buttons and is arranged horizontally without continuous layout function.

Jsplitpane (int neworientation): creates a jsplitpane that cuts in a specified horizontal or vertical direction, but does not have the continuous layout function.

Jsplitpnae (int neworientation, Boolean newcontinuouslayout): create a jsplitpane with specified horizontal or vertical cutting direction, and specify whether it has continuous layout function.

Jsplitpane (int neworientation, Boolean newcontinuouslayout, component newleftcomponent, component newrightcomponent): create a jsplitpane with specified horizontal or vertical cutting direction, specify the components to be displayed in the display area, and set whether to use the continuous layout function.

Jsplitpane (int neworientation, component newleftcomponent, component newrightcomponent): create a jsplitpane with specified horizontal or vertical cutting direction and specify the components to be displayed in the display area, but there is no continuous layout function.

The continuous layout mentioned above means whether the components in the window will change size dynamically with the drag of the dividing line when you drag the dividing line of the cutting surface. Newcontinuouslayout is a Boolean value. If it is set to true, the component size will change with the drag of the separation line; If it is set to false, the component size is determined when the separator stops changing. You can also use the setcontinuouslayout () method in jsplitpane to set this project.

5. Instance

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>