本文整理匯總了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());
}
});
}