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 8539547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:23:29+00:00 2026-06-11T11:23:29+00:00

I recently encountered a bug in java where JList will fire the valueChanged() method

  • 0

I recently encountered a bug in java where JList will fire the valueChanged() method twice when changing a value with the mouse, and only once when changing a value with the keyboard. I just found a bug regarding this on Oracle’s website (apparently, the bug is more than twelve years old), and I’m wondering if anyone can explain to me why Oracle has decided that this isn’t a defect (not to mention that getValueIsAdjusting() returns false when the keyboard is used).

For anyone having this issue, I found that simply checking for when getValueIsAdjusting() is false, then running the rest of my method will get around the issue.

  • 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-06-11T11:23:31+00:00Added an answer on June 11, 2026 at 11:23 am

    There is a simple explanation.
    When you are applying selection with mouse you perform a list of actions:

    1. Press left mouse button on some element
    – list selects an element under the mouse and fires 1st event
    – also here you will get getValueIsAdjusting=true since the mouse is not yet released

    2. You might drag mouse without releasing it to change selection
    – list will fire an additional event for each selection change made
    – getValueIsAdjusting will be also true for each of those events since you are still making changes

    3. You release mouse
    – list will fire the final event – selection operation is finished
    – getValueIsAdjusting=false now, you can do whatever you want with final selection

    To summ up – those additional events are fired to let you completely control list behavior on selection changes (on selection change sequence to be exact). You might want to ignore the selection changes when getValueIsAdjusting=true since there always will be a final event with getValueIsAdjusting=false which will inform you that selection changes are finished.

    Also, when you change selection with key buttons list wouldn’t know if you are going to change it after first key press or not, so getValueIsAdjusting will be always false for such changes.

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

Sidebar

Related Questions

Recently I encountered a bug in an application I took over from another developer.
I recently encountered a scenario in which if a set only contained a single
I recently encountered a problem in my production database due to MySQL bug. The
Just recently, my client's blog http://robertnogueira.com/ encountered a bug. If you look at the
I've recently encountered a situation where I need to create a generic method to
I've recently encountered the following exception... java.lang.IllegalStateException: Cannot obtain Writer because OutputStream is already
I've recently encountered a very rarely reproducible bug. If I cast a pointer that
I've recently encountered the following exception on some machines. Unhandled Exception: System.MissingMethodException: Method not
I recently encountered a problem where a value was null if accessed with Request.Form
Developing a heavily XML-based Java-application, I recently encountered an interesting problem on Ubuntu Linux.

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.