本文整理汇总了Java中javax.swing.AbstractButton.addChangeListener方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractButton.addChangeListener方法的具体用法?Java AbstractButton.addChangeListener怎么用?Java AbstractButton.addChangeListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.AbstractButton
的用法示例。
在下文中一共展示了AbstractButton.addChangeListener方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addItem
import javax.swing.AbstractButton; //导入方法依赖的package包/类
public void addItem(JComponent c) {
c.setOpaque(false);
if (c instanceof JButton)
((JButton)c).setDefaultCapable(false);
if (toolbar != null) {
toolbar.add(c);
} else {
add(c);
if (c instanceof AbstractButton) {
AbstractButton b = (AbstractButton) c;
b.addMouseListener(listener);
b.addChangeListener(listener);
b.addFocusListener(listener);
b.setRolloverEnabled(true);
}
}
}
示例2: registerClientPresenterListener
import javax.swing.AbstractButton; //导入方法依赖的package包/类
private void registerClientPresenterListener(AbstractButton presenter) {
presenter.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
updateClientPresentersEnabling(getClientPresenters());
}
});
}
示例3: SelectedActionButtonChangeListener
import javax.swing.AbstractButton; //导入方法依赖的package包/类
/**
* Adds a selected change listener between target action and target button
* @param action action to be linked
* @param button button to be linked
*/
public SelectedActionButtonChangeListener(AbstractJMTAction action, AbstractButton button) {
this.action = action;
this.button = button;
action.addPropertyChangeListener(this);
button.addChangeListener(this);
}
示例4: subscribeActual
import javax.swing.AbstractButton; //导入方法依赖的package包/类
@Override
protected void subscribeActual(Observer<? super ChangeEvent> observer) {
AbstractButton w = widget;
ChangeEventConsumer aec = new ChangeEventConsumer(observer, w);
observer.onSubscribe(aec);
w.addChangeListener(aec);
if (aec.get() == null) {
aec.onDispose(w);
}
}
示例5: setLAF
import javax.swing.AbstractButton; //导入方法依赖的package包/类
/** Gives a button the Groove look-and-feel. */
static public void setLAF(final AbstractButton button) {
button.setHideActionText(true);
button.setFocusable(false);
button.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(),
BorderFactory.createEmptyBorder(3, 2, 3, 2)));
button.setBorderPainted(button.isEnabled());
button.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
button.setBorderPainted(button.isEnabled());
}
});
}