Example usage for javax.swing JToggleButton setBorderPainted

List of usage examples for javax.swing JToggleButton setBorderPainted

Introduction

In this page you can find the example usage for javax.swing JToggleButton setBorderPainted.

Prototype

@BeanProperty(visualUpdate = true, description = "Whether the border should be painted.")
public void setBorderPainted(boolean b) 

Source Link

Document

Sets the borderPainted property.

Usage

From source file:org.datacleaner.windows.AnalysisJobBuilderWindowImpl.java

private JToggleButton createViewToggleButton(final String text, final String iconPath) {
    final ImageIcon icon = imageManager.getImageIcon(iconPath);
    final JToggleButton button = new JToggleButton(text, icon);
    button.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    button.setFont(WidgetUtils.FONT_SMALL);
    button.setForeground(WidgetUtils.BG_COLOR_BRIGHTEST);
    button.setBackground(WidgetUtils.BG_COLOR_DARK);
    button.setBorderPainted(false);
    button.setBorder(new CompoundBorder(WidgetUtils.BORDER_THIN, new EmptyBorder(0, 4, 0, 4)));
    return button;
}

From source file:org.openmicroscopy.shoola.agents.treeviewer.browser.BrowserUI.java

/** Helper method to create the menu bar. */
private void createMenuBars() {
    rightMenuBar = new JToolBar();
    rightMenuBar.setBorder(null);// www . j  a  v a 2 s  .  c om
    rightMenuBar.setRollover(true);
    rightMenuBar.setFloatable(false);

    JButton button;
    leftMenuBar = new JToolBar();
    leftMenuBar.setBorder(BorderFactory.createEmptyBorder(0, 0, 8, 0));
    leftMenuBar.setRollover(true);
    leftMenuBar.setFloatable(false);
    BrowserManageAction a;
    int type = model.getBrowserType();
    switch (type) {
    case Browser.PROJECTS_EXPLORER:
    case Browser.SCREENS_EXPLORER:
        a = (BrowserManageAction) controller.getAction(BrowserControl.NEW_CONTAINER);
        button = new JButton(a);
        button.setName("new container button");
        button.setBorderPainted(false);
        button.addMouseListener(a);
        rightMenuBar.add(button);
        break;
    case Browser.ADMIN_EXPLORER:
        a = (BrowserManageAction) controller.getAction(BrowserControl.NEW_ADMIN);
        button = new JButton(a);
        button.setName("new group or user button");
        button.setBorderPainted(false);
        button.addMouseListener(a);
        rightMenuBar.add(button);
        break;
    case Browser.TAGS_EXPLORER:
        a = (BrowserManageAction) controller.getAction(BrowserControl.NEW_TAG);
        button = new JButton(a);
        button.setName("new tag button");
        button.setBorderPainted(false);
        button.addMouseListener(a);
        rightMenuBar.add(button);
    }
    button = new JButton(controller.getAction(BrowserControl.CUT));
    button.setName("cut button");
    button.setBorderPainted(false);
    rightMenuBar.add(button);
    button = new JButton(controller.getAction(BrowserControl.COPY));
    button.setName("copy button");
    button.setBorderPainted(false);
    rightMenuBar.add(button);
    button = new JButton(controller.getAction(BrowserControl.PASTE));
    button.setName("paste button");
    button.setBorderPainted(false);
    rightMenuBar.add(button);
    button = new JButton(controller.getAction(BrowserControl.DELETE));
    button.setName("delete button");
    button.setBorderPainted(false);
    rightMenuBar.add(button);
    button = new JButton(controller.getAction(BrowserControl.REFRESH));
    button.setName("refresh button");
    button.setBorderPainted(false);
    rightMenuBar.add(button);

    if (type == Browser.ADMIN_EXPLORER) {
        button = new JButton(controller.getAction(BrowserControl.RESET_PASSWORD));
        button.setBorderPainted(false);
        rightMenuBar.add(button);
    } else {
        button = new JButton(controller.getAction(BrowserControl.IMPORT));
        button.setBorderPainted(false);
        //rightMenuBar.add(button);
    }
    rightMenuBar.add(Box.createHorizontalStrut(6));
    rightMenuBar.add(new JSeparator());
    rightMenuBar.add(Box.createHorizontalStrut(6));
    ButtonGroup group = new ButtonGroup();
    JToggleButton b = new JToggleButton();
    group.add(b);
    b.setBorderPainted(true);
    b.setSelected(true);
    b.setAction(controller.getAction(BrowserControl.SORT));

    rightMenuBar.add(b);
    b = new JToggleButton(controller.getAction(BrowserControl.SORT_DATE));
    b.setBorderPainted(true);
    group.add(b);
    rightMenuBar.add(b);

    partialButton = new JToggleButton(controller.getAction(BrowserControl.PARTIAL_NAME));
    partialButton.setBorderPainted(true);
    rightMenuBar.add(partialButton);
    rightMenuBar.add(new JSeparator(JSeparator.VERTICAL));
    button = new JButton(controller.getAction(BrowserControl.COLLAPSE));
    button.setBorderPainted(false);
    rightMenuBar.add(button);
}

From source file:org.revager.tools.GUITools.java

/**
 * Creates a new image toggle button.//from w w w  .  j  a  va 2  s.com
 * 
 * @param icon
 *            the normal icon
 * @param rolloverIcon
 *            the rollover icon
 * @param action
 *            the action
 * 
 * @return the newly created image button
 */
public static JToggleButton newImageToggleButton(ImageIcon icon, ImageIcon rolloverIcon, Action action) {
    JToggleButton button = new JToggleButton(action);
    button.setToolTipText(button.getText());
    button.setText(null);
    button.setContentAreaFilled(false);
    button.setBorder(new EmptyBorder(0, 0, 0, 0));
    button.setMargin(new Insets(0, 0, 0, 0));
    button.setBorderPainted(false);
    button.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    button.setFocusPainted(false);
    button.setFocusable(false);

    button.setIcon(icon);
    button.setRolloverIcon(rolloverIcon);
    button.setRolloverSelectedIcon(rolloverIcon);
    button.setSelectedIcon(rolloverIcon);

    return button;
}

From source file:org.revager.tools.GUITools.java

/**
 * Creates a new image toggle button./*from   w  w w . jav  a  2s  .  c o m*/
 * 
 * @return the newly created image toggle button
 */
public static JToggleButton newImageToggleButton() {
    JToggleButton button = new JToggleButton();

    button.setBorder(new EmptyBorder(2, 2, 2, 8));
    button.setMargin(new Insets(0, 0, 0, 0));
    button.setBorderPainted(false);
    button.setOpaque(false);
    button.setContentAreaFilled(false);
    button.setFocusable(false);
    button.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

    return button;
}