Results 1 to 3 of 3
- 06-25-2010, 03:29 PM #1
Member
- Join Date
- Jun 2010
- Posts
- 2
- Rep Power
- 0
Chat window autoscroll lockes scrollbar at buttom
Hi, I'm writing an instant chat client (for practice), I use netbeans 6.8 on ubuntu 10.04.
My chat window contains a JTextPane enclosed in a JScrollBar, to get auto adjustment of the vertical scrollbar I use the following code:
It works, but it forces the scrollpane to the buttom - can't go up again to see it.Java Code:jScrollPane1.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener(){ public void adjustmentValueChanged(AdjustmentEvent e) { e.getAdjustable().setValue(e.getAdjustable().getMaximum()); } });
I did see many solutions for this problem, but they all seem to go around and adjust the visible area according to the textPane/textarea, creating ton of new problems on the way. Adjusting the visible area by the scrollbar of the scrollpane should be the right way to do it, but I can't find a way to stop it from forcing thw visible area down.
Doe's anyone know a solution for that?
- 06-25-2010, 04:16 PM #2
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,143
- Rep Power
- 5
Check out the code and discussion in Swing - JTextPane autoscroll down / stop scroll on choose
- 06-25-2010, 11:19 PM #3
Member
- Join Date
- Jun 2010
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
dragging the row header autoscroll
By Allgorythm in forum New To JavaReplies: 6Last Post: 02-15-2010, 05:10 AM -
witch buttom was clicked?
By p0rnstar in forum New To JavaReplies: 6Last Post: 01-28-2010, 04:59 PM -
change url in parent window from child window
By rakesh_n_mehta in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 07-09-2009, 12:17 PM -
Scrollbar on graphics output window
By ann123 in forum AWT / SwingReplies: 3Last Post: 06-27-2009, 08:47 PM -
how to display chat window in both source and destination machine
By bu.pradeep in forum NetworkingReplies: 1Last Post: 08-08-2008, 03:20 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks