Selecting a JList with right-click

What's the best way for a JList to select its value with a right-click. I plan on bringing up a JPopupMenu on the same right click too.

You would probably add the standard listener for this sort of thing
with the addition of selecting the item under the mouse.
class PopupListener extends MouseAdapter {
    public void mousePressed(MouseEvent e) {
        maybeShowPopup(e);
    public void mouseReleased(MouseEvent e) {
        maybeShowPopup(e);
    private void maybeShowPopup(MouseEvent e) {
        if (e.isPopupTrigger()) {
            // Make selection
            JList list = (JList) e.getComponent();
            Point p = e.getPoint();
            int index = list.locationToIndex( p );
            if ( index != -1 ) {
                 Rectangle r = list.getCellBounds( index, index );
                 if ( r.x <= p.x && p.x <= r.x + r.width &&
                      r.y <= p.y && p.y <= r.y + r.height )
                     list.setSelectedIndex( index );
            // show popup
            popup.show(e.getComponent(),
                       e.getX(), e.getY());
}If you want more advanced selection capabalities with the right click,
I'd look at implementing your own MouseInputHandler which checks for
isMouseLeftButton() || isPopupTrigger(); see BasicListUI.MouseInputHandler.

Similar Messages

  • Unable to select an image with right click of the mouse

    When in Library mode using grid view, right clicking on a thumbnail does not select the thumbnail, and previously selected items remain selected. If you then try to delete the item, you can inadvertently delete multiple items that you did not intend to delete and not the item you wanted to delete.
    Right clicking on an already selected image or one of a group of selected images works and all selected images can be deleted. However a right click on a non selected image should should drop any current selections and select only the image clicked. (This can be verified in Bridge)
    I am using Lightroom 1.3.1 in Windows XP SP2 with 2 gig of ram.

    Have you switched your mouse buttons i.e have you changed assignments to your mouse buttons in the control panel?
    If not, then clicking on an image will select it, CTRL-Click will select non-contiguous images, SHIFT-Click will select contiguous images.
    Right-clicking will show a context menu. (and the context menu will change if you have single multiple images selected: e.g if you select two images you will see a menu item Open in Compare that is not there if only a single image is selected, Delete Photo... becomes Delete Photos... etc)
    Also, in grid or filmstrip view you will see up to three levels of brightness on the frames around thumbnails:
    -lightest frame: the active image i.e. the one that will be opened if you go to develop mode, or will be used as "source" for synchronize command etc
    -medium: other images that you have selected.
    -darkest: images that are not selected.
    Selected images will also have a white frame immediately around the thumbnail.

  • How to Remove "OLAP Functions with right-click" in Workbooks (By VBA?)

    Dear Experts:
    After we created workbooks, to prevent end users from using certain BEx functions, we greyed out some "icons"
    on SAP BEx Menu in the workbooks. But now we have one problems: because we also made "Setting" unable on the menu bar, now we are not able to remove one marked selection: "OLAP Functions with right-click". Is there any way we can disable "OLAP Functions with right-click", then users can only use the normal Excel functions in the workbooks??
    Thank you very much and BR
    SzuFen

    Hello,
    Go to Business Explorer Menu, Select Settings, Uncheck OLAP Function with Right Click and save it as existing workbook.
    I have tried it. It works, when you reopen, it will be still disable..
    Hope it helps.
    San.
    Message was edited by: SAN

  • After several time installed CS6 and a clean Windows 8.1 bridge still pause after selecting a picture or right click with button mouse.

    My bridge pause all the time. I have to wait 30 seconds after selecting a picture or click the right button of the mouse. I have installed a new windows 8.1, and a fresh CD6. But still these problems in Bridge. No problems in Photoshop. What to do

    What is the problem:
    When I choose a picture in Bridge I have to wait 20 till 30 seconds (sometimes more).
    When I choose with right click of the mouse. I have to wait the same time.
    When I choose the menu. Also
    After opening the picture(s) in Camera RAW. There are no problems
    In Photoshop there are also no problems. Everything works all right.
    Only Bridge have these problems. But I can’t work with it.
    My Computer
    HP Z820 with double     CPU Type           Mobile Intel Celeron M, 2000 MHz
    Nvidia Geforce GTX 980 card
    System memory 64 Gb
    Windows 8.1 Home Edition
    All software is up to date, incl BIOS
    DirectX 4.09.00.0904 (DirectX 9.0c)
    Lots of space on my disc drives
    Software: Adobe Master Collection. But only installed Photoshop and Adobe Acrobat
    Installation done with my original DVD of Adobe. All software updated
    But still problems
    Software installed again (including Windows).
    Now installed adobe from a download version from adobe.
    Still the same problems
    I have no illegal software!
    Multimedia      
    Geluidskaart     SB Recon3D PCIe Audio Controller
    Opslag 
    IDE apparaat     Standaard Dual Channel PCI IDE Controller
    SCSI/RAID apparaat       Controlefunctie voor opslagruimten van Microsoft
    SCSI/RAID apparaat       Intel(R) C600 Series Chipset SAS RAID (SATA mode)
    SCSI/RAID apparaat       Intel(R) C600 Series Chipset SATA RAID-controller
    SCSI/RAID apparaat       LSI Adapter, SAS2 2308 Mustang
    Harde schijf       ATA Samsung SSD 850 SCSI Disk Device
    Harde schijf       ATA SAMSUNG SSD 830 SCSI Disk Device
    Harde schijf       SEAGATE ST3450856SS SCSI Disk Device
    Harde schijf       SEAGATE ST3450856SS SCSI Disk Device
    Optische Station             HL-DT-ST BD-RE  BH16NS40
    Optische Station             hp DVD-RAM GHA3N
    SMART Status harde schijf         Onbekend
    Partities             
    C: (NTFS)            243668 MB (150173 MB vrij)
    D: (NTFS)            122101 MB (65332 MB vrij)
    E: (NTFS)            429244 MB (322019 MB vrij)
    F: (NTFS)            429244 MB (243491 MB vrij)
    Geheugencapaciteit       1195.6 GB (762.7 GB vrij)
    Invoerapparaten           
    Toetsenbord     Logitech HID-Compliant Keyboard
    Toetsenbord     Standaard-PS/2-toetsenbord
    Muis     HID-compliant Mouse
    Muis     Microsoft PS/2-muis
    Netwerk            
    Netwerkkaart    Intel(R) 82574L Gigabit-netwerkverbinding  (192.168.178.37)
    Netwerkkaart    Intel(R) 82579LM Gigabit Network Connection
    Peripherieapparaten    
    Printer  Adobe PDF
    Printer  EPSON XP-950 Series
    Printer  HP 4730 PCL 6
    Printer  Microsoft XPS Document Writer
    USB1 apparaat Texas Instruments USB 3.0 eXtensible Host Controller - 0096 (Microsoft)
    USB2 apparaat Intel(R) C600/X79 series chipset USB2 Enhanced Host Controller #1 - 1D26
    USB2 apparaat Intel(R) C600/X79 series chipset USB2 Enhanced Host Controller #2 - 1D2D
    Van: station_two 
    Verzonden: maandag 13 april 2015 21:58
    Aan: johan van der klaauw
    Onderwerp:  After several time installed CS6 and a clean Windows 8.1 bridge still pause after selecting a picture or right click with button mouse.
    After several time installed CS6 and a clean Windows 8.1 bridge still pause after selecting a picture or right click with button mouse.
    created by station_two <https://forums.adobe.com/people/station_two>  in Bridge General Discussion - View the full discussion <https://forums.adobe.com/message/7434796#7434796>

  • Email Security Plug-in - Doesn't seem to work with right click or save and send

    I've searched the knowledge base but have not located the answer yet.
    We have the Encrypt Message plug-in installed to flag the email [SEND SECURE].  This works very well when in Outlook.  It does not seem to work when right clicking a file to send outside of Outlook or performing Save and Send from within Microsoft Office.  The add-in still shows and users are clicking it and the Send button but the emails are not going securely.  We are on Microsoft2010 on mostly XP machines.
    How can I get Encrypt Message to work in all instances?
    Thank you.
    Starla

    Andreas
    I am getting an error.  See below for what I'm choosing and the response.  let me know if I'm supposed to be trying to download from another area.
    Thanks
    Starla
    Email Security Plug-in - Doesn't seem to work with right click or save and send
    Cisco IronPort Email Security Appliance C370
    Release:IPAS
    Filename: CiscoEmailSecurity_7-2-0-039.exe
      Remove
    Details
    Release
    IPAS
    Filename
    CiscoEmailSecurity_7-2-0-039.exe
    Release Date
    25/Oct/2011
    Description
    Cisco IronPort Email Security Plug-in (Outlook)
    Size
    32541.84375 KB (33322848 bytes)
    Router Checksum
    0x553f
    MD5
    f0c864697d9e1a3e8f5297062943ac50
    Email Security Plug-in - Doesn't seem to work with right click or save and send
    Save the device to 'My Added Devices' list
    More Info
    'My Added Devices' list could be found by: 1. Clicking on 'My Cisco' Tab and expanding
        the 'Added Devices' section. 2. Selecting any task specific product
       selector and clicking on 'My Added
        Devices' in left pane.
    Email Security Plug-in - Doesn't seem to work with right click or save and send
    Set Cisco Notification Alert
    More Info
    All 'Cisco Notification Alerts' list could be found
    by: 1. Clicking on 'My Cisco' Tab and expanding
        the 'Support Notifications' section.
    Cisco service contract information indicates you are not authorized to download software for the following product(s):
    Cisco IronPort Email Security Appliance C170
    Cisco IronPort Email Security Appliance C370
    Cisco IronPort Email Security Appliance C650
    To download software for other product(s), remove the software for the product(s) listed above.
    Or, if you feel this message is in error, please:
    1. Email technical support for 24x7 assistance. To expedite your request, please include the following information:
             User ID (Cisco.com ID used to download software)
             Contact Name
             Company Name
             Contract Number
             Product ID
             Desired Software Release or File Name
    2. Contact your Cisco Representative, Partner or Reseller to ensure product(s) listed above are covered on a service contract. The Partner Locator link may assist in locating your nearest partner.
    3. Associate contracts for those products to your Cisco.com profile using the Instructions found in Profile Manager. After you submit your additional contracts, verification and updates may take up to 6 hours to complete.

  • Disable (all) functions on the block diagram with right-click menu

    Hello to everyone,
    here is one more idea, which I'd like to propose. 
    As for me, it would be useful to have the following: when all components (functions, wires, subVIs, etc.) are selected on the block diagram (like, after ctrl+A), operator could do right-click, and in the menu would appear menu item "Disable everything". After it, all the code could be placed into Disable structure. 
    Of course, I can add Disable structure to block diagram manually, and cover whatever I want, but with right-click menu it would be much faster.
    Also, it can be modified to disable only selected items - then each of them can be placed into separate Disable structure, and, for example, additionaly in the enabled case of Disable structure, corresponding wires will be connected. Sometimes it is needed for testing - just to disable couple functions, and test subVI. Or to disable subVI fully (it's faster, then disable place, where it is called. Especially, if subVI is used in many places).
    It will not make debugging difficult, because anyway Disabled structures are used; such functionallity can just make life a little bit easier...
     

    There is always the File->New... which opens up a new window.  You can have your templates in that window by putting them somewhere (I don't remember where at the moment).
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Can windows 7 'open with' right click open more than 1 picture at a time?

    A few times I have been given a usb drive or SD card & asked to enhance a few pictures for someone.  I usually just select one picture & then right click open wirh & select PSE.  The problem with doing this is that I can only send one picture at a time to PSE.  Is it possible to get the open with command to have more than 1 picture open?  I'm using windows 7 pro.

    Hi,
    You could try using the "Send To" option but you first have to create a shortcut.
    Use the windows explorer to navigate to
    C:\Users\"Your User Name"\AppData\Roaming\Microsoft\Windows\SendTo
    In that folder create a new shortcut to the PSE editor.
    Then you use it by selecting the images you want to process, right click and select Send To - the editor should appear in the list.
    Hope that helps
    Brian

  • MY FIREFOX NEW TAB NOT WORKING NIETHER WITH + NOR WITH RIGHT CLICKING ON TAB OR DOUBLE CLICK ON TAB

    MY FIREFOX NEW TAB NOT WORKING NIETHER WITH + NOR WITH RIGHT CLICKING ON TAB OR DOUBLE CLICKING ON TAB

    '''Try Firefox Safe Mode''' to see if the problem goes away. [[Troubleshoot Firefox issues using Safe Mode|Firefox Safe Mode]] is a troubleshooting mode that temporarily turns off hardware acceleration, resets some settings, and disables add-ons (extensions and themes).
    If Firefox is open, you can restart in Firefox Safe Mode from the Help menu:
    *In Firefox 29.0 and above, click the menu button [[Image:New Fx Menu]], click Help [[Image:Help-29]] and select ''Restart with Add-ons Disabled''.
    *In previous Firefox versions, click on the Firefox button at the top left of the Firefox window and click on ''Help'' (or click on ''Help'' in the Menu bar, if you don't have a Firefox button) then click on ''Restart with Add-ons Disabled''.
    If Firefox is not running, you can start Firefox in Safe Mode as follows:
    * On Windows: Hold the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac: Hold the '''option''' key while starting Firefox.
    * On Linux: Quit Firefox, go to your Terminal and run ''firefox -safe-mode'' <br>(you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    When the Firefox Safe Mode window appears, select "Start in Safe Mode".<br>
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, theme, or hardware acceleration. Please follow the steps in the [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]] article to find the cause.
    ''To exit Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    When you figure out what's causing your issues, please let us know. It might help others with the same problem.

  • Deactive OLAP functions with right click

    Hi guys,
    I want to deactive "OLAP functions with right click" in thw workbooks to avoid some mis-operations from users. I tried to uncheck it from BEx toolbar (under "Settings") and saved the workbook. But when I reopen the workbook, it becomes active again. Does anyone know how to deactive it forever? Thanks a lot.

    Hello,
    Go to Business Explorer Menu, Select Settings, Uncheck OLAP Function with Right Click and save it as existing workbook.
    I have tried it. It works, when you reopen, it will be still disable..
    Hope it helps.
    San.
    Message was edited by: SAN

  • I bought pages on the app store and have math type installed. However I am do not have the option to "Insert Mathtype Equations" either with right click or the drop down menus at the top of the screen.

    I bought pages on the app store and have math type installed. However I am do not have the option to "Insert > Mathtype Equations" either with right click or the drop down menus at the top of the screen. I also have OS Lion installed if this makes any difference. Please help!

    I assume but I can't check that MathType rely on the standard iWork applications location which isn't the one used by the mac App Store.
    Create a subfolder named iWork '09 in the Applications folder.
    Select the iwork applications which you own then drag them into the iWork '09 folder.
    You will be asked to type your password. Don't worry, it's normal.
    It's required because the System must store the infos describing the new location so that, if a new revision is delivered, mac App Store will be able to find the apps where they are.
    When this will be done, try to re-install MathType.
    I guess that this time it will behave flawlessly.
    Yvan KOENIG (VALLAURIS, France) mardi 13 septembre 2011 16:48:19
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • Flash files with right click imported in dreamweaver files

    Flash files created with Captivate which contain rightclick
    functionality are imported to html files created in Dreamweaver. In
    other words, I don't use the html created by Captivate but another
    html file to build up a whole course. But now a couple of those
    flash files contain a right click and obviously I have to adjust
    the dreamweaver file with some of the script that William Heinz has
    created. I am not an HTML expert and I am not 100% confident that I
    can do with just endless try&error. Could anyone give me some
    hints?
    I suppose I need to use the second bit of William's article
    "the more complex requirement".
    When I insert the flash file this is what I get: (This is
    where I am suppose to make the changes????)
    <script type="text/javascript">
    AC_FL_RunContent( 'codebase','
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','widt h','746','height','591','title','Schedule
    Let
    Me','vspace','5','src','Resources/Sched_LM_skin','quality','high','pluginspage','
    http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movi e','Resources/Sched_LM_skin'
    ); //end AC code
    </script><noscript><object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
    width="746" height="591" vspace="5" title="Schedule Let Me">
    <param name="movie" value="Resources/Sched_LM_skin.swf"
    />
    <param name="quality" value="high" />
    <embed src="Resources/Sched_LM_skin.swf" width="746"
    height="591" vspace="5" quality="high" pluginspage="
    http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"
    type="application/x-shockwave-flash"></embed>
    </object></noscript>
    I am not sure what to do with the "<Body
    onload='javascript:init()..... "etc as suggested by William.
    Thanks for any advice on this!!!

    I hope there is one person out there who can help me with
    this issue.
    I have started from scratch and created a blank html with
    dreamweaver and inserted the flash file (with right click
    animation) created with Captivate.
    Then I made the adjustments as per Heinz and also included a
    ID=Captivate1 as the RightClick.js refers to that.
    The main difference between this html file and the html file
    created with Captivate, is that the Captivate one also has
    writedocument bit.
    Anyway, is there anybody in the world who can give me
    atip/hint/suggestion?????

  • How to select the row on right click.

    Hi,
    I want row selection when user right click on the table.
    Right now when user right click on table a pop up menu comes but no row selected at this time.
    Can any body tell how select the row when right click over the table.

    Hi,
    look at this thread:
    http://forum.java.sun.com/thread.jspa?threadID=501957&messageID=2374481
    L.P.

  • Selecting listbox item with right mouse click

    Hi,
    I have a listbox control with non editable items.  Is there an easy way to select an item with a right mousebutton click (Like the left click)
    Solved!
    Go to Solution.

    Create an Event structure and generate an event on the Mouse Down? event.  Then use the Button terminal to determine if the right button was pressed.  If it was then set the value of that listbox to the row that the mouse is over.  You can do this using the invoke node Point to Row.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Removing Object WIth Right Click

    I have a JList comprised of People object. What I want to do is when the user right clicks on one of the People objects an option comes up (in menu form or something) that says remove. Upon clicking remove, I want the person object removed from the JList.
    Any suggestions on how to implement this?
    Thank you.

    You might want to check out the article http://java.sun.com/products/jfc/tsc/tech_topics/jlist_1/jlist.html
    Since the People in the list will change, you need to implement a ListModel as described in the section "Lists with Dynamic Contents".
    Although right click handling is not dealt with, there is a section on "Double-Click Handling" which you could adapt for your needs. As well as using code like this to remove a Person from the list, you may want to update the current selection (if any) to reflect the change.
    (The Swing forum is the best place to ask about JList usage.)
    [Edit] I've just noticed that you want the remove action to be triggered by a popup menu item. Have a read of how such menus are used in Sun's Tutorial: http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html

  • Acrobat 11 Pro - problem with right-click "Convert to Adobe PDF" output folder

    I'm migrating from one machine running Windows XP Pro with Acrobat 8 Pro to Windows 7 Pro with Acrobat 11 Pro.
    On the XP machine, when I right-click on a document and select "convert to Adobe PDF" the process works just fine - it always outputs the file to the target destination I have set in the Adobe PDF printer definition.
    On the Windows 7 Pro/Acrobat 11 Pro machine, the exact same settings are ignored: the PDF will always end up in the same folder as the source file.
    Both the source folder and the destination folder are on one of my office's networked drives.
    Under the Printing Preferences, I have the output folder address set the same on both machines, so it *should* go to the right location on the new machine.
    Oddly enough, on the Acrobat 11 Pro machine, if I select Adobe PDF as the default printer and do a test print, it *does* print to the correct folder!
    This has got me stumped!
    Thoughts?
    (update from later in the day)
    If Adobe PDF is selected as the default printer, I *can* select a bunch of documents, right-click, select "print", and Word will open up, and they'll print to the correct target folder.
    So, it's "just" the right-click "Convert to Adobe PDF" that doesn't work correctly.

    The reinstall is typically the last ditch effort to do. The first step is Help>Repair and Help>Updates. As far as Office 2013, the PDF Maker of AA X is not compatible and you can only print. In your list of errors it showed a problem with AcroTray.exe. As a first step, go to the print and select print-to-file. The file will be a PS file (maybe with a PRN extension). Once the printer if finished, open the file in Distiller to complete the process. If that is successful, then the problem is with AcroTray. Check your running tasks to be sure AcroTray is indeed running. If not, that is likely the problem. If it is, then restart it (it is located in the Acrobat folder). AcroTray provides the interface between the PS creation and Distiller to automate the process of creating the PDF.

Maybe you are looking for

  • Very neeby- Apple computer network- Airport router

    I am totally new to Mac computers. I have a good experience with PCs. I will be tentively setting up a mixed machines network at home. I have a few basic questions on Mac network systems. 1- does all macs have a standard Ethernet 10/100 network port

  • Huge lack of functionality - Please write about what is lacking in Photos.

    Is it just me or are we missing functionality in Photos? Photos cannot be used professionally as it is currently  -  As I see it, the program is only 80% finished Please write about what is lacking in Photos. 1) Shared Albums, sort order. Optional so

  • External Drive crashed-how to restore from Time Machine?

    I've been using TM to back up my internal, as well as an external drive. The external has been acting a bit flaky the past week or so, and I think it just bit the dust. How do I go about just restoring the data that was on it to a new external HD? I

  • Rounding to 1000 no decimals

    Hi Gurus..     In my report I want to see the KEY FIGURES rounding to 1000, I dont want the decimals to be displayed how do I do that... Thanx... Preethu

  • Data search in form fields inside a workflow

    Want to do a search on forms based on any / all fields defined in the form. Since the form is user defined and form field data may change as it passes through the workflow (and can be at any stage except completed), what will be a clean way to do the