本文整理匯總了Java中javax.swing.AbstractButton.setBorder方法的典型用法代碼示例。如果您正苦於以下問題:Java AbstractButton.setBorder方法的具體用法?Java AbstractButton.setBorder怎麽用?Java AbstractButton.setBorder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.AbstractButton
的用法示例。
在下文中一共展示了AbstractButton.setBorder方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: installUI
import javax.swing.AbstractButton; //導入方法依賴的package包/類
@Override
public void installUI(JComponent c) {
super.installUI(c);
c.setBorder(null);
if (c instanceof AbstractButton) {
AbstractButton btn = (AbstractButton) c;
//btn.setMargin(new Insets(10,10,10,10));
btn.setBorder(new EmptyBorder(5, 10, 5, 10));
// btn.setIcon(new XDMBlankIcon(15, 10));
btn.setBorderPainted(false);
// btn.setMargin(new Insets(10, 10, 10, 10));
// btn.setFont(new Font(Font.DIALOG, Font.PLAIN, 12));
}
// this.lightColor = Color.WHITE;
// this.darkColor = new Color(230, 230, 230);
// this.lightColor2 = new Color(245, 245, 245);
// chkIcon = UIManager.getIcon("CheckBoxMenuItem.checkIcon");
}
示例2: installButtonUI
import javax.swing.AbstractButton; //導入方法依賴的package包/類
@Override
public void installButtonUI(AbstractButton button) {
button.setUI(new ButtonUI());
button.setBorder(null);
button.setMargin(new Insets(0, 0, 0, 0));
if ((button.getText() == null || "".equals(button.getText())) && button.getIcon() != null) {
button.setPreferredSize(new Dimension((int) (button.getIcon().getIconWidth() * 1.45d), (int) (button.getIcon()
.getIconHeight() * 1.45d)));
}
}
示例3: installUI
import javax.swing.AbstractButton; //導入方法依賴的package包/類
@Override
public void installUI (JComponent c) {
super.installUI(c);
AbstractButton button = (AbstractButton) c;
button.setOpaque (false);
button.setBorder (BorderFactory.createEmptyBorder (7, 17, 7, 17));
}
示例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: installBorder
import javax.swing.AbstractButton; //導入方法依賴的package包/類
/** Install a border on the button */
protected void installBorder (AbstractButton b) {
b.setBorder (BorderFactory.createEtchedBorder());
}