Question for code about sliders ????
I have three sliders s1,s2 and s3.
s3 is non-changeable while s1 and s2 are regular sliders.
max and min values of s1 and s2 are 100 and 0 resp. and the default value is 0.
s3 has min and max of 0 and 50 and the default value is at 50.
what i want...............................
when i change and value of s1 or s2 by any amount, the s3 slider should change its value accordingly.
eg. when i increase s1 from 0 to 10 , s3 will decrease from 50 to 40 and then when i change s2 from 0 to 20 s3 should decrease from 40 to 20 then i decrease s1 from 10 to 0 and s3 will increase from 20 to 30 . got it ?
i've been trying for days but i have no clue...........
I've written the for displaying the sliders but I do not know what to type in the coding part. I am a complete beginner so can anyone write an example code for me and explain me its working .
Re: Question for code about sliders ????
Can you post the code you are having problems with and explain what problems you are having with the it?
You should read the API doc for the slider class to see what methods it has and to see how it creates events and how to use listeners that receive event objects from the sliders when their values are changed.
Is this the same problem: http://www.java-forums.org/new-java/...tml#post295768
Re: Question for code about sliders ????
Quote:
Originally Posted by
Norm
Can you post the code you are having problems with and explain what problems you are having with the it?
You should read the API doc for the slider class to see what methods it has and to see how it creates events and how to use listeners that receive event objects from the sliders when their values are changed.
Is this the same problem:
http://www.java-forums.org/new-java/...tml#post295768
yes it is the same but i still did not get a proper correct answer
Re: Question for code about sliders ????
Quote:
i still did not get a proper correct answer
You were given several ideas to work on. Have you tried any? We are not going to write the code for you. The tutorial that a link was posted for has sample code.
Did you add a listener for the sliders? You need to do that first.