List of usage examples for java.awt Frame getLocationOnScreen
public Point getLocationOnScreen()
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()); }