I am having a panel in which there are two textfields. Now on focus lost of the first textField , i open for a JDialog box , within which i have one button clicking on which another JDialog box opens. Closing the last opened JDialog i come to the first JDialog opened, which when closed returns me back to the first panel with the textFields. Now here comes the problem,, when it returns back i get two focus/flashing carets , one of the next immediate editable textField and other on the first one. Does anyone have an idea how i can solve this ? Any kind of help would be appreciated.