b.setMargin(new Insets(1, 4, 1, 4)); b.setFocusable(false); panel.add(b, constraints);
rootPanel.add(spacer10, new GridConstraints(6, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); alwaysSendRequestsCheckBox = new JCheckBox(); alwaysSendRequestsCheckBox.setMargin(new Insets(2, 2, 2, 2)); alwaysSendRequestsCheckBox.setText("Always send requests"); alwaysSendRequestsCheckBox.setToolTipText("Send requests even if a language plugin already supports it");
for (int jj = 0; jj < chessBoardSquares[ii].length; jj++) { JButton b = new JButton(); b.setMargin(buttonMargin);
b.setMargin(new Insets(1, 4, 1, 4)); b.setFocusable(false);
private static final long serialVersionUID = 9204819004142223529L; setMargin(new Insets(0, 0, 0, 0)); statusPanel.add(new JButton("Slide Right") { setMargin(new Insets(0, 0, 0, 0)); statusPanel.add(new JButton("Slide Up") { setMargin(new Insets(0, 0, 0, 0)); statusPanel.add(new JButton("Slide Down") { setMargin(new Insets(0, 0, 0, 0));
IconButton(Icon icon) { super(icon); setFocusPainted(false); setMargin(new Insets(2, 2, 2, 2)); } }
public void decoreToolBarButton(final AbstractButton _r){ _r.setText(""); _r.setMargin(new Insets(0, 0, 0, 0)); } }
/** * Removes the button border. * * @param button the button */ public static void removeButtonBorder(AbstractButton button) { button.setContentAreaFilled(false); button.setMargin(new Insets(0, 0, 0, 0)); button.setBorder(BorderFactory.createEmptyBorder()); }
protected JButton createArrowButton() { JButton button = new TinyComboBoxButton(comboBox, null, comboBox.isEditable(), currentValuePane, listBox); button.setMargin(DEFAULT_INSETS); button.putClientProperty("isComboBoxButton", Boolean.TRUE); return button; }
public Component getListCellRendererComponent( final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus ) { defaultComp.getListCellRendererComponent( list, value, index, isSelected, cellHasFocus ); abstractButton.setSelected( isSelected ); abstractButton.setText( String.valueOf( value ) ); abstractButton.setFont( new Font( Font.DIALOG, Font.PLAIN, 10 ) ); abstractButton.setMargin( new Insets( 2, 0, 3, 0 ) ); return this; } }
public void addButton(AbstractButton button) { Icon icon = button.getIcon(); Dimension size = new Dimension(icon.getIconWidth() + 6, icon.getIconHeight() + 10); button.setMinimumSize(size); button.setPreferredSize(size); button.setMaximumSize(size); button.setMargin(new Insets(5, 4, 5, 4)); toolbar.add(button); }
/** * Create a new ScrollButton. * @see javax.swing.plaf.metal.MetalScrollButton#MetalScrollButton(int, int, boolean) */ public TinyScrollButton(int direction,TinyScrollBarUI scrollbarUI) { super(direction); this.scrollbarUI = scrollbarUI; setBorder(null); setRolloverEnabled(true); setMargin(new Insets(0, 0, 0, 0)); setSize(getPreferredSize()); }
private void decoreButton(final AbstractButton _bt) { _bt.setRequestFocusEnabled(false); _bt.setMargin(INSETS1111); _bt.addActionListener(this); }
/** * Unifies the button style. * @param button button reference * @return button */ private static AbstractButton style(final AbstractButton button) { // no shadow effects (flat style) button.setOpaque(false); // trim horizontal button margins (mac) final Insets in = button.getMargin(); in.left /= 4; in.right /= 4; if(in.top < in.left) button.setMargin(in); return button; }
public static void configureToolbarButtonSize(final AbstractButton abstractButton) { if (System.getProperty("os.name").equals("Mac OS X")) { abstractButton.putClientProperty("JButton.buttonType", "segmented"); abstractButton.putClientProperty("JButton.segmentPosition", "middle"); final Dimension buttonSize = new Dimension(22, 22); abstractButton.setPreferredSize(buttonSize); abstractButton.setFocusPainted(false); } abstractButton.setFocusable(false); abstractButton.setMargin(FreeplaneToolBar.nullInsets); } }
protected void uninstallDefaults() { LookAndFeel.uninstallBorder(menuItem); menuItem.setBorderPainted(oldBorderPainted); if(menuItem.getMargin() instanceof UIResource) menuItem.setMargin(null); if(arrowIcon instanceof UIResource) arrowIcon = null; if(checkIcon instanceof UIResource) checkIcon = null; }
protected void addImpl(Component comp, Object constraints, int index) { if (comp instanceof AbstractButton) { AbstractButton ab = (AbstractButton) comp; ab.setContentAreaFilled(false); ab.setMargin(new Insets(3, 3, 3, 3)); if (buttonStyle == BUTTON_STYLE_VERICAL) { ab.setVerticalTextPosition(SwingConstants.BOTTOM); ab.setHorizontalTextPosition(SwingConstants.CENTER); } } super.addImpl(comp, constraints, index); }
@Override protected void addImpl(Component comp, Object constraints, int index) { if (comp instanceof AbstractButton) { AbstractButton ab = (AbstractButton) comp; ab.setContentAreaFilled(false); ab.setMargin(new Insets(3, 3, 3, 3)); if (buttonStyle == BUTTON_STYLE_VERICAL) { ab.setVerticalTextPosition(SwingConstants.BOTTOM); ab.setHorizontalTextPosition(SwingConstants.CENTER); } } super.addImpl(comp, constraints, index); }
@Override protected void installDefaults(AbstractButton b) { super.installDefaults(b); b.setMargin(new Insets(5, 3, 5, 3)); b.setRolloverEnabled(true); // Not true by default. b.setFocusable(false); // Prevent JRootPane default button issues b.setBorder(new ButtonBorder()); b.setOpaque(false); colors.initialize(b); b.putClientProperty("breadcrumbBorderColor", colors.borderColor); }
@Override protected void installDefaults(AbstractButton b) { super.installDefaults(b); b.setMargin(new Insets(5, 4, 5, 4)); b.setBorder(new ButtonBorder()); b.setRolloverEnabled(true); // Not true by default b.setFocusable(false); // Prevent JRootPane default button issues b.setOpaque(false); colors.initialize(b); b.putClientProperty("breadcrumbBorderColor", colors.borderColor); }