Example usage for javax.swing JButton getLocation

List of usage examples for javax.swing JButton getLocation

Introduction

In this page you can find the example usage for javax.swing JButton getLocation.

Prototype

public Point getLocation() 

Source Link

Document

Gets the location of this component in the form of a point specifying the component's top-left corner.

Usage

From source file:Main.java

public static void main(String[] argv) {

    JButton component = new JButton();
    Point pt = new Point(component.getLocation());
    SwingUtilities.convertPointToScreen(pt, component);
}

From source file:Main.java

public static void main(String[] argv) {
    JButton component = new JButton();
    Point pt = new Point(component.getLocation());

    SwingUtilities.convertPointFromScreen(pt, component);
}

From source file:com.omertron.yamjtrakttv.view.MainWindow.java

private Dimension resizeWindow(JButton btn, int offsetX, int offsetY) {
    int width = btn.getSize().width + btn.getLocation().x + offsetX;
    int height = btn.getSize().height + btn.getLocation().y + offsetY;
    return new Dimension(width, height);
}