protected void init() { setMargin( new Insets( 0, 0, 0, 0 ) ); addMouseListener( new HoveringButtonHandler() ); setBorderPainted( false ); setContentAreaFilled( false ); putClientProperty( "JButton.buttonType", "square" ); putClientProperty( "JComponent.sizeVariant", "small" ); } }
/** * Creates a button with no set text or icon. */ public BorderlessButton() { init(); }
/** * Invoked when the mouse exits a component. */ public void mouseExited( final MouseEvent e ) { if ( updateContentAreaFilled ) { setContentAreaFilled( false ); } setBorderPainted( false ); } }
private JPanel createQueryListPanel() { // Create the query list panel final JPanel queryButtons = new JPanel( new FlowLayout( FlowLayout.RIGHT, 5, 5 ) ); queryButtons.add( new BorderlessButton( new QueryAddAction<T>( dialogModel ) ) ); queryButtons.add( new BorderlessButton( new QueryRemoveAction<T>( dialogModel ) ) ); final JPanel queryControlPanel = new JPanel( new BorderLayout() ); queryControlPanel.add( new JLabel( Messages.getString( "QueryEditorPanel.AvailableQueries" ) ), BorderLayout.WEST ); queryControlPanel.add( queryButtons, BorderLayout.EAST ); final JPanel queryListPanel = new JPanel( new BorderLayout() ); queryListPanel.setBorder( BorderFactory.createEmptyBorder( 0, 8, 0, 8 ) ); queryListPanel.add( BorderLayout.NORTH, queryControlPanel ); queryListPanel.add( BorderLayout.CENTER, new JScrollPane( queryNameList ) ); return queryListPanel; }
gbc.gridy = 2; gbc.insets = new Insets( 5, 5, 5, 5 ); tablesPane.add( new BorderlessButton( sortUpAction ), gbc ); gbc.gridy = 2; gbc.insets = new Insets( 5, 5, 5, 5 ); tablesPane.add( new BorderlessButton( sortDownAction ), gbc ); gbc.gridy = 2; gbc.insets = new Insets( 5, 5, 5, 5 ); tablesPane.add( new BorderlessButton( addGroupAction ), gbc ); gbc.gridy = 2; gbc.insets = new Insets( 5, 5, 5, 5 ); tablesPane.add( new BorderlessButton( removeGroupAction ), gbc );
/** * Invoked when the mouse enters a component. */ public void mouseEntered( final MouseEvent e ) { if ( updateContentAreaFilled ) { setContentAreaFilled( true ); } setBorderPainted( true ); }
gbc.gridy = 2; gbc.insets = new Insets( 5, 5, 5, 5 ); tablesPane.add( new BorderlessButton( sortUpAction ), gbc ); gbc.gridy = 2; gbc.insets = new Insets( 5, 5, 5, 5 ); tablesPane.add( new BorderlessButton( sortDownAction ), gbc ); gbc.gridy = 2; gbc.insets = new Insets( 5, 5, 5, 5 ); tablesPane.add( new BorderlessButton( addGroupAction ), gbc ); gbc.gridy = 2; gbc.insets = new Insets( 5, 5, 5, 5 ); tablesPane.add( new BorderlessButton( removeGroupAction ), gbc ); gbc.gridy = 3; gbc.insets = new Insets( 5, 5, 5, 0 ); tablesPane.add( new BorderlessButton( new AddSelectionAction( paletteList.getSelectionModel() ) ), gbc );
/** * Creates a button with an icon. * * @param icon the Icon image to display on the button */ public BorderlessButton( final Icon icon ) { super( icon ); init(); }
final BorderlessButton button = new BorderlessButton( selectFieldAction ); final TooltipLabel tooltipLabel = new TooltipLabel( description );
/** * Creates a button with text. * * @param text the text of the button */ public BorderlessButton( final String text ) { super( text ); init(); }
/** * Creates a button where properties are taken from the <code>Action</code> supplied. * * @param a the <code>Action</code> used to specify the new button * @since 1.3 */ public BorderlessButton( final Action a ) { super( a ); init(); }
/** * Creates a button with initial text and an icon. * * @param text the text of the button * @param icon the Icon image to display on the button */ public BorderlessButton( final String text, final Icon icon ) { super( text, icon ); init(); }