Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 560333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:19:55+00:00 2026-05-13T12:19:55+00:00

As the title suggests I have a program with a scrollbar interface. The problem

  • 0

As the title suggests I have a program with a scrollbar interface. The problem is that the program uses the same three scrollbars for four sets of different numbers, once the change has been made to another set of numbers the scrollbar remains on the same values from the previous set of numbers

        float RedAmount1 = lightDimmer1.getValue();
        float GreenAmount1 = lightDimmer2.getValue();
        float BlueAmount1 = lightDimmer3.getValue();

        diffuseSwitch[0] = RedAmount1;          
        diffuseSwitch[1] = GreenAmount1;
        diffuseSwitch[2] = BlueAmount1;

        float StoreColours1[] = {RedAmount1,GreenAmount1,BlueAmount1};

        int StoreColourRed = (int)StoreColours1[0];
        int StoreColourGreen = (int)StoreColours1[1];
        int StoreColourBlue = (int)StoreColours1[2];

        if(diffuseSwitch[0] != StoreColourRed)
        {
         lightDimmer1.setValue(StoreColourRed);
        }

This piece of code is placed within a scrollbars event handling section so the number am trying to compare float StoreColourRed and diffuseSwitch[0] keep being changed to the values of the latest set of numbers instead of keeping the previous set of values.

any help would be much appreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T12:19:56+00:00Added an answer on May 13, 2026 at 12:19 pm

    Use a very simple class to hold your values, for example:

    private static class MyColor {
        float red, green, blue;
    }
    

    You should be able to use getValueIsAdjusting() and setValueIsAdjusting() to determine when the values are stable. You may also want to us JRadioButton or JComboBox to select which set of values is being manipulated.

    Addendum: I carelessly assumed JSlider when reading the question. Also, adjusting is probably irrelevant. JTabbedPane is another choice for selecting which set of values is being manipulated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 404k
  • Answers 404k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Nevermind, I'm stupid. In the lib/axr/stars_builder.rb, find the following: def… May 15, 2026 at 5:33 am
  • Editorial Team
    Editorial Team added an answer By default on Windows the compiler is mingw, a port… May 15, 2026 at 5:33 am
  • Editorial Team
    Editorial Team added an answer I guess one way to do it would be to… May 15, 2026 at 5:33 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.