本文整理匯總了Java中javax.swing.AbstractButton.getClientProperty方法的典型用法代碼示例。如果您正苦於以下問題:Java AbstractButton.getClientProperty方法的具體用法?Java AbstractButton.getClientProperty怎麽用?Java AbstractButton.getClientProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.AbstractButton
的用法示例。
在下文中一共展示了AbstractButton.getClientProperty方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: update
import javax.swing.AbstractButton; //導入方法依賴的package包/類
public void update (String containerCtx) {
// System.err.println("ToolbarFactory update " + containerCtx);
JToolBar tb = (JToolBar) mappings.get(munge(containerCtx));
synchronized (tb.getTreeLock()) {
// System.err.println("Toolbar to update: " + tb);
ActionProvider provider = getEngine().getActionProvider();
if (tb != null) {
Component[] c = tb.getComponents();
for (int i=0; i < c.length; i++) {
if (c[i] instanceof AbstractButton) {
AbstractButton b = (AbstractButton) c[i];
String action = (String) b.getClientProperty (KEY_ACTION);
configureToolbarButton (b, containerCtx, action, provider,
getEngine().getContextProvider().getContext());
}
}
} else {
System.err.println("Asked to update non existent toolbar " + containerCtx);
}
}
}
示例2: propertyChange
import javax.swing.AbstractButton; //導入方法依賴的package包/類
public void propertyChange(PropertyChangeEvent evt) {
AbstractButton b = (AbstractButton) evt.getSource();
if (b.getDisplayedMnemonicIndex() == -1) {
Integer mnemonic = (Integer) b.getClientProperty(PROP_MNEMONIC);
Integer index = (Integer) b.getClientProperty(PROP_DISPLAYED_MNEMONIC_INDEX);
if (mnemonic != null && index != null && Utilities.compareObjects(b.getText(), b.getClientProperty(PROP_TEXT))) {
b.setMnemonic(mnemonic);
b.setDisplayedMnemonicIndex(index);
}
}
}
示例3: paintButtonRollOver
import javax.swing.AbstractButton; //導入方法依賴的package包/類
protected void paintButtonRollOver(Graphics g, AbstractButton b) {
Graphics2D g2 = (Graphics2D) g;
if (b.getClientProperty("xdmbutton.grayrollover") != null) {
g2.setPaint(Color.DARK_GRAY);
} else {
g2.setPaint(StaticResource.selectedColor);
}
g2.fillRect(0, 0, b.getWidth(), b.getHeight());
}