Example usage for java.awt Frame getY

List of usage examples for java.awt Frame getY

Introduction

In this page you can find the example usage for java.awt Frame getY.

Prototype

public int getY() 

Source Link

Document

Returns the current y coordinate of the components origin.

Usage

From source file:edu.ucla.stat.SOCR.motionchart.MotionMouseListener.java

protected Point getDialogLocation(JDialog dialog, Component c) {
    Frame frame = JOptionPane.getFrameForComponent(c);
    int x = frame.getX() + (frame.getWidth() - dialog.getWidth()) / 2;
    int y = frame.getY() + (frame.getHeight() - dialog.getHeight()) / 2;
    return new Point(x, y);
}

From source file:net.ontopia.topicmaps.viz.AboutFrame.java

public AboutFrame(Frame parent) {
    super(parent, Messages.getString("Viz.About", "Ontopia Vizigator"), true);

    JPanel mainPanel = new JPanel();
    mainPanel.setBackground(Color.white);
    mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
    mainPanel.add(createImagePanel());//from   www  .  ja  v  a  2s  .c o  m
    mainPanel.add(createAboutTextPanel());

    this.getContentPane().add(mainPanel);
    this.pack();
    this.setResizable(false);
    //    Center the dialog box above its parent
    this.setLocation((parent.getX() + (parent.getWidth() - this.getWidth()) / 2),
            parent.getY() + (parent.getHeight() - this.getHeight()) / 2);
}