1. JTextField - is it possible to scroll text in a text field. coderanch.com |
2. automatic scrolling of JTextField coderanch.com |
3. JTextField, auto-scroll when something is added coderanch.com |
4. JTextField scrolling question? coderanch.comimport javax.swing.*; import javax.swing.event.*; import javax.swing.text.*; public class CenterCaretListener implements CaretListener { // // Implement CaretListener interface // public void caretUpdate(final CaretEvent e) { // Attempt to scroll the viewport to make sure Caret is visible SwingUtilities.invokeLater(new Runnable() { public void run() { try { JTextComponent component = (JTextComponent)e.getSource(); int width = component.getSize().width; int center = width / 2; int position ... |