本文整理匯總了Java中javax.swing.AbstractButton.setFocusable方法的典型用法代碼示例。如果您正苦於以下問題:Java AbstractButton.setFocusable方法的具體用法?Java AbstractButton.setFocusable怎麽用?Java AbstractButton.setFocusable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.AbstractButton
的用法示例。
在下文中一共展示了AbstractButton.setFocusable方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: configureToolbarButton
import javax.swing.AbstractButton; //導入方法依賴的package包/類
private void configureToolbarButton (AbstractButton item, String containerCtx, String action, ActionProvider provider, Map ctx) {
item.setFocusable(false);
item.setName(action);
item.putClientProperty (KEY_ACTION, action);
item.setToolTipText(
provider.getDisplayName(action, containerCtx));
// item.setToolTipText(provider.getDescription(action, containerCtx));
int state = ctx == null ? ActionProvider.STATE_VISIBLE :
provider.getState (action, containerCtx, ctx);
boolean enabled = (state & ActionProvider.STATE_ENABLED) != 0;
item.setEnabled(enabled);
boolean visible = (state & ActionProvider.STATE_VISIBLE) != 0;
item.setVisible (visible);
boolean toggled = (state & ActionProvider.STATE_SELECTED) != 0;
item.setSelected(toggled);
// item.setMnemonic(provider.getMnemonic(action, containerCtx));
// item.setDisplayedMnemonicIndex(provider.getMnemonicIndex(action, containerCtx));
item.setIcon(provider.getIcon(action, containerCtx, BeanInfo.ICON_COLOR_16x16));
}
示例2: processButton
import javax.swing.AbstractButton; //導入方法依賴的package包/類
private void processButton(AbstractButton button) {
removeButtonContentAreaAndBorder(button);
button.setMargin(BUTTON_INSETS);
if (button instanceof AbstractButton) {
button.addMouseListener(sharedMouseListener);
}
//fix of issue #69642. Focus shouldn't stay in toolbar
button.setFocusable(false);
}
示例3: processButton
import javax.swing.AbstractButton; //導入方法依賴的package包/類
private void processButton(AbstractButton button) {
button.setContentAreaFilled(false);
button.setBorderPainted(false);
button.setMargin(BUTTON_INSETS);
if (button instanceof AbstractButton) {
button.addMouseListener(sharedMouseListener);
}
//Focus shouldn't stay in toolbar
button.setFocusable(false);
}
示例4: 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());
}
});
}
示例5: processButton
import javax.swing.AbstractButton; //導入方法依賴的package包/類
private static void processButton(AbstractButton button) {
removeButtonContentAreaAndBorder(button);
button.setMargin(BUTTON_INSETS);
button.addMouseListener(sharedMouseListener);
button.setFocusable(false);
}
示例6: installDefaults
import javax.swing.AbstractButton; //導入方法依賴的package包/類
/** Overridden to not call super.installDefaults() and only set the button
* to be non-focusable */
@Override
public void installDefaults (AbstractButton b) {
b.setFocusable (false);
}