public static JButton createSmallButton(final String text, final Icon icon) { final JButton b = new JButton(icon); if (text != null) { b.setText(text); b.setFont(WidgetUtils.FONT_SMALL); } b.setMargin(new Insets(0, 0, 0, 0)); b.setUI(new MetalButtonUI()); b.setBackground(WidgetUtils.COLOR_WELL_BACKGROUND); final MatteBorder outerBorder = new MatteBorder(1, 1, 1, 1, WidgetUtils.BG_COLOR_LESS_BRIGHT); b.setBorder(new CompoundBorder(outerBorder, new EmptyBorder(2, 4, 2, 4))); b.setFocusPainted(false); return b; }
b.setOpaque(true); b.setBorderPainted(true); b.setUI(new MetalButtonUI());
public static PopupButton createSmallPopupButton(final String text, final String imagePath) { final PopupButton b = new PopupButton(text, ImageManager.get().getImageIcon(imagePath, IconUtils.ICON_SIZE_SMALL)); b.setFont(WidgetUtils.FONT_SMALL); b.setMargin(new Insets(0, 0, 0, 0)); b.setUI(new MetalButtonUI()); b.setBackground(WidgetUtils.COLOR_WELL_BACKGROUND); final MatteBorder outerBorder = new MatteBorder(1, 1, 1, 1, WidgetUtils.BG_COLOR_LESS_BRIGHT); b.setBorder(new CompoundBorder(outerBorder, new EmptyBorder(2, 4, 2, 4))); b.setFocusPainted(false); return b; }