Example usage for javax.swing AbstractButton getBounds

List of usage examples for javax.swing AbstractButton getBounds

Introduction

In this page you can find the example usage for javax.swing AbstractButton getBounds.

Prototype

public Rectangle getBounds() 

Source Link

Document

Gets the bounds of this component in the form of a Rectangle object.

Usage

From source file:org.esa.beam.visat.toolviews.stat.StatisticsPanel.java

private AbstractButton getExportButton() {
    final AbstractButton export = ToolButtonFactory.createButton(UIUtils.loadImageIcon("icons/Export24.gif"),
            false);//from  w w  w. ja  v a  2s.co m
    export.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            JPopupMenu viewPopup = new JPopupMenu("Export");
            viewPopup.add(exportAsCsvAction);
            viewPopup.add(putStatisticsIntoVectorDataAction);
            final Rectangle buttonBounds = export.getBounds();
            viewPopup.show(export, 1, buttonBounds.height + 1);
        }
    });
    export.setEnabled(false);
    return export;
}