Java Code Examples for javax.swing.JComponent.hasFocus()

The following are Jave code examples for showing how to use hasFocus() of the javax.swing.JComponent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: rapidminer   File: ListPropertyTable2.java   View Source Code Vote up 6 votes
private boolean startCellEditingAndRequestFocus(int row, int column) {
	if (isCellEditable(row, column)) {
		editCellAt(row, column);
		Component editorComponent = getEditorComponent();
		if (editorComponent != null) {
			if (editorComponent instanceof JComponent) {
				JComponent jComponent = (JComponent) editorComponent;
				if (!jComponent.hasFocus()) {
					jComponent.requestFocusInWindow();
				}
				return true;
			}
		}
	}
	return false;
}