62,635
社区成员




public void setDividerLocation(int location) {
int oldValue = dividerLocation;
dividerLocation = location;
// Notify UI.
SplitPaneUI ui = getUI();
if (ui != null) {
ui.setDividerLocation(this, location);
}
// Then listeners
firePropertyChange(DIVIDER_LOCATION_PROPERTY, oldValue, location);
// And update the last divider location.
setLastDividerLocation(oldValue);
}
public void firePropertyChange(String propertyName,
Object oldValue, Object newValue) {
if (oldValue != null && newValue != null && oldValue.equals(newValue)) {
return;
}
firePropertyChange(new PropertyChangeEvent(source, propertyName,
oldValue, newValue));
}
sp.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY,
new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
// TODO Auto-generated method stub
System.out.println(sp.getDividerLocation());
}
});
sp.addPropertyChangeListener("dividerLocation",
new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
// TODO Auto-generated method stub
System.out.println(sp.getDividerLocation());
}
});