Mouse clicks not detected on JTabbedPane

Hi all,
I have a JPanel placed inside a JTabbedPane. I want to double-click on the JPanel and bring up a JDialog. This works fine if the JPanel is not in a JTabbedPane, but if it is on a JTabbedPane, then the mouse clicks are not detected. I'd greatly appreciate any help you can give me.

Here is a sample program that seems to work:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;
public class TestInternalFrame extends JFrame
     public TestInternalFrame()
          JDesktopPane desktop = new JDesktopPane();
          setContentPane( desktop );
          JInternalFrame internal = new JInternalFrame( "Internal Frame" );
          desktop.add( internal );
          internal.setLocation( 50, 50 );
          internal.setSize( 300, 300 );
          internal.setVisible( true );
          JTabbedPane tabbedPane = new JTabbedPane();
          internal.getContentPane().add(tabbedPane);
          tabbedPane.setPreferredSize( new Dimension(300, 200) );
          JPanel panel = new JPanel();
          tabbedPane.add( "Empty Panel", panel );
          panel.addMouseListener( new MouseAdapter()
               public void mouseClicked(MouseEvent e)
                    System.out.println(e.getClickCount());
     public static void main(String args[])
TestInternalFrame frame = new TestInternalFrame();
frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
frame.setSize(400, 400);
frame.setVisible(true);

Similar Messages

  • Mouse clicks not recognized?

    I have a 20" iMac w/ the most recent updates. In the past couple of days I have a problem with mouse clicks not being recognized. It seems to happen when I begin to fill in a text field either in Safari or the Finder (like trying to enter username/password, to authenticate in the finder, etc) The wierd thing is that this only happens on one of the two user accounts on this computer. I have also created a new user account and it is fine. I've looked for applications that are different, but can't find any. I have repaired permissions and repaired the disk through disk utility.
    I am at the end of my rope! Please help!

    I somehow managed to fix it, for now. I think I ended up resetting the PRAM. I gave up trying software solutions and unplugged everything, including the iMac's power cable, and cleaned up the mess of cables behind my desk because I needed some time to think. After starting up the computer, everything seems to be fine. If the problem comes back, I'll post here again. Thanks for the suggestion!

  • Mouse click not working

    i set up a new battery, i pressed command D without not cause. After that my mouse is not working, its noly moving and scroll. Does not CLick.what to do now?

    Please reset the SMC Control, Apple explains how in:
    http://support.apple.com/kb/ht3964

  • MBA Mouse clicks not registering?

    I've got a weird one with my son's MBA (2008), running Mountain Lion. It's not recognizing mouse clicks from either trackpad or external Magic Mouse. This is happening from boot- normal boot, safe boot and booting into tools menu.
    He was playing minecraft when it went out and nothing I've tried since has got it back- basically lots of reboots and reseting NVRAM and SMC.
    I don't have a wired USB mouse to test that with at home, and I don't have an external USB drive with enough space to create a mountain lion rescue disk at them moment- at least not one I'm milling to mess with (backup drives). I'll pick up an 8GB thumb drive later and give that a try however.
    Any thoughts appreciated- likely a trip to the genius bar, but that's best avoided- closest one is an hour away.

    This is kind of a dirty rotten problem.  Your submenus are inside the main menu right?  So when you click on a submenu item (i.e. menu1A), you are also clicking on the main menu (menu1).  Technically both click events fire (menu1a is first, menu1 is second). A better way to think about it is:  If you are doing construction on your bathroom you are doing construction on your house since the bathroom is in your house.  Confusing, right?
    To fix this, you want to "cancel" the click event for menu1 if you click on one of the sub menu items. Add this line into each of your sub menu functions:
    e.stopImmediatePropagation();
    So one of your functions would look like this:
    function onClick1A(e:MouseEvent):void {
    e.stopImmediatePropagation();
    SWFAddress.setValue("cycling/amgen2010/");

  • Submenu mouse clicks not registering

    I really don't know half of what I'm doing when it comes to Action Script 3. Through a lot of trial and error, I finally have my menu with submenus displaying properly, but just not functioning the way that I have intended. The submenu items appear when a mouse over registers on the mainmenu item. The submenu mouse rollovers are registering correctly because the right content is displayed and the alpha channel changes are registering. The problem is with the mouse clicks for the submenu items. I don't understand why but a mouse click on a submenu button is registering as a click on the mainmenu item, not the submenu item. Could someone please explain to me why the rollover function is working and not the mouse click, and what I need to do to fix my code? I hate to admit it, but I am really clueless here.
    Here is my website:  www.deyonjonson.com
    And here is the relevant part of my code:
    SWFAddress.addEventListener(SWFAddressEvent.CHANGE, SWFAddress_changed);
    menu1.alpha = 0.5;
    menu1.buttonMode = true;
    menu1.useHandCursor = true;
    menu1.menu1A.visible = false;
    menu1.menu1B.visible = false;
    menu1.menu1C.visible = false;
    menu1.addEventListener(MouseEvent.ROLL_OVER,onOver1);
    menu1.addEventListener(MouseEvent.ROLL_OUT,onOut1);
    menu1.addEventListener(MouseEvent.CLICK,onClick1);
    menu1.menu1A.addEventListener(MouseEvent.ROLL_OVER,onOver1A);
    menu1.menu1A.addEventListener(MouseEvent.ROLL_OUT,onOut1A);
    menu1.menu1A.addEventListener(MouseEvent.CLICK,onClick1A);
    menu1.menu1B.addEventListener(MouseEvent.ROLL_OVER,onOver1B);
    menu1.menu1B.addEventListener(MouseEvent.ROLL_OUT,onOut1B);
    menu1.menu1B.addEventListener(MouseEvent.CLICK,onClick1B);
    menu1.menu1C.addEventListener(MouseEvent.ROLL_OVER,onOver1C);
    menu1.menu1C.addEventListener(MouseEvent.ROLL_OUT,onOut1C);
    menu1.menu1C.addEventListener(MouseEvent.CLICK,onClick1C);
    function SWFAddress_changed(e:SWFAddressEvent) {
    switch (e.value) {
    case "/index":
    gotoAndStop("main");
    break;
    case "/cycling/amgen2010/":
    gotoAndStop("cycling_amgen2010");
    break;
    case "/cycling/amgen2009/":
    gotoAndStop("cycling_amgen2009");
    break;
    case "/cycling/amgen2008/":
    gotoAndStop("cycling_amgen2008");
    break;
    function onOver1(e:MouseEvent):void {
    my_ssp.loadContent(0);
    SWFAddress.setStatus("index");
    menu1.alpha = 1;
    menu1.menu1A.alpha = 0.5;
    menu1.menu1B.alpha = 0.5;
    menu1.menu1C.alpha = 0.5;
    menu1.menu1A.visible = true;
    menu1.menu1B.visible = true;
    menu1.menu1C.visible = true;
    function onOut1(e:MouseEvent):void {
    SWFAddress.resetStatus();
    menu1.alpha = 0.5;
    menu1.menu1A.visible = false;
    menu1.menu1B.visible = false;
    menu1.menu1C.visible = false;
    function onClick1(e:MouseEvent):void {
    SWFAddress.setValue("index");
    // menu1A
    function onOver1A(e:MouseEvent):void {
    my_ssp.loadContent(1);
    SWFAddress.setStatus("cycling/amgen2010/");
    menu1.alpha = 1;
    menu1.menu1A.alpha = 1.0;
    menu1.menu1B.alpha = 0.5;
    menu1.menu1C.alpha = 0.5;
    function onOut1A(e:MouseEvent):void {
    SWFAddress.resetStatus();
    menu1.alpha = .5;
    menu1.menu1A.alpha = 0;
    menu1.menu1B.alpha = 0;
    menu1.menu1C.alpha = 0;
    function onClick1A(e:MouseEvent):void {
    SWFAddress.setValue("cycling/amgen2010/");
    // menu1B
    function onOver1B(e:MouseEvent):void {
    my_ssp.loadContent(2);
    SWFAddress.setStatus("cycling/amgen2009/");
    menu1.alpha = 1;
    menu1.menu1A.alpha = 0.5;
    menu1.menu1B.alpha = 1;
    menu1.menu1C.alpha = 0.5;
    function onOut1B(e:MouseEvent):void {
    SWFAddress.resetStatus();
    menu1.alpha = .5;
    menu1.menu1A.alpha = 0;
    menu1.menu1B.alpha = 0;
    menu1.menu1C.alpha = 0;
    function onClick1B(e:MouseEvent):void {
    SWFAddress.setValue("cycling/amgen2009/");
    //menu1C
    function onOver1C(e:MouseEvent):void {
    my_ssp.loadContent(3);
    SWFAddress.setStatus("cycling/amgen2008/");
    menu1.alpha = 1;
    menu1.menu1A.alpha = 0.5;
    menu1.menu1B.alpha = 0.5;
    menu1.menu1C.alpha = 1;
    function onOut1C(e:MouseEvent):void {
    SWFAddress.resetStatus();
    menu1.alpha = .5;
    menu1.menu1A.alpha = 0;
    menu1.menu1B.alpha = 0;
    menu1.menu1C.alpha = 0;
    function onClick1C(e:MouseEvent):void {
    SWFAddress.setValue("cycling/amgen2008/");
    Any guidance on how to clear this up would be greatly appreciated.
    Thank you!

    This is kind of a dirty rotten problem.  Your submenus are inside the main menu right?  So when you click on a submenu item (i.e. menu1A), you are also clicking on the main menu (menu1).  Technically both click events fire (menu1a is first, menu1 is second). A better way to think about it is:  If you are doing construction on your bathroom you are doing construction on your house since the bathroom is in your house.  Confusing, right?
    To fix this, you want to "cancel" the click event for menu1 if you click on one of the sub menu items. Add this line into each of your sub menu functions:
    e.stopImmediatePropagation();
    So one of your functions would look like this:
    function onClick1A(e:MouseEvent):void {
    e.stopImmediatePropagation();
    SWFAddress.setValue("cycling/amgen2010/");

  • Microsoft Designer Bluetooth Mouse is not detected in 10.10.3

    Microsoft Designer Bluetooth Mouse is not getting detected as a bluetooth mouse on OSX 10.10.3. During pairing, it just shows up as a bluetoth device and after some time, there is a popup that no mouse is connected. Also, when you try to add the mouse though Mouse->Add a Bluetooth Mouse screen, the mouse is not gettng detected.
    But the mouse works once its paired, but its not seen as a Mouse by OSX. Its just being detected as a generic bluetooth device.

    Its listed in the data sheet for the product. But the microsoft site does not show the same in compatibility list

  • Mouse click not always recognized

    Adobe is slow to recognize my mouse clicks when selecting items. For example I will have selected 1.jpg, then get ready to work on 2.jpg, but I will have to click three to four times before 2.jpg will show in my properties window. Although I can see it is selected in the main window, any work I will do gets applied to 1.jpg. I do not have this issue with any other adobe products.

    How big are your images?
    Are you working with valid code?
    http://validator.w3.org/
    (='.'=)
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/

  • Mouse wheel not detected

    I'm using 64-bit arch on a MacBook Pro.  The trackpad is working much better now (thanks Allan McRae!) but the mouse wheel on any external mice is not detected.  For example on MacOS I have a Logitech M555b connected via Bluetooth, and magically that mouse keeps working in Arch... but without any wheel.  (aside... that's interesting, it must be that the MB bluetooth has firmware to treat connected HID devices as USB HID? because I didn't even have to mess with bluez to get it working)    Likewise if I plug in an old USB Dell mouse its wheel doesn't work either.  Here's the relevant stuff from Xorg.0.log:
      2746.817] (II) config/udev: Adding input device HID 05ac:820b (/dev/input/event11)
    [  2746.817] (**) HID 05ac:820b: Applying InputClass "evdev pointer catchall"
    [  2746.817] (**) HID 05ac:820b: always reports core events
    [  2746.817] (**) HID 05ac:820b: Device: "/dev/input/event11"
    [  2746.829] (**) HID 05ac:820b: ButtonMapping '1 2 3 6 7'
    [  2746.829] (--) HID 05ac:820b: Found 3 mouse buttons
    [  2746.829] (--) HID 05ac:820b: Found relative axes
    [  2746.829] (--) HID 05ac:820b: Found x and y relative axes
    [  2746.830] (II) HID 05ac:820b: Configuring as mouse
    [  2746.830] (**) HID 05ac:820b: YAxisMapping: buttons 4 and 5
    [  2746.830] (**) HID 05ac:820b: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
    [  2746.830] (II) XINPUT: Adding extended input device "HID 05ac:820b" (type: MOUSE)
    [  2746.830] (**) HID 05ac:820b: (accel) keeping acceleration scheme 1
    [  2746.830] (**) HID 05ac:820b: (accel) acceleration profile 0
    [  2746.830] (**) HID 05ac:820b: (accel) acceleration factor: 2.000
    [  2746.830] (**) HID 05ac:820b: (accel) acceleration threshold: 4
    [  2746.830] (II) HID 05ac:820b: initialized for relative axes.
    [  2746.830] (II) config/udev: Adding input device HID 05ac:820b (/dev/input/mouse1)
    [  2746.830] (II) No input driver/identifier specified (ignoring)
    I tried adding options to force it to 7 buttons in /etc/X11/xorg.conf.d/10-evdev.conf:
    Section "InputClass"
            Identifier "evdev pointer catchall"
            MatchIsPointer "on"
            MatchDevicePath "/dev/input/event*"
            Driver "evdev"
       Option         "Buttons" "7"
       Option         "ZAxisMapping" "4 5"
       Option         "ButtonMapping" "1 2 3 6 7"
    EndSection
    which didn't help.
    xev doesn't see events for the wheel.

    Hi,
    I'm having the same issue, I bought a Logitech Bluetooth mouse, and I found that it works "magically" without any configuration.
    The strange thing it's that as far as I know, the btusb.c of kernel 26.36 doesn't have the right string for macbook pro bluetooth controller, so for hcitool, dmesg, etc, there isn't any bluetooth in the system.
    The mouse as ecloud told, works, but without the mouse wheel. I'm not sure what would be the best thing to do, if recompile the kernel to make bluetooth work, or maybe it's possible to configure udev to have the wheel working...
    Any suggestion or help would be very appreciated!
    Thanks,

  • Mouse Clicker Not Working

    Hey
    You know how the mouse clicker is supposed to pop back up after you click it? Well only one side of my clicker does. The other side will not pop back up. I believe my laptop is still under warranty. If I take it into the Apple store can they fix it?
    Thanks

    If you are under warranty, just take it back and Apple should fix it.
    If you are out of warranty, I'm sorry no answer for that.

  • Webi: Mouse clicks not working

    Hi
    I am using BO XI 3.1, Webi 12. .1.0.882 client. It is not responding to mouse clicks although I can use keyboards to open the universe e.g.(even for logon).
    Any ideas why is this happening and how to sort this?
    Thanks for all help.

    I have the same problem some times.
    This is going to sound crazy, but try this:
    1. Lay the mouse down like you would if you were going to use it.
    2. Use you index finger and "bang" on the mouse like you were mad at it. Hit it where the primary button (left side for me) is. Don't be too aggressive.
    3. It should work. It has always worked for me.
    4. It also helps to clean the track ball. I just run the track ball back and forth on my jeans.
    Good luck!
    P.S. I do not think this will void any warranty, just don't tell Apple!

  • Mouse clicks not working

    Hello,
    I am managing a mac pro (leopard) from a macbook (leopard) using remote desktop 3.2. Often when I control the mac pro, and enter a user session the mouse clicks on the managed computer behave incorrectly. A normal click corresponds to a click with a side button (the ones that show all the windows on screen). When this happens I have no other solution than to reboot the managed machine because I can't control it with the mouse. (can't select anything)
    Has this happened to anyone else ?

    Oops. Doing the same thing again. If I disconnect/reconnect the mouse, the buttons get switched to the right position. After that log out/in and the buttons are again the other way around. To do a click have to press the command key while pressing the mouse button.

  • Mouse clicks not working on published air app, works fine when debugging/testing

    So I have an issue where when debugging my Air application, it runs fine and mouse clicks work and everything.  When I publish the application and install it, it plays fine but clicking does nothing.
    We have an older version which is working when we publish it and we're trying to add things in one step at a time, but I figured I'd see if anyone else has had this issue.  A bit frustrating.
    Thanks!

    FIXED!!!!
    We're using Dropbox to share files and it turns out that two people having project open at same time is a bad idea when doing final publish!  It creates conflict files and effects the final package or something of that nature.
    Glad we got that one figured out!

  • Mouse movment while clicking not detected

    I have a Java Swing program that was built using the Netbeans IDE. I notice that the bottons all work is I hold the mouse still while I click but if the mouse is moving while the click happens my software never sees the click event. User complain that it is sometimes hard to hold the mouse exactly stationary when they click.
    I figure there is either some proberty I'm not setting right or I need to look for some other kind of event. I can't seem to find this in the docs. Mybe I don't even know what search term to use.

    I have a Java Swing program that was built using the Netbeans IDE.Yuck.
    the bottons all work is I hold the mouse still while I click but if the mouse is moving while the click happens my software never sees the click event.Use an ActionListener, not a MouseListener.
    [http://java.sun.com/docs/books/tutorial/uiswing/index.html]
    [http://java.sun.com/docs/books/tutorial/uiswing/components/button.html]
    db

  • Magic Mouse click not working

    I have a magic mouse, with a MBP and 10.6.1 and the wireless mouse update installed.
    The mouse more or less works if "Secondary click" is checked. If I uncheck it, clicking does nothing. The mouse moves and scrolling works, but clicking has no effect.
    Also with "Secondary click" checked, if any part of my hand is touching the top surface of the mouse, I get a right-click when I click - makes the grip kind of awkward.
    Tried re-installing the software update.
    Any ideas? Thx.

    Not sure why it worked this time, but I deleted
    com.apple.driver.AppleBluetoothMultitouch.mouse.plist
    from the User preference folder again, and now the mouse is behaving as normal. I did not touch the .globalpreferences file.
    I did clean all the system/user caches (using Cache Out X), and then deleted this file again, but now the behavior seems correct
    - with Secondary Click deslected, the surface acts as one big single click button
    - with Secondary Click selected, it acts as a two button mouse
    - in Secondary Click mode, resting your second finger on the contexual side surface while clicking on the single click side surface does not interfere with the single click as it had before
    - in Secondary click mode, you need to lift your finger off the single click side when clicking the contextual button side, or it will not register as a contexual click. I presume this is expected behavior, as it is physically a one-button mouse, and Apple opted for a two-finger click to be interpreted as the more common single click request.
    Hope this helps some

  • Mouse enter and mouse leave not detected in small controls

    Look at the attached VI. There is a thin boolean with mouse enter and mouse leave events which are not always detected when moving over the control quickly. I'm not sure whether this behavior originates from LV (7.0) or from the way XP handles the mouse movement, but I would definitely call this a bug in the sense that the mouse does "enter" and "leave" the control and the events are not fired.
    My guess is that windows does not register all the points that mouse goes through, but only does so periodically. If it happens that 2 adjacent points are on 2 different sides of the control, LV can't recognize the enter and leave events. But that's just a guess.
    Try to take over the world!
    Attachments:
    event bug1.vi ‏26 KB

    I put together a quick test, but I'm not sure what the results mean.
    Lynn, one of the tests uses windows API (although you can run the other one).
    Shane, sorry, only 7.1 on this PC.
    Message Edited by tst on 07-12-2005 08:38 PM
    Try to take over the world!
    Attachments:
    event bug25.vi ‏40 KB

Maybe you are looking for

  • Using more than one i-Tunes library

    Ahem - apologies if this is a bit of a thicko question - but does anyone know if it's possible to use two i-Tunes libraries i.e. I have one on my MAC at home and a totally different one on my PC at work - but when I plug my Shuffle in to either one t

  • How do I get 5.1 audio out of itunes

    I have just bought a Mini DisplayPort to HDMI adaptor for my iMac.  I run an HDMI lead from the adaptor to a Sony AV receiver, and the AV receiver is connected to a Samsung TV by HDMI. The problem I have is with both TV and Receiver switched on the o

  • Game center

    game center

  • Table View in View-based Application

    Hi. I want to use an UITableView in a View-based Application. All examples I found are for Navigation-based Applications. I Found only one example for View-based Applications, but it create all components himself without the Interface-Builder. I sear

  • Error: No depreciation  posting required in period 009 (current period)

    Hi,   I am getting error " No depreciation posting required in period 009"  and  009 is my current period.    The description of the error says " Do depreciation is posted, since according to the posting cycle no postings are required in this period"