Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6190801
Votes 0
Synopsis XP L&F: No rollover effect on the JSlider component
Category java:classes_swing
Reported Against beta , 1.4.2_02 , tiger-beta , mantis-beta
Release Fixed mustang(b53)
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs 4784677
Submit Date 04-NOV-2004
Description
In the Windows LAF on WinXP the system sliders has rollover effect while Swing JSlider misses it.

Start following application:

import javax.swing.*;
import java.awt.*;

public class SliderTest {
    public static void main(String[] args) {
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch(Exception ex) {
            ex.printStackTrace();
            System.exit(-1);
        }

        JFrame frame = new JFrame("Slider test");
        frame.setLayout(new BorderLayout());
        frame.add(new JSlider(), BorderLayout.CENTER);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
    }
}

And see that when mouse over the JSlider it does not highlight its marker like native sliders do.
  xxxxx@xxxxx   11/4/04 16:56 GMT
Work Around
N/A
Evaluation
Need to add mouse listener support for WindowsSliderUI.
  xxxxx@xxxxx   2005-04-14 17:14:42 GMT
Since the BasicSliderUI provides it's mouse listener in the form of a public class with a factory method to create it, I built a subclass called WindowsTrackListener which handles the rollover state and passes everything else back down to the subclass. Then I updated the paintThumb() method to check for the rollover boolean and set the state to State.HOT. This automatically makes the xp skinning code draw the highlighted thumb correctly.  This fix only required changes to the WindowsSliderUI and doesn't introduce a new public API. It can be tested by going to the slider demo in SwingSet2 and testing the rollover thumbs
Posted Date : 2005-08-25 23:01:27.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang