Click to See Complete Forum and Search --> : How set JScrollPane to bottom?


zhndrsn
February 21st, 2000, 11:00 PM
I've set up a a JScrollPane with a JTextArea as its contents. Each time my program runs the JTextArea gets filled up, but you have to manually scroll to the bottom to see the latest information. Is there some setting that will make the viewing area always position to the bottom? Alternately, is JScrollPane and JTextArea the way I want to go? Here's how I've set the code up:

JPanel cp = new JPanel();
cp.setLayout(new FlowLayout());
processOutput = new JTextArea(10,40);
JScrollPane scrollOutput = new JScrollPane(processOutput);
cp.add(scrollOutput);
setContentPane(cp);
setVisible(true);

Thanks in advance for any help you can give me.
Sam