can`t set a JScrollBar position correctly
jTextArea1 =new JTextArea(){
publicvoid append(String text){
super.append(text);
JScrollPane scrollPane = (JScrollPane) ((JViewport)getParent()).getParent();
int max = scrollPane.getVerticalScrollBar().getMaximum();
int vis = scrollPane.getVerticalScrollBar().getVisibleAmount();
scrollPane.getVerticalScrollBar().setValue(max - vis);
System.out.println("max = " + max);
System.out.println("vis = " + vis);
System.out.println("val = " + (max - vis) +" = " + scrollPane.getVerticalScrollBar().getValue());
}
};
the output prints always a diferent value for max - vis and the scrollbar getValue(), even I setted it just before ( setValue(max - vis) ). Shouldn`t max - vis be the maximum value of the bar, so it would be at bottom ?

