I could not post my entire code. I am having my code in framework. I am working in a project. In that I am facing this difficulty.could you please send me your sample code.
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.
By this snippets its retaining the positon very well. I got what i expected.Thanks for providing me the solution. But if I use the code provided below,
My scroll bar is not retaining its position. The problem here is, assume my getHXValue() is 100.I am setting this to my horizontal scroll bar. But when i retrieve the value of horizontzl scroll bar it is 0. LLLLL------>0 ( because of pack()). But i need to use pack() and also retain the position of scroll bar. Have you got the point? Kindly reply me. Thanks
You need to save the position of the ScrollBar and restore it after calling pack(). If you are just setting it to the value of getHXValue() after calling pack(), just call the set line again after pack:
ouput : hx : 347 Hori : 347 VY :132 Verti :132 VY :132 vertical height :502 But my scrollbar postion is not retaining? It is restting to 0. please reply me