View Single Post
  #1 (permalink)  
Old 01-19-2008, 01:57 AM
monkey04 monkey04 is offline
Member
 
Join Date: Jan 2008
Posts: 3
monkey04 is on a distinguished road
Send a message via AIM to monkey04 Send a message via MSN to monkey04
jscrollpane problem
Hey, I'm having trouble getting scrolling to work properly with a jtextarea. Any help would be appreciated. What I have is basically:

Code:
JTextArea test = new JTextArea(); for (int i = 0; i < 50; ++i) { test.append(i + "\tstrings!!! \n"); } test.setPreferredSize(new Dimension(200, 200)); JScrollPane testScroller = new JScrollPane(test); testScroller.setVerticalScrollBar(new JScrollBar()); testScroller.setPreferredSize(test.getPreferredSize()); mainPanel.add(testScroller);
This doesn't work right, it only lets me scroll the first 13 or so lines, if at all. How can I set it to work right and handle all the lines of text that may appear??
Thanks!
Reply With Quote
Sponsored Links