JTable & mouse double-click?

hi,
When I double-clicked a row in a JTable ,how can i get one column's value in that row.how can i do with the mouse event.
some examples are preferred.
thankx in advance !
rain

When you say "one column's value in that row" do you mean that you want the value that the user double-clicked?
When you receive a mouse event, get the selected rows and columns from the table, then get the value from the table model using the getValueAt() method.
int[] selectedRows = table.getSelectedRows();
int[] selectedCols = table.getSelectedColumns();
String selectedElement = (String)model.getValueAt(selectedRows[0], selectedCols[0]);
System.out.println(selectedElement + " selected");

Similar Messages

  • FRM-40735 when mouse double click trigger raised unhandled exceptiORA-01722

    I am using Forms 10g.
    i am writting a procedure in When mouse double click trigger that will display all the values available for ip address from this procedure.
    The procedure is
    DECLARE
    CURSOR cr
    IS
    SELECT LEVEL NUM
    FROM DUAL
    CONNECT BY LEVEL<=(Select max_range from t_ip_address_dtl where category_name=:t_item_cpu.category and block_name =:block_head.block)
    MINUS
    SELECT TO_NUMBER(SUBSTR(IP_address, 12))
    FROM T_item_cpu;
    abc number(4);
    abc1 number(4):=null;
    BEGIN
    FOR rec IN cr LOOP
         abc1 := abc1 || ',' || rec.num;
    END LOOP;
    Message('You can use between these nos: '||abc1);
    Message('You can use between these nos: '||abc1);
    END;
    It is showing this error :-

    Yes bye mistakly i posted ,, due to internet problem..

  • Why can't I minimise itunes with mouse double click?

    why can't I minimise itunes with mouse double click?

    I do not know if you can ..
    Try -
    Command + M .

  • How to capturing Mouse double click action?

    Hi all,
    how can we identify the "mouse double click" action?
    MouseListener has methods for only mousePressed,released,clicked (single).
    Thanks in advance..
    Regards
    Sojan

    Hi,
    Thanks it worked ..
    e.getClickCount() value increases if we keep on clicking on the component, is there anythning wrong by interpreting double click as
    "e.getClickCount() >=2 "?
    Regards
    Sojan

  • Distinguishing b/t two single mouse-click and mouse-double-click

    Hi,
    I am curious to find out how Forms will distinguish between two single when-mouse-click events and a single when-mouse-doubleclick event. Is it simply a timing issue or is there more involved i.e. the 'co-ordinates' of the mouse. Thanks in advance for any opinions given,
    regards,
    Kevin.

    The difference is same as the difference of Apple and Orange.
    Its depends on O/S and event management within OS kernel.
    You can change the timing in Control panel of mouse double click.

  • MOUSE DOUBLE CLICKING

    I have an hp mouse...however it says product of china on the back..It does look like an hp mouse though..
    Anyhow..it's doubleclicking..it's driving me crazy..
    I've had the mouse for a few years..
    It just starting doing this..
    I"m running XP
    It is a USB..with a red light under it...with an optical eye?...Not sure if that's what they call it..
    Please help..Are there drivers I can use to fix this...
    I"m not sure if a windows update..might have done this..
    Many thanks..

    Hi kittylondon,
    I understand your mouse is acting like you are double-clicking even though you are only clicking. Take a look at the following, Troubleshoot mouse double-clicking when you single-click. The document also applies to Windows 7 and Windows Vista, so you will have to make sure you are referencing only the portions that apply to Windows XP. I hope this is of help to you. Best of luck. Have a wonderful day.
    Ryan1216
    I work on behalf of HP
    The advice and opinions given here are my own and not those of HP

  • Mouse Double Click on an editable cell of JTable

    Hi Pros:
    Maybe this is an old question but no answser from Forum.
    I have a JTable with adding MouseListener. I tried to put double click behavior on nay row in the table. The problem was that this action can obly work on the uneditable cell and do not work on editable cell.
    Anyone have ideas and help me.
    Thank you!

    Hi Wang,
    I have a problem similar to the one you have some time back.
    I have a query for which I need to use PreparedStatement .The query runs likes this :-
    String str = " Select ? , ename from emp where deptno ? ";
    The values of ? need to be assigned dynamically.
    But I cannot create Prepared Statement from this query .
    If you have got answer to your questions can you inform me at
    [email protected]
    Thanks in advance

  • Mouse Double Click on JTable

    I'm having difficulty seeing how to capture a double-click event from a
    JTable. I can't find the correct listener interface in order to get
    this event (ActionListener is not available for this component).
    you can contact me at
    [email protected]
    null

    hi,
    i tried
    if (event.getClickCount() == 2){
    int row =jTable1.rowAtPoint(event.getPoint());
    if (row != -1) {
    // double click processing here
    in the click event.
    it didn't work.
    any idea???
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Sathish:
    Hi,
    Did you try addMouseListener() ?
    If you are using the GridControl, use getTable().addMouseListener()
    Tx<HR></BLOCKQUOTE>
    null

  • JTable - detecting double click

    i'm trying to detect double click on a row in a JTable and then find out the row number. i can get it to detect the double click with the table disabled but the row always comes back as -1. if i try setEnabled(false) it doesn't detect the double click at all.

    I think your table should be enabled. Put a mouse listener on the table like:
    myJTable.addMouseListener(new ClickMouseListener());
    class ClickMouseListener extends MouseAdapter
        public void mouseClicked(MouseEvent e)
          if (e.getClickCount() == 2)
            Point pt = e.getPoint();
            int row = myJTable.rowAtPoint(pt);
            System.out.println("Mouse clicked on row " + row);
    }If you also have selection enabled then the row will also be the selected one so that would be another way of determiing the row number.

  • Magic Mouse: Double-click function

    I have "secondary-click"(right) activated on the "magic mouse" and it's great if I want to open a drop-down list on a page.
    However, on the "mighty-mouse" which I had before, the "right-click" was set up to act as a "double-click" which was very handy for opening documents and folders etc.
    Is there any way to set up the "magic-mouse" so that a "right-click" will act as a "double-click"?

    You could try a third-party driver like BetterTouchTool (http://blog.boastr.net/?page_id=1722)

  • In Yosemite, Magic Mouse double-click function doesn't work

    On my iMac running Yosemite 10.10.2, the double-click function on the Magic Mouse no longer works. So to open a folder, or anything for that matter, I must always do click-control ---and that doesn't work for everything. For example, I can't double click on a character in Glyphs, so this renders Glyphs useless. And so on... I have gone into preferences to see if anything was amiss in the settings, but everything checked out fine. Is there a fix for this, or do I have to wait for the next upgrade for Yosemite? Help! Thanks... --Royce

    What's the answer to this mouse problem, please? Why does my double-click no longer work on my magic mouse since downloading Yosemite 10.10.2 to my iMac? 
    What's up Apple?
    Mark

  • Trying to catch mouse double click

    Using come code in the API 1.3 documentation, I created a JList and am trying to catch when a user double clicks on an item in the list. I have the following snippet of code:
    public void mouseClicked(MouseEvent e) {
    if ((e.getClickCount() == 3) && (e.getSource() == list1)) {
    int index1 = list1.locationToIndex(e.getPoint());
    System.out.println("Double clicked from the left list on Item " + index1);
    When I double click on an item in list1, it prints out the output line twice as in:
    Double clicked from the left list on Item 1
    Double clicked from the left list on Item 1
    How can I get it to run the code only once. I'm not sure why it's running it twice. Any Ideas would be helpful. Thanks....
    Matt Menard

    I've used similar procedure with success in JDK1.3.1. Without seeing the rest of your code, the only thing left for you to experiment with is to call the consume() method if the count is greater than 1. I did notice that Java mouse event handler leaves much to be desired. For example, the mouseentered and mouseexited events kept getting fired even tho the mouse has entered and never leave.
    V.V.

  • Speed of mouse double click controls also finder

    I was wondering why my new macbook pro responded slower than my imac. Then I came across this:
    When I single-click on a folder that I haven't opened for weeks. The time that it takes the finder to show the content of a folder is affected by the setting for 'double-click-speed'.
    For some reason setting the 'double-click-speed' for the mouse to slow also slows down the speed of 'traveling' through the finder. And setting it to fast speeds up the time of going to the next level in the index.

    This is a well known Leopard Finder "Column View" bug - with your post count, I'm surprised you don't recognize the description.
    Send feed back or a bug report (for all the good that seems to do for "Finder" bugs).
    http://www.apple.com/feedback/macosx.html
    http://developer.apple.com/bugreporter/
    yada.

  • Usb mouse double click

    Hi,
    Im using fluxbox as window manager and after some upgrades the mouse very often doing double click, if I click only once. On touchpad is all right, so I dont know where is the problem. I tryed change xorg configuration - other protocol and some options, but nothing helped. I also tryed change speed double click, but nothing changed too.
    My xorg config is now:
    Section "InputDevice"
    Identifier "USB Mouse"
    Driver "mouse"
    Option "Device" "/dev/input/mice"
    Option "SendCoreEvents" "true"
    Option "Protocol" "IMPS/2"
    Option "ZAxisMapping" "4 5"
    Option "Buttons" "5"
    EndSection
    generated by hwd
    Thanks for all replies
    edit: I have kernel 2.6.33.4 and before in kernel 2.6.33.3 "mouse bug" was there too.
    Last edited by aivi (2010-05-15 11:47:40)

    edit: So Its not working well, xev show still that I pressed and released twice button, any ideas?
    In blackbox too. Its somewhere else.
    --------So it was by .fluxbox/keys I tried move them somewhere else and restart X and Its working right now. -------
    Last edited by aivi (2010-05-15 13:25:12)

  • Mouse double click on single click

    My mouse has been double clicking on a single click since changing to Mavericks 10.9. I have tried different mouse brands from Apple to Rapoo and everything inbetween. I have played with the mouse settings and rebooted, reset the pram and nothing works. It's very frustrating as a graphic designer to be slowed down because of a mouse.
    Has anyone ad this problem and has the solution to it?
    Thanks

    From the menu bar click on Go > (Hold option down) Library will appear, click it.
    In the Library goto Preferences
    Locate the following files and delete them.
    -com.apple.driver.AppleBluetoothMultitouch.mouse.plist
    Restart the computer and test.
    Hope this helps.

Maybe you are looking for

  • Search help for SKAT-SAKNR OR SKAT-SAKNR is not working

    Hi All, I have created a Search Help for F4 in a dialog program for SKAT-SAKNR OR SKAT-SAKNR. While i click F4 on that field, it displays blank values. Here is the module: module HELP_FOR_SAPGL_ACC input.   CLEAR t_SAPGL.   SELECT  SAKNR TXT20     FR

  • IPTC Core

    I've been able to get a lot of this to work, but I've run into a problem I can't figure out. Here it is... I have a Microsoft Excel 2008 spreadsheet that includes titles, descriptions, and keywords for my JPEGs. I have the following Applescript for A

  • Can I get Apple's Backup to work without MobileMe?

    I've moved to a "new" (well, to me) Early 2008 MacBook Pro with 10.6.8. With my old iMac G4, I used Apple's Backup program. I have their version for Leopard and installed it. It won't work, though. It gives an "exceeds trial limit" warning because it

  • Recommendations for the next update

    Here's a few changes I was anticipating, but didn't make it in the 10.2.1 release, but hopefully will make it into the next update: 1. The Work-Personal separation is an obstacle for screen captures. I can be taking a screenshot of SMS msgs and it go

  • Is it worth replacing HD?

    I have a six and a half year old iMac model 2104 which has been fantastic.  After doing some research I think my hard drive is failing. I'm hearing clicking sounds and get a folder icon with a ? in it when I boot up.  To get it to boot up sometimes t