Results 1 to 4 of 4
  1. #1
    Ajinkya is offline Member
    Join Date
    Jul 2012
    Posts
    9
    Rep Power
    0

    Default 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 .

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,572
    Rep Power
    25

    Default 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: Help with sliders in java
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    Ajinkya is offline Member
    Join Date
    Jul 2012
    Posts
    9
    Rep Power
    0

    Default Re: Question for code about sliders ????

    Quote Originally Posted by Norm View Post
    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: Help with sliders in java
    yes it is the same but i still did not get a proper correct answer

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,572
    Rep Power
    25

    Default Re: Question for code about sliders ????

    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.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Help with sliders in java
    By Ajinkya in forum New To Java
    Replies: 9
    Last Post: 07-31-2012, 06:33 PM
  2. Question with code
    By maximumammo in forum New To Java
    Replies: 1
    Last Post: 04-03-2012, 10:22 PM
  3. question regarding thread code
    By afx111 in forum New To Java
    Replies: 1
    Last Post: 02-01-2011, 07:39 AM
  4. How to use SWT Sliders
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-02-2008, 08:06 PM
  5. Replies: 0
    Last Post: 07-02-2008, 08:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •