void jListOnlineUsers_mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { jTextFieldTargetUser.setText(((HostItem) jListOnlineUsers.getSelectedValue()).name); Flasher.instance().flashBackground(jTextFieldTargetUser, Color.yellow, 2); jTextFieldSendMessages.requestFocus(); } }
void jTextFieldSendSubject_keyPressed(KeyEvent e) { if (e.getKeyCode() == e.VK_DOWN) { String s = subjectHistory.forward(); if (s != null) { jTextFieldSendSubject.setText(s); } } else if (e.getKeyCode() == e.VK_UP) { String s = subjectHistory.back(); if (s != null) { jTextFieldSendSubject.setText(s); } } else if (e.getKeyChar() == '\n') { jTextFieldSendMessages.requestFocus(); } }
/** Selects the text on gaining the focus. */ public void requestFocus() { super.requestFocus(); selectAll(); }