예제 #1
0
 public void gotoError(int pos) {
   errorPane.requestFocus();
   errorPane.grabFocus();
   errorPane.requestFocusInWindow();
   errorPane.transferFocus();
   errorPane.setCaretColor(Color.RED);
   errorPane.setCaretPosition(pos);
   if (errorPane.hasFocus()) {
     System.out.println("Has Focus!");
   } else {
     System.out.println("Has no Focus!");
   }
 }
예제 #2
0
파일: Notes.java 프로젝트: justin0127/IM
  public void showDialog() {
    if (notesFrame != null && notesFrame.isVisible()) {
      return;
    }

    notesFrame = new JFrame(FpRes.getString("title.chat.notes"));
    notesFrame.setIconImage(SparkManager.getMainWindow().getIconImage());
    notesFrame.getContentPane().setLayout(new BorderLayout());
    notesFrame.getContentPane().add(new JScrollPane(this), BorderLayout.CENTER);
    notesFrame.pack();
    notesFrame.setSize(500, 400);

    notesFrame.setLocationRelativeTo(SparkManager.getChatManager().getChatContainer());
    notesFrame.setVisible(true);

    textPane.requestFocusInWindow();
  }