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;
      }
    }
  }
}

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 ; } } } }
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 .
