Java Code Examples for javax.swing.AbstractButton#setBorderPainted()
The following examples show how to use
javax.swing.AbstractButton#setBorderPainted() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ButtonTabComponent.java From CQL with GNU Affero General Public License v3.0 | 5 votes |
@Override public void mouseExited(MouseEvent e) { Component component = e.getComponent(); if (component instanceof AbstractButton) { AbstractButton button = (AbstractButton) component; button.setBorderPainted(false); } }
Example 2
Source File: ToolButtonFactory.java From snap-desktop with GNU General Public License v3.0 | 5 votes |
private void setSelectedState(AbstractButton b) { if (b.isEnabled()) { b.setBorderPainted(true); b.setBackground(SELECTED_BACKGROUND_COLOR); } else { b.setBorderPainted(false); b.setBackground(getDefaultBackground().darker()); } }
Example 3
Source File: NavigationButtons.java From pumpernickel with MIT License | 5 votes |
public static void formatNext(AbstractButton button) { button.setIcon(createIcon(true, .75f)); button.setRolloverIcon(createIcon(true, .85f)); button.setSelectedIcon(createIcon(true, 1f)); button.setDisabledIcon(createIcon(true, .3f)); button.setUI(new BevelButtonUI()); button.setContentAreaFilled(true); button.putClientProperty("JButton.segmentPosition", "last"); button.setBorderPainted(true); }
Example 4
Source File: ButtonTabComponent.java From binnavi with Apache License 2.0 | 5 votes |
@Override public void mouseExited(final MouseEvent event) { final Component component = event.getComponent(); if (component instanceof AbstractButton) { final AbstractButton button = (AbstractButton) component; button.setBorderPainted(false); } }
Example 5
Source File: ButtonTabComponent.java From tn5250j with GNU General Public License v2.0 | 5 votes |
public void mouseExited(MouseEvent e) { Component component = e.getComponent(); if (component instanceof AbstractButton) { AbstractButton button = (AbstractButton) component; button.setBorderPainted(false); } }
Example 6
Source File: TabbedPane.java From bytecode-viewer with GNU General Public License v3.0 | 5 votes |
@Override public void mouseExited(final MouseEvent e) { final Component component = e.getComponent(); if (component instanceof AbstractButton) { final AbstractButton button = (AbstractButton) component; button.setBorderPainted(false); } }
Example 7
Source File: ButtonTabComponent.java From wildfly-core with GNU Lesser General Public License v2.1 | 5 votes |
public void mouseEntered(MouseEvent e) { Component component = e.getComponent(); if (component instanceof AbstractButton) { AbstractButton button = (AbstractButton) component; button.setBorderPainted(true); } }
Example 8
Source File: ButtonTabComponent.java From tn5250j with GNU General Public License v2.0 | 5 votes |
public void mouseEntered(MouseEvent e) { Component component = e.getComponent(); if (component instanceof AbstractButton) { AbstractButton button = (AbstractButton) component; button.setBorderPainted(true); } }
Example 9
Source File: SearchButton.java From netbeans with Apache License 2.0 | 5 votes |
@Override public void mouseEntered(MouseEvent evt) { Object src = evt.getSource(); if (src instanceof AbstractButton) { AbstractButton button = (AbstractButton) evt.getSource(); if (button.isEnabled()) { button.setContentAreaFilled(true); button.setBorderPainted(true); } } }
Example 10
Source File: SearchButton.java From netbeans with Apache License 2.0 | 5 votes |
private static void removeButtonContentAreaAndBorder(AbstractButton button) { boolean canRemove = true; if (button instanceof JToggleButton) { canRemove = !button.isSelected(); } if (canRemove) { button.setContentAreaFilled(false); button.setBorderPainted(false); } }
Example 11
Source File: ButtonTabComponent.java From binnavi with Apache License 2.0 | 5 votes |
@Override public void mouseEntered(final MouseEvent event) { final Component component = event.getComponent(); if (component instanceof AbstractButton) { final AbstractButton button = (AbstractButton) component; button.setBorderPainted(false); } }
Example 12
Source File: FloatingButtonEnabler.java From ccu-historian with GNU General Public License v3.0 | 5 votes |
/** * Triggers the drawing of the border when the mouse entered the button area. * * @param e the mouse event. */ public void mouseEntered(final MouseEvent e) { if (e.getSource() instanceof AbstractButton) { final AbstractButton button = (AbstractButton) e.getSource(); if (button.isEnabled()) { button.setBorderPainted(true); } } }
Example 13
Source File: XDMMenuUI.java From xdm with GNU General Public License v2.0 | 5 votes |
@Override public void installUI(JComponent c) { super.installUI(c); if (c instanceof AbstractButton) { AbstractButton btn = (AbstractButton) c; // btn.setMargin(new Insets(10,10,10,10)); btn.setBorder(new EmptyBorder(getScaledInt(5), getScaledInt(10), getScaledInt(5), getScaledInt(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)); } }
Example 14
Source File: XDMMenuItemUI.java From xdm with GNU General Public License v2.0 | 5 votes |
@Override public void installUI(JComponent c) { super.installUI(c); c.setBorder(null); if (c instanceof AbstractButton) { AbstractButton btn = (AbstractButton) c; btn.setBorder(new EmptyBorder(getScaledInt(5), getScaledInt(10), getScaledInt(5), getScaledInt(10))); btn.setBorderPainted(false); } }
Example 15
Source File: Tools.java From Zettelkasten with GNU General Public License v3.0 | 5 votes |
public static AbstractButton makeTexturedToolBarButton(AbstractButton button, String segmentPosition) { if (null == segmentPosition || segmentPosition.isEmpty() || segmentPosition.equals(SEGMENT_POSITION_ONLY)) { button.putClientProperty("JButton.buttonType", "textured"); } else { button.putClientProperty("JButton.buttonType", "segmentedTextured"); button.putClientProperty("JButton.segmentPosition", segmentPosition); } button.setText(null); button.setBorderPainted(true); button.setPreferredSize(Constants.seaGlassButtonDimension); return button; }
Example 16
Source File: BasicLinkButtonUI.java From orbit-image-analysis with GNU General Public License v3.0 | 5 votes |
protected void installDefaults(AbstractButton b) { super.installDefaults(b); b.setOpaque(false); b.setBorderPainted(false); b.setRolloverEnabled(true); dashedRectGapX = UIManager.getInt("ButtonUI.dashedRectGapX"); dashedRectGapY = UIManager.getInt("ButtonUI.dashedRectGapY"); dashedRectGapWidth = UIManager.getInt("ButtonUI.dashedRectGapWidth"); dashedRectGapHeight = UIManager.getInt("ButtonUI.dashedRectGapHeight"); focusColor = UIManager.getColor("ButtonUI.focus"); b.setHorizontalAlignment(AbstractButton.LEFT); }
Example 17
Source File: ButtonTabComponent.java From CQL with GNU Affero General Public License v3.0 | 5 votes |
@Override public void mouseEntered(MouseEvent e) { Component component = e.getComponent(); if (component instanceof AbstractButton) { AbstractButton button = (AbstractButton) component; button.setBorderPainted(true); } }
Example 18
Source File: ToolButtonFactory.java From snap-desktop with GNU General Public License v3.0 | 4 votes |
private void setNormalState(AbstractButton b) { b.setBorderPainted(false); // b.setForeground(getDefaultForeground()); b.setBackground(getDefaultBackground()); }
Example 19
Source File: LargeNavigationPanelUI.java From pumpernickel with MIT License | 4 votes |
protected void format(AbstractButton button) { button.setBorderPainted(false); button.setContentAreaFilled(false); button.setUI(new BasicButtonUI()); }
Example 20
Source File: FloatingButtonEnabler.java From ccu-historian with GNU General Public License v3.0 | 2 votes |
/** * Adds a button to this enabler. * * @param button the button. */ public void addButton(final AbstractButton button) { button.addMouseListener(this); button.setBorderPainted(false); }