0

how to store the value set by user on JScrollBar and use it later for some calculations ?

I'm using data members int a,b to store two values set by the user on JScrollBar to perform some calculations on those variables later, but what's happening is the part of the code where calculations are being performed is getting executed first using JScrollbar's default values, and it's not waiting for the adjustment event on the JScrollbar this is the structure : class Sleep { int a,b; Sleep() { 1- [code for adjustment event on JScrollBar and storing the values] Jscrollbar - setVisible (false) 2 - [calculation on those values] } public static void main(String args[]) { new Sleep(); } } help me out please :)

6th Feb 2021, 5:56 AM
Sk. Ahmed Razha Khan
Sk. Ahmed Razha Khan - avatar
1 Antwort
0
int myValue = myScrollBar.getValue();
6th Feb 2021, 7:27 AM
JaScript
JaScript - avatar