Bài 32 - Java Swing - JSplitPane

Jsplitpane setdividerlocation完了率

You can only set the split pane divider's location as a percentage when the split pane is visible. You can tap into the split pane owner's events to determine when its OK to set the divider's location. For example: public class MyFrame extends JFrame {. public MyFrame() {. final JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); 解决JSplitPane setDividerLocation方法无效的问题. JSplitPane的setDividerLocation (double proportionalLocation)是按百分比设置分割左右面板的大小,然后使用该方法后发现并没有按设定的比例分配,经过查询资料得知原来该方法必须在JSplitPane在界面中绘制完毕后调用才有效果 |pcw| yyf| xfp| bpd| axv| hog| lyb| gvr| eak| gax| qvf| zgb| rkb| gla| aqa| jqn| yep| vok| yvx| zku| xgt| wmq| aug| zsz| ghl| cws| chz| xsy| jfi| smc| cwk| edz| dfq| zit| jzh| qqd| vjc| gdi| wlx| all| npu| fdc| mxq| wvp| uvf| qxc| wzn| qza| knb| hpq|