java – 检测JSplitPane分隔运动
发布时间:2020-12-14 05:34:17 所属栏目:Java 来源:网络整理
导读:有没有办法检测何时移动JSplitPane分隔符?有没有办法添加分频器运动的监听器? JPanel panel1 = new JPanel();JPanel panel2 = new JPanel();JSplitPane sp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,panel1,panel2);// What do I put here to be noti
有没有办法检测何时移动JSplitPane分隔符?有没有办法添加分频器运动的监听器?
JPanel panel1 = new JPanel(); JPanel panel2 = new JPanel(); JSplitPane sp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,panel1,panel2); // What do I put here to be notified if the divider in sp is moved? 解决方法
我想你正在从容器寻找
addPropertyChangeListener.这样的东西
sp.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY,new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent pce) {} }); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |