Select item with Right Mouse Click

hello, this is a pretty simple idea: i want to be able to have an item in a JList be selected when i RIGHT click on it, not just left click.. i want to do this because i have a popup menu come up, but i also want the item that the mouse is over to be selected, so the user doesnt have to left click an item, then right click...
im pretty sure theres a way to do this.. i looked through documentation, but had no luck.. thanks a lot,
Steven Berardi
------------------------

hi,
combobox.addMouseListener(this)
public void mouseClicked(MouseEvent e)
if(me.getModifier()==MouseEvent.BUTTON3_MASK)//rechte Maus
String item=combobox.getSelectedItem();
implement the other methods for interface mouselistener

Similar Messages

  • 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.

  • Having problem with right mouse click

    When connected to a database and try to create a table using the right mouse click, only options available are a (grayed out) clear filter and help. Those options are the same when using the right mouse click on other objects. This is a clean install with the newest version available on windows XP service pack 1.

    No luck in reproducing this on SQL Developer v1.0.0.14.67, Win XP SP 2, DB 9.2.0.5.
    If my connected user has privs to create tables, I get Create Table, Apply Filter, Refresh, Clear Filter (disabled unless I have a filter) and Help.
    If my connected user doesn't have privs to create tables, I get Create Table (disabled), Apply Filter, Refresh, Clear Filter (disabled unless I have a filter) and Help.
    Even looking at the tables node under a user in the Other Users area I get Apply Filter, Refresh, Clear Filter (disabled unless I have a filter) and Help.

  • JTable selection _only_ with right mouse button

    I have a JTable and my code is responsible for selection. All selection should only be done with the right mouse button. The left on will be used for other purposes. However, I do not know how to stop selection with the left mouse button.
    Currently selecting with the right mouse button does the selection in "my way". Klicking with the left mouse button still offers selection the "default way". I want to disable this default way. How can this be done?

    First you get the ListSelectionModel of the jtable. Then use setSelectionInterval to set selection. Look at following code:
    table_list.addMouseListener(new MouseAdapter() {
    public void mousePressed(MouseEvent e) {
    showPopUp(e);
    public void mouseReleased(MouseEvent e){
    showPopUp(e);
    private void showPopUp(MouseEvent e){
    if (e.isPopupTrigger()){
    menu_point.setLocation(e.getPoint());
    ListSelectionModel lsm = table_list.getSelectionModel();
    lsm.setSelectionInterval(table_list.rowAtPoint(menu_point),table_list.rowAtPoint(menu_point));
    popup.show(e.getComponent(),e.getX(),e.getY());
    });

  • JTable, select row on right mouse click

    Hi,
    If I right click on a jTable row in my application, the row I click on does not get selected.
    How can I modify the mouse listener attached to the jtable to deal with this?
    jtable.addMouseListener( { e->
    if (e.isPopupTrigger())
        swing.popupMenu(menuItems).show(e.getComponent(), e.getX(), e.getY());
    } as java.awt.event.MouseListener)Thanks!

    Problem solved!
    jtable.addMouseListener( { e->
    if (e.isPopupTrigger()){
        int row = jtable.rowAtPoint( e.getPoint() );
        jtable.changeSelection( row, 0, false, false );
        swing.popupMenu(menuItems).show(e.getComponent(), e.getX(), e.getY());
    } as java.awt.event.MouseListener)

  • JSF Tree with right mouse click

    Hello,
    I am trying to build a JSF tree such that If I right click on any of tree nodes, it should display a vertical menu. Is it possible to do with JSF Tree? If yes, can someone point me where I should start from?
    Thanks.

    unfortunately, the browser usually uses right click to bring up a browser's menu for copy/paste, etc. I don't think javascript can intercept that though I could be wrong.

  • Can't pause flash with right mouse click on mac osx 10.6 after update from firefox 3 to 6

    After updating my firefox 3... to firefox 6 I can no longer right click in a flash video and pause it

    My camera is a 1Ds mk II..
    and for that one it says
    All versions tested. All versions tested. Supported only through Lightroom 4.1.
    however, it also says
    Windows XP, Vista, 7; Mac OS X 10.5 or 10.6
    which is plain wrong, because Canon never supported any drivers for Windows Vista or Win 7, not to speak of XP 64bit. (You cannot connect the camera via firewire, without the device drivers!)

  • Right mouse click problem on T60p with WIN-XP SP3

    I have T60p model. After upgrading my WIN-XP to SP3 i am facing problem with Right mouse click. Right mouse click starts working as left click. Initially when I reboot my machine it works fine but after sometime I start getting above mentioned problem. I even installed the latest mouse drivers(ultranav) from Lenovo site. Has anyone got this same problem? Looks like Lenovo should fix this problem.
    Thanks in advance. 

    This isn't necessarily a driver problem, and it's not necessarily Lenovo's problem.
    The primary and secondary mouse buttons can be switched by a program you are running, although it wouldn't seem that this is very likely.
     Windows Start Menu | Settings | Control Panel | Mouse. This will take you to the Mouse PropertiesTabbed Dialog. Click on the Buttons tab. There you can see if the primary and secondary buttons are truly switched. If so, you can switch them back, without rebooting the machine.
    Centex

  • Right Mouse click causes Finder to restart, folder to close

    Trying to bring up contextual menu > New Folder with right mouse click causes screen folders and icons to disappear and the finder appears to restart Open folders close. It is quick like a finder restart? It is annoying and alarming.

    Sounds like a Finder restart.
    Used Disk Utility to verify, and if necessary repair, your drive and permissions?
    If all is reported clear then try removing com.apple.finder.plist in your user library preferences folder to someplace else on your drive. This will reset your preferences but it may be a corrupt preferences file.

  • I am using FireFox 4. Where is the "Bookmark All Tabs-" feature. I would like to save my Tabs for a later session. The selection is not on the menu when I right-mouse click or go to the Bookmarks feature of the Menu.

    Missing "Bookmark All Tabs…" feature which was in previous versions of FireFox 3.x. If you right-mouse click on a neutral part of the Browser window, there would be choice of "Bookmark this page" or "Bookmark All Tabs…". I have been unable to find it either in the sub-menu or the BOOKMARK selection from the Menu Bar.

    What do you mean by Tabs sub-menu is it right-clicking on a tab ?
    I know that "ctrl-shift-D" still work.
    I know that a right-click on a tab gives the "Bookmark all Tabs" function.
    But I would like to see it back in the Bookmarks menu. (which is its logical place)
    Because today the choice only disappeared from the menu as it is still reachable through keyboard shortcut or through mouse right-click on a tab
    but tomorrow it will totally disappear and personally I don't want that as this is one of my favorite functionality.
    Tank you for your understanding !

  • When I use Mail and want to paste an emailadress with a right mouse click in the adres field this doesn't work, ofcourse cmd V  works. How can I solve this

    when I use Mail and want to paste an emailadress with a right mouse click in the adres field this doesn't work, ofcourse cmd V  works. How can I solve this

    YAY!  That did it.
    Thank you so much.
    And a Very Happy and Prosperous New Year to you!
    bonnie

  • How to select a row in JTable for right mouse click ?

    Hi All,
    I need to select a row on JTable for right mouse click ?
    Can any one help me ?
    Thanks a lot.
    Seelam.

    Got solution...
    tabel.addRowSelectionInterval(..) works.
    thanks.

  • How to Select  a Row in a JTable, on a right mouse click?

    Hi all!
    I need to know the Row index in a JTable, on a right mouse click?
    Executing following code, I get the "Column Number" on a mouse click
    TableColumnModel columnModel = tableView.getColumnModel();
    int viewColumn = columnModel.getColumnIndexAtX(e.getX());
    int columnIdx = tableView.convertColumnIndexToModel(viewColumn);
    Dows any body know the code that gets "rowIdx" on a mouse e.getY() method??
    Hope early response!

    int row = table.rowAtPoint( e.getPoint() );
    int column = table.columnAtPoint( e.getPoint() );

  • Right-mouse click with two fingers!

    It appears that the new 17" MBP has a setting that allows you to right-mouse click by having two fingers on the touch pad and pressing the mouse button.
    Besides being an absolutely fantastic trick, it's the final feature I want for my 15" MBP that makes it complete. (Well, I would have liked a real delete key as well.) So, when can we see this feature added to the 15" MBP?

    http://discussions.apple.com/thread.jspa?threadID=474477&tstart=0

  • How do I fix error message "This document contains a link to an asset being upsampled. You should resize it smaller or right-mouse click on the asset in the Assets panel to see additional options." Which asset is it?

    I ab in Muse. How do I fix error message, This document contains a link to an asset being upsampled. You should resize it smaller or right-mouse click on the asset in the Assets panel to see additional options.

    You should ask in Help with using Adobe Muse CC
    This Cloud forum is not about using individual programs
    This Cloud forum is about the Cloud as a delivery & install process
    If you will start at the Forums Index https://forums.adobe.com/welcome
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll

Maybe you are looking for

  • Access to memory slots on b320

    I want to upgrade my ram on my b320 but have hit a brick wall trying to get the back off. I've looked on YouTube where a vid shows it just being slid off but mine won't budge. I don't want to force it or prise it off in case I do damage. Is there a k

  • Web dynpro URL not working in user's UWL

    Hi, I am not sure if this is the right place for this question. I have created a web dynpro application and copied the URL and we put this URL in the UWL of a user using workflow, now the issue is when a user click on that URL on the portal side it's

  • Ical won't print

    iCal will print a daily, weekly or annual view; but it wont print a week view.  Obviously a bug. How do I de-bug it?

  • Actual Query Plan not running

    I am using SQL Server 2012 (11.0.5058.0) and I am trying to learn Execution Plan Basics.  One of the tasks is to run the "Actual Query Plan" by CTRL+M.  When I try this nothing happens.  I can do the "Display Estimated Query Plan" and it works.  Why

  • ORACLE 12c RAC installation

    Hello , I'm trying to install oracle 12c cluster. I have a question about OCR and VOTING disks which Disk is shared and which one is local ? if both of them are shared, which ASM DG is created by Grid installer ? OCR or Voting ! and how to store both