Example usage for javax.swing JButton getBounds

List of usage examples for javax.swing JButton getBounds

Introduction

In this page you can find the example usage for javax.swing JButton 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:es.emergya.ui.base.plugins.PluggableJTabbedPane.java

private void addFloatingButtons() {
    JButton salir = new JButton();
    salir.addActionListener(new ExitHandler());

    Icon icon = LogicConstants.getIcon("header_button_exit");
    salir.setIcon(icon);/*  w  w w.  j av a  2s  .  co m*/
    if (icon != null)
        if (min_height < icon.getIconHeight())
            min_height = icon.getIconHeight();

    // Aadimos el botn de Salir
    salir.setBounds(this.getWidth() - icon.getIconWidth() - 2, 2, icon.getIconWidth(), icon.getIconHeight());
    salir.setBorderPainted(false);
    PluggableJTabbedPane.this.salir = salir.getBounds();

    // Logo de la empresa
    JLabel logo = new JLabel();
    icon = LogicConstants.getIcon("header_logo_cliente");
    if (min_height < icon.getIconHeight())
        min_height = icon.getIconHeight();

    logo.setIcon(icon);
    logo.setBounds(salir.getBounds().x - icon.getIconWidth() - 2, 2, icon.getIconWidth(), icon.getIconHeight());

    JLabel companyLogo = new JLabel();
    icon = LogicConstants.getIcon("header_logo");
    if (icon != null)
        if (min_height < icon.getIconHeight())
            min_height = icon.getIconHeight();
    companyLogo.setIcon(icon);
    companyLogo.setBounds(logo.getBounds().x - icon.getIconWidth(), 2, icon.getIconWidth(),
            icon.getIconHeight());

    botones_flotantes = new ArrayList<JComponent>();
    addFloatingButton(companyLogo);
    addFloatingButton(logo);
    addFloatingButton(salir);

    repaint();
}