question: private static void onTabPressed ( KeyEvent event ) throws BadLocationException { JEditorPane editor = ( JEditorPane ) event . getSource ( ) ; Document doc = editor . getDocument ( ) ; int pos = editor . getCaretPosition ( ) ; String remainder = doc . getText ( pos , doc . getLength ( ) - pos ) ; if ( pos < doc . getLength ( ) - 1 && remainder . charAt ( 0 ) == '"' ) { for ( int i = 1 ; i < remainder . length ( ) - 1 ; i ++ ) { char c = remainder . charAt ( i ) ; char c2 = remainder . charAt ( i + 1 ) ; if ( c == '"' && c2 == '"' ) { editor . setCaretPosition ( pos + i + 1 ) ; event . consume ( ) ; return ; } } } }
target:  Reacts to a pressed tab. If the tab happens upon filling an attribute value and there are other empty attribute values in the editor, automatically goes to the start of the next attribute value. Else, does nothing.