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);
// scroll to last character and focus
try {
editor.scrollRectToVisible(new Rectangle(0, 0)); // reset scroll editor.scrollRectToVisible(new Rectangle(0, 0)); // reset scroll
editor.setCaretPosition(text.length()); // scroll to end of format editor.setCaretPosition(text.length()); // scroll to end of format
editor.requestFocusInWindow(); editor.requestFocusInWindow();
} catch (Exception e) {
log.warning(e::getMessage);
}
} }
private RSyntaxTextArea createEditor() { private RSyntaxTextArea createEditor() {