MouseListener in JScrollPane doesn't react when scroll arrows focused

If I press/release/enter a ScrollBar in any area except of the arrows, the listener reacts OK(the testing text is printed). Why does it happen? Aren't the arrows part of The JScrollBar component? What is the solution?
import javax.swing.JScrollBar;
import java.awt.event.MouseListener;
import java.awt.event.AdjustmentEvent;
import java.awt.event.MouseEvent;
public class TheScrollBar extends JScrollBar
public TheScrollBar()
addMouseListener(new java.awt.event.MouseAdapter()
public void mouseEntered(MouseEvent e)
System.out.println("Entered");               
public void mousePressed(MouseEvent e)
     System.out.println("Pressed");
public void mouseReleased(MouseEvent e)
     System.out.println("Released");
}

Hi
A quick piece of test code shows that the buttons are separate components.
import java.awt.*;
import javax.swing.*;
public class ScrollBarTest
    private static int total = 0;
    public static void main(String[] args) {
        explore(new JScrollBar());
        System.exit(0);
    public static void explore(Component c) {
        System.out.println("Component [" + total++ +"] is of type: " + c.getClass());
        // recurse
        if (c instanceof Container) {
            Container cont = (Container)c;
            int count = cont.getComponentCount();
            for (int i = 0; i < count; i++) {
                explore (cont.getComponent(i));
}Generates output like this:
Component [0] is of type: class javax.swing.JScrollBar
Component [1] is of type: class javax.swing.plaf.metal.MetalScrollButton
Component [2] is of type: class javax.swing.plaf.metal.MetalScrollButton
So, yes, they are separate components.
-- Patrick

Similar Messages

  • I can't connect my iPod classic to iTunes, it just doesn't react when I put the USB into the PC

    hey, I have an iPod classic and it can't connect to iTunes.
    I put the USB into my computer trying to add music, but it doesn't seems to react.
    It DOESN'T say that it can't recognize the Ipod..
    - Itunes just simpely doesn't react when I put the USB-cabel into my computer.
    - when i go to the task manager the "apple device mobile" and "ipod service" is acitve in the processes
    - I've tried to restart my computer (windows XP)
    - update iTunes
    - reinstall iTunes
    - restart my apple devices mobile manager
    what I think is the problem (which I can't solve) is that iTunes doen't even react to the USB
    plz hlp me!
    - ps it really should be able to add music to my iPod without getting help from a expert.

    Hello qz0rz213,
    It would seem that iTunes has encountered or developed an issue in the process of trying to sync photos to your device. The best place to start would be removing the iPod Photo Cache (thus allowing for a new version to be created).
    Note: Deleting this folder will not remove the original images from your library.
    iTunes: Understanding the iPod Photo Cache folder
    http://support.apple.com/kb/TS1314
    If the issue is not resolved by removing the iPod Photo Cache, the following article goes into further steps that can both help you determine the source of this trouble and eliminate it.
    Symptoms
    In certain situations, iTunes may display an alert or may be unable to sync photos to an iPod or iOS device. Examples include:
    After updating iOS, iTunes displays an alert that there is not enough room to sync photos
    This error appears: "The iPhone/iPod touch '[device name]' cannot be synced. The required file cannot be found."
    This article outlines steps to resolve these issues.
    iTunes: Unable to sync photos
    http://support.apple.com/kb/TS3697
    Cheers,
    Allen

  • My iphone doesn't react when I connect it to my mac

    My iphone doesn't react when I connect it to my mac

    Hello Huevo Chico,
    The article linked below details some useful steps that can help get your iPhone and your Mac to work together.
    iOS: Device not recognized in iTunes for OS X
    http://support.apple.com/kb/TS1591
    Cheers,
    Allen

  • Only in FF, Not Mac OS folder windows, when scrolling arrows are held at length scrollbar keeps scrolling to the top or bottom of long web pages with no way to stop this action.

    When ever I single click the up or down ARROWS on my Firefox browser windows, they respond just as they are set to in my Mac OS 10.4.10/System Preferences/Appearance menu. They Jump to few lines up or down the Browser Page. Smooth Scrolling is not checked On. But, even when it was checked On, this same anomaly is Repeatable.
    - Holding either Arrow Button longer than a second or 2 will result in the page scrolling All The Way in the direction of the selected arrow.
    The Arrow button that was selected stays highlighted until the scroll bar reaches its end.
    This anomaly does not happen in any other Mac App on my computer. Each time I select and Hold either scroll Arrow Button on any other app. or any folder on my desktop, as soon as I release the button the scrolling action stops immediately.

    You need to reset your default settings. This just happened to me recently!
    Exit out of all fire fox programs the go to
    Start>Run> (firefox -safe-mode)
    a box will come up and press reset default settings
    exclude the parenthesis when entering

  • My PC doesn't 'react' when I connect my Zen Microphoto

    Hello,
    I'm Michel van Gelder and I have a problem with my Zen Microphoto. I am going to try to explain my problem in proper english, but english isn't my main language, so please forgive me if i make terrible mistakes or something.
    My problem is:
    If I connect my Zen to my PC it says something like, what do you like to do, but when i click on an option it says: Media Device isn't connected. And also when I connect it, a symbol appears in the right corner, next to all the others, but when I try to do something with it's(with right mouse button or something) it disappears. The result is that, with everything i try, the PC says that my mp3 isn't connected. While 've installed all the software properly etc.
    I have this MP3 for 2 years now, and I've never had this problem. Until 2 weeks ago, when we had to reinstall our computer. So my question actually was: Is there something wrong with my Zen or with my PC. And, what can I do about it's
    I hope someone knows the answers to my questions. Thank you very much
    Michel van Gelder

    Hello Huevo Chico,
    The article linked below details some useful steps that can help get your iPhone and your Mac to work together.
    iOS: Device not recognized in iTunes for OS X
    http://support.apple.com/kb/TS1591
    Cheers,
    Allen

  • My home-button doesn't react when pressed

    Hey, guys.
    As I said in the heading, I've got a problem with my home-button.
    I've tried already to restore the phone and to configure it as a new iPhone, but in vain.
    So I've called the servicecenter yesterday and the woman on the other side told me, that I might configure my phone as new iPhone. I did so.
    With a bit of variation (e.g. pressing the home-button while linking the phone to my PC or switching the iPhone off trough pushing simultaneously the sleep- and home-button) and the help of the servicewoman it was a great surprise that the home-button worked again.
    So I decided to load a backup file and then it happened again: The button stopped working. -.-
    Could anyone help me please?

    See this previous discussion:
    FIX for iPod Touch Home Button: Apple Support Communities

  • My macbook air doesn't react when i turn the volume up/down

    it shows the grey volume icon on the display but with a little "stop" sign underneath. so i am stuck on one volume.
    thank you for response

    Go to system preferences >> Sound >> Output >> choose Internal Speakers

  • Capture now doesn't react

    I'm using an oldfashioned SONY HVR-A1E recording on tapes and I've used Final Cut Express with Capture / Now for some time and it worked fine. I always had problems using Log and Transfer, it just couldn't find my camera (there was nothing in the preview window). I can't locate my camera anywhere on my mac. I'm connecting my camera via a firewire to an external harddisk, which is connected to my Mac - it worked with Capture / Now before, but could that be the problem?
    For some reason the NOW button just doesn't react when I open Capture. I can't seem to recall doing anything differently. It would be nice if I could get the log and transfer to work by locating my camera - but at the very least just get the NOW button in the capture window to again - hope anyone can help ;o)

    Thanks for your quick reply
    My camera is set for DVsp and it says DVin iLINK on the display of the camera - when I plug the firewire cable.
    I've set the Easy Setup in FCE at (format) PAL and (use) DV-pal (I'm in Europe, but I'm using my material for web, so if other formats work better it could be different). I've tried different options within all formats and HDV doesn't respond at all so I guess DV is the right format for the recording on my camera.
    I can se and hear my recordings in the capture preview window but the NOW button just doesn't respond. When I try to set the timecodes to capture a minute - (for instance from 00:38:42:00 to 00:39:42:00) the in- and out timecodes just align to the end point (from 00:39:42:00 to 00:39:42:00) using the button CLIP it doesn't capture anything.
    Very frustrating. Now I'm just capturing my footage via iMovie and importing it to FCE, but I wish this could be solved.

  • Hero slideshow on homepage is un-pinned, yet doesn't move vertically w other content when scrolling

    I've created a hero slideshow on the homepage. It is "unpinned", however it doesn't move vertically with the rest of the content when scrolling up/down. It stays in its same spot and the other page content scrolls correctly.

    Hi Aish!
    Sadly, it is showing as unpinned in my file and I re-published the file and the carousel is still stuck. I've attached a screen capture showing the webpage (left, scrolled) and the muse file (right).
    I'm sure this is something I'm doing wrong, do you have any other ideas?
    Thanks so much for your help. Do you work for Adobe? If you do, I have other Muse questions I cannot find the answer to online. If you don't work for Adobe and are just a Good Samaritan/Angel, do you know of any manuals/reference books that might help me? I've worked in psd, ai, indd for many years. But attempting the web side of design is killing me, and I'm likely to lose my client if I can't get his site together soon. Thanks again!

  • Using a new monitor, Mozilla Firefox now has a distracting horizontal line every few lines when scrolling. This doesn't happen with another browser. HELP!

    The horizontal, wavering "line" is disruptive when scrolling. What's causing this. Doesn't happen with other browser and I'd like to stay with Mozilla Firefox, if we can resolve this. Thank you.

    hi Liza5, maybe that's an issue with hardware acceleration - please try [[Upgrade your graphics drivers to use hardware acceleration and WebGL|updating your graphics driver]] or in case there is no new version available at the moment or this doesn't solve the issue, disable hardware acceleration in the firefox ''menu ≡ > options > advanced > general'' (that setting will take a restart of the browser to take effect).

  • Spark list horizontal scroller doesn't actualize when rows is set lesser than list container

    Hello,
    The size of the Image control is set larger than that of its parent Group  container. By default, the child extends past the boundaries of the parent  container. Rather than allow the child to extend past the boundaries of the  parent container, the Scroller specifies to clip the child to the boundaries and  display scroll bars.
    In the spark list, when I change the list dataProvider and the size of the Image control is set lesser than that of its parent Group  container, the horizontal scroller doesn't actualize.
    thanks.

    <!-- Simple example to demonstrate the Spark List component -->
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" applicationComplete="comp()" width="260" height="400">
        <fx:Script>
            <![CDATA[
        import mx.collections.*;
        public var dpArray:Array;
        [Bindable]
        public var dpCol:ArrayCollection;
        public function handleClick():void {
            dpCol.removeAll();
            dpCol.addItem({ label:"spark test" });
            dpCol.addItem({ label:"spark text" });
        public function comp():void {
            dpCol = new ArrayCollection(dpArray);
            dpCol.addItem({ label:"spark list horizontal scroller doesn't actualize when rows is set lesser than list container" });
            dpCol.addItem({ label:"spark test" });
            dpCol.addItem({ label:"spark text" });
             ]]>
        </fx:Script>
        <s:Panel title="List">
            <s:VGroup left="20" right="20" top="20" bottom="20">
                <s:List width="200" id="lis" dataProvider="{dpCol}" height="120"/>
                <s:Button id="button1" label="Click here!" width="100" fontSize="12" click="handleClick();"/>
            </s:VGroup>
        </s:Panel>
    </s:Application>

  • I-Pod nano reacts when connected but doesn't do anything when disconnected

    iPod nano reacts and shows music when connected, I can listen also to the music then, but when I disconnect it, it doesn't react at all. I diconnected it right, the battery is charged, I downloaded Itunes succesfully but I can't use my iPod. Maybe it has something to do that I have Windows Vista? Can anyone give me advise what to do?

    Try here:
    https://discussions.apple.com/community/windows_software/boot_camp

  • Keyboard won't react when in landscape mode on SMS?

    Hi There.
    I updated my 5S to the IOS8.
    After that, I had problems when writing an SMS. Sometimes (almost every time) the keyboard doesn’t react to anything when turning to landscape mode. I then have to turn the phone upright, and the down to landscape again. The screen then goes black, and I can press the home-button to see the screen again.
    I actually thought this was a bug in IOS8 since it appeared after the update.
    Now I bought the IPhone 6. And I set that up with the complete backup from my 5S. I then updated to IOS 8.0.2, and the problem is also on my IP6
    I can’t find anyone else with this problem, so what can I do now?
    Is the only solution to reset the IP6 to factory default, and install sms, and contacts via iCloud?
    But then I have to install all the apps manually?
    I have a lot of apps with personal settings, and different mail accounts. I really don’t want to do all this.
    Anyone have a solution?
    Kind regards.

    Same issue here. Just did the download now I'll hit the alpha key on the screen and it does not register. Only happens in landscape mode. Only tried it on imessage and SMS, did not try email yet.
    - iPhone 6 w/ 128GB
    - Purchased directly from an AT&T Store, in US
    - iOS 8.0.2 (12A405)
    - Native iOS Keyboard
    - No other keyboard app installed or previously installed
    - Predictive typing activated

  • Firefox 37 Beta on Windows 8.1 has lag and stuttering when scrolling

    I just recently got a new laptop, and since the minute I've installed firefox on it there has been lag when scrolling webpages. It seems to start off not too badly, with there being some stuttering when I first open firefox, however it seems like the longer I'm browsing the worse it gets, to the point where sometimes I'll start scrolling and then a second later firefox will just jump to the bottom of the page. Internet Explorer and Chrome both have perfectly smooth scrolling.
    I've tried numerous things to fix it already, this is some of the stuff I can remember trying:
    -Turning off hardware acceleration and smooth scrolling
    -Starting in safe mode
    -Complete reinstall with new profile
    -Updating graphics card and intel drivers
    Specs of the new laptop:
    Core i7
    GTX 970M
    16Gb RAM

    When I was trying different versions of Firefox to see if they all had the scrolling problem, I made sure to try 36, 38, and even 31.5 ESL portable. They all have the scrolling problem when my laptop is unplugged. However, when I tried Tor just to see what would happen - bingo! Perfectly smooth scrolling once more. This is especially weird as Tor uses 31.5.3 ESL as a base...
    This made me think that it could potentially be a plugin, as Tor doesn't have any plugins installed other than Flash. However, after first disabling, then manually removing, every plugin that was listed in about:plugins the problem continues to persist.
    Any idea why Tor would work flawlessly while every other version of firefox suffers the scrolling issue? I couldn't seem to remove the OpenH264 Video Codec provided by Cisco Systems, plugin. Is it possible to remove it in order to see if it is causing the problem?

  • Published iWebsite pages turn red when scrolling pages in iWeb

    Hi everyone,
    Just wondering if I'm the only person who has this issue; when I publish my iweb sites and pages (to MobileMe) all goes well, but when I then scroll my page up and down in iWeb the site turns red again as if I have changed its content.
    I've tried the usual stuff (deleted caches, prefs, logged into MM under a bogus username and password) to check if the problem is a MM issue but this also occurs when I publish to a folder...
    I've repaired disk permissions and did a fresh install of OS X (10.6.7) two weeks ago.
    Does anyone have any other suggestions which might solve this issue? Or perhaps even the same problem?
    cheers,
    koen

    Brilliant OT!
    Although immediately posting to the discussions group says something about my personal opinion on the reliability of iWeb ... the problem was caused as you expected; the double digit finger action.
    So 'no swiping in iWeb' I suppose.
    The 'turning red' of published site pages was 100% reproducible by scrolling down using my trackpad, but it doesn't happen when I use my mighty mouse or the arrow buttons/scroll bar thing. (Even although nothing was selected in iWeb, bit of a bug if you'd ask me)
    Thanks again for pointing out the logical and to me not so obvious
    cheers,
    koen

Maybe you are looking for