Scroll bar does not retain its position after or before pack

Hi All,

My code is:

scrollPane.getHorizontalScrollBar().setValue(100);

//pack();

log.debug("Value>" + scrollPane.getHorizontalScrollBar().getValue());

Initially my horizontal scroll bar position is 0.

Then i am am hardcoding it to 100.

But now my scroll bar position is at 90.

Value>90

I don't know why?

If i am setting the value below 90 it works well.

But i crossed above 90, whatever the value it is retaining to 90.

This works welll only if there is no pack().

If i use pack(), my scroll bar positioned to 0.

Can anybody help me to get rid of this problem.

[659 byte] By [rose@rosea] at [2007-11-27 9:07:21]
# 1
What's the value of getMaximum() for that scrollbar? It sounds like 90 is the max.
hunter9000a at 2007-7-12 21:43:59 > top of Java-index,Desktop,Core GUI APIs...
# 2
Quit multi-posting questions. You asked this same question yesterday and have not provide any new information. You where asked:a) to post a SSCCEb) use the formatting tags.You have done neither, so I guess you really don't want help.
camickra at 2007-7-12 21:43:59 > top of Java-index,Desktop,Core GUI APIs...