Changeset 10665 in josm


Ignore:
Timestamp:
2016-07-28T23:29:52+02:00 (8 years ago)
Author:
Don-vip
Message:

fix #13236 - Display text from the beginning in large JOSM text areas

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextArea.java

    r8291 r10665  
    66
    77import javax.swing.JTextArea;
     8import javax.swing.text.Caret;
     9import javax.swing.text.DefaultCaret;
    810import javax.swing.text.Document;
    911
     
    8890        TextContextualPopupMenu.enableMenuFor(this, true);
    8991        addFocusListener(this);
     92        Caret c = getCaret();
     93        if (c instanceof DefaultCaret) {
     94            // Prevent component to scroll down after setting large text, forcing users to initially scroll up
     95            ((DefaultCaret) c).setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
     96        }
    9097    }
    9198
Note: See TracChangeset for help on using the changeset viewer.