1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-02 00:15:02 -04:00

Avoid bad position issues

This commit is contained in:
Reinhard Pointner 2016-09-11 11:10:51 +08:00
parent 098491bb7f
commit 6a19f83539

View File

@ -305,10 +305,17 @@ public class FormatDialog extends JDialog {
} }
public void setFormatCode(String text) { public void setFormatCode(String text) {
// update format code
editor.setText(text); editor.setText(text);
editor.scrollRectToVisible(new Rectangle(0, 0)); // reset scroll
editor.setCaretPosition(text.length()); // scroll to end of format // scroll to last character and focus
editor.requestFocusInWindow(); try {
editor.scrollRectToVisible(new Rectangle(0, 0)); // reset scroll
editor.setCaretPosition(text.length()); // scroll to end of format
editor.requestFocusInWindow();
} catch (Exception e) {
log.warning(e::getMessage);
}
} }
private RSyntaxTextArea createEditor() { private RSyntaxTextArea createEditor() {