Example usage for java.awt Frame getLocationOnScreen

List of usage examples for java.awt Frame getLocationOnScreen

Introduction

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

Prototype

public Point getLocationOnScreen() 

Source Link

Document

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

Usage

From source file:org.archiviststoolkit.plugin.utils.CodeViewerDialog.java

/**
 * Constructor which code is past in//ww  w. ja  v a2 s . com
 *
 * @param owner
 * @param code
 * @param syntaxStyle
 */
public CodeViewerDialog(Frame owner, String syntaxStyle, String code, boolean editable,
        boolean allowRecordTest) {
    super(owner);
    initComponents();

    this.editable = editable;

    // add the syntax area now
    textArea = new RSyntaxTextArea(30, 100);
    textArea.setSyntaxEditingStyle(syntaxStyle);
    textArea.setCodeFoldingEnabled(true);
    textArea.setAntiAliasingEnabled(true);
    textArea.setEditable(editable);
    textArea.setText(code);

    RTextScrollPane sp = new RTextScrollPane(textArea);
    sp.setFoldIndicatorEnabled(true);

    contentPanel.add(sp, BorderLayout.CENTER);

    // Make the components for unit testing a json using the RecordTestServlet
    if (allowRecordTest) {
        scrollPane1.setVisible(true);
        recordTestPanel.setVisible(true);
        testHostUrlTextField.setText(RecordTestServletClient.DEFAULT_URL);

        recordTestServletClient = new RecordTestServletClient();
    } else {
        scrollPane1.setVisible(false);
        recordTestPanel.setVisible(false);
    }

    // make sure we open this window somewhere that make sense
    setLocation(owner.getLocationOnScreen());
}