Right click table cell selection

I'm making a GUI interface including a table. What I'd like to implement is ability to right click on the cell and open the options selection, similar as to when right click the icon on the desktop. Any ideas ?

You will need to create the component that will show your options and then add a MouseListener to your table that detects the mouse event and shows your options.
A good place to start would be to have a look at this link: http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
And here: http://java.sun.com/docs/books/tutorial/uiswing/events/mouselistener.html

Similar Messages

  • How can I get rid of numbers that are covering my entire desktop, caused by right-clicking "Clean Up Selection" on an icon?

    How can I get rid of numbers that are covering my entire desktop, caused by right-clicking "Clean Up Selection" on an icon?  The Apple OS X Mavericks blue & green desktop is totally gone.  HELP!

    Here's a screenshot of my desktop, as of a few minutes ago:  http://lewgoodman.com/desktop.tiff

  • Table cell selection border

    hi,
    how can you find out the default color of the table cell renderer border?
    when you select a cell in a JTable, there's (by default) a thin border drawn around it. since i use my own renderer for some columns, i need to find out the color of this border (it is differnt for different look & feels).
    thanksout the default

    you were right. thank you.
    just one more thing: where can i find the names of all those properties that the UIManager uses? like the one you used "Table.focusCellHighlightBorder"...

  • Out of the blue, unable to open Word attachment in Mail with double click. Have to Right click, open with, select Microsoft Word. Am running Snow Leopard and Microsoft Office for Mac 08. Cheers

    Out of the blue, am unable to open Word attachments in Mail with the usual double click. (Get a longwinded error message)
    Need to right click, select open with, and select Microsoft Word. Have been using Microsoft Office for Mac 08 for years.
    I have reinstalled the Office software. A couple of tech people have been unable to fix it. Any suggestion?? debsuemy

    Please re-post in the Office for Mac Product Forums .

  • Right-click File then select to email

    Is there an option to do this in OS X? I would like to be able to like right click a file on my desktop and then select an option to email, so then it would automatically attach the file in an email. Any help would be appreciated.

    You can very easily build a little menu item to do this - or anything else you'd like - using the built-in application Automater. Read the Help files on your computer for details.

  • Get the raw/column number of a left-mouse clicked table cell

    is this possible to get the row/column number of
    a cell where a mouse is clicked? Accutally, i want to implement a
    dynamic one column list which the user can "Add" or "Delete" some entries. The
    "Add" function is all right. The "Delete" function
    makes me upset because I cannot catch the cell's location where the
    mouse is choosing. I tries to use "Active Cell", it seems does not
    work. Do you have any clue? is this possible to implement the dynamic list using the "listbox"? thanks

    I would use the EditPos property value.  In my testing, it always returned the row and column of the cell I had left-clicked on.

  • Large Table Cell Selection (CS6)

    Hi
    I've a table 37 rows x 10 columns (no header or footer rows). Even without any formatting or content there seems a random limit on how many cells I can select at any one time. I seem to be able to select the top third of the rows. Below this it's very random what it will allow me to select.
    It won't allow me to merge rows together that straddle this two thirds point either.
    Is the table simply too big for Indesign?
    Thank you.
    Additional information: If I attempt to add rows (in the dialoue in the toolbar) it adds tham at the same point where it limits me to either selecting the cells above only... or below only.

    I don't do a lot of work with tables, but I've very successfully selected large tables over multiple pages in the past. One problem you might be encountering is that ID will not split a row across a frame or column break, so if there is a lot of data in a cell that might be a factor in your merge problem.

  • Mac Dock Right Click for Document Selection

    Will this ever come back? CS3 had this feature and it was perfect. Since CS4 it has been missing or broken. Would love this back as I work with tons of files on a daily basis all open at the same time.

    Right if I have multiple windows of Chrome open it will list the window not the individual tabs in those windows. But I get nothing anymore with Photoshop.
    I think it reads the document windows as tabs at all times since they windows can dock, but I could be wrong. Seems like whatever causes it can't be fixed with preference options or view options.

  • EPM Formatting Sheet Issue - Right click on the cell and lock the cell

    Dear Experts,
    I have come across an issue. Earlier I worked on BPC NW 10 integrated with Ms Excel 2007. I applied a feature of locking the cell linked with specific member in Input Template and Report by going to EPM Formatting Sheet, selecting dimension member (Which I want to lock in Input Sheet and Report), right clicking on the cell under Data Column and selecting the option "Lock the Cell". As I protect my Input sheet and Report, and do refresh, the cell linked with specific dimension member get locked. Hope everyone has used this feature.
    Now I have Ms Excel 2013 installed in system. I am not able to find this feature. if anyone has tried this feature in BPC NW 10 with Ms Excel 2013. Please help me out. As this was good feature by BPC.
    Regards,
    David

    Hi Andy,
    I am using Excel 2013, When I checked, I did not find "Lock Option". When I was using Excel 2007, then I had this locking option. below are the details that you asked for...
    When I right click on cell in EPM formatting sheet, I get options as shown below in screen shot, but there is no "Lock Option"
    Regards,
    David

  • Jtable in cell how to single mouse click make the cell selected.

    it seems need double click make cell selected.
    thanks!!!

    Hi,
    these link will help you.
    It has code for both examples, with 1 click and with 2 clicks:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=362073&tstart=0&trange=15
    sergio.

  • Stopping right click selecting tab in JTabbedPane

    Hello all,
    This may be a really simple thing + I'm probably being thick, but is there a way to prevent a right click changing the selected tab on a JTabbedPane.
    I tried consuming the MouseEvent, but that didn't seem to work. Couldn't find an answer anywhere else in the forums & couldn't see anything in the JavaDoc that looked as if it would help.
    Answers on a postcard please......
    RT

    You might be able to extend JTabbedPane and override setSelectedIndex().
    I had to do this to work around a focus issue I had.
      This class extends JTabbedPane to correct a problem where it doesn't
      request focus when clicked on.
    import java.awt.*;
    import javax.swing.*;
    public class MyJTabbedPane extends JTabbedPane {
      public void setSelectedIndex(int index) {
        Component comp = KeyboardFocusManager.
            getCurrentKeyboardFocusManager().getFocusOwner();
        //  if  no tabs are selected
        // -OR- the current focus owner is me
        // -OR- I request focus from another component and get it
        // then proceed with the tab switch
        boolean noTabSelected = getSelectedIndex()==-1;
        boolean hasFocus = requestFocus(false);
        boolean compIsMe = comp==this;
        if(noTabSelected || hasFocus || compIsMe) {
          super.setSelectedIndex(index);
    }

  • What is the trick to selecting table cells?

    I have a table whose construction and styling is underway; it is very hit or miss to select all or part of that table. Can anyone suggest a trick to make table cel selection more certain?
    Sometimes I get the little fat arrow and sometimes I don't..
    thank you!

    If on windows, use the "esc" button to select the cell or the text. If you select a cell, use the arrow keys to select more cells. Whole table, select one cell then "Ctrl A" to select all the table. The fat arrow is the same as the one in Word, it's sometimes driving me crazy too.

  • Right-click to select "Back" works but is accompanied by error sound

    Anyone know if Is this a known issue: In Safari (v4 Public Beta, Build 5528.17), every time I right-click and then select Back, the previous page is returned, but I get an error sound as the menu is drawn. This appears to be new with the new Beta and began occurring after installation of the initial download (an earlier build). It also happens using the trackpad.
    I'm using a third-party Logitech mouse with OS X drivers, and the buttons are set correctly. I cannot account for the behavior. It's very annoying. An older, now archived post indicated that the behavior was also noticed using Apple mice.
    Any clues?

    Hi,
    There's a chance it could be a faulty contextual menu item that is erroring and causing the sound. Have a look in these 2 folders to see if anything is present, and if so ove them to your Desktop temporarily to disable them. You'll need to quit and restart Safari for it to notice the change:
    Hard drive > Users > Your Username > Library > Contextual Menu Items
    Hard drive > Library > Contextual Menu Items

  • Right clicking selection gives nothing

    So to make this short, I can use the pen tool to create a shape, then by right clicking it I can decide what I want to do with it. When I click "Make selection" I've selected the shape, but when I right click it again in order to find out what I want to do with that shape, it doesn't let me do anything. Everything grayed out. Normally I'd have the option to copy to layer or copy to cut but nothing.
    Looks like this

    I can see that you have made a shape with the Pen tool.  You have right clicked and cosen Selection, but you must have specified a high Feather value because the selection only covers a small part of the shape, (the matching ants indicate 50% opacity). 
    From there, you would take other routes to achieve what you mention.  Ctrl j would copt the selection to a new layer, for instance, but that layer will have a heavily feathered outline.   You should still have some options if you right click again, but useful as right clicking can be, it doesn't cover everything.

  • JTable: Allowing the highlight of a row with a right click

    Hi, this is my first post here. I'm using a JTable to display data from a JDBC ResultSet and I added a popup menu to the JTable (activated with the PopupTrigger) to display options related to the selected row like DELETE, UPDATE, etc.
    But the problem is that if you right click (the PopupTrigger that MS Windows has) anywhere on the table the Pop Up shows even if you aren't right clicking over the selected row.
    What I want to do is to:
    * When I right click over a row on the JTable I want to highlight that row and then show the PopUp menu so it correctle performs the operation on the row the Menu is placed over.
    * Or another option is not to show the PopUp at all in case the cursor is not over the selected row.
    Anyway, the bottom line is that I need a way to know in which row of the JTable is the mouse over?
    Thanks in advance.

    Thanks my man! That was my missing piece!
    I also used the JTable.addRowSelectionInterval(clickedRow, clickedRow) to highlight the clicked row.
    10 Duke Dollars coming your way.
    class IFramePersons_jTablePerson_mouseAdapter
            extends java.awt.event.MouseAdapter
        IFramePersons adaptee;
        IFramePersons_jTablePerson_mouseAdapter(IFramePersons adaptee)
            this.adaptee = adaptee;
        public void mouseClicked(MouseEvent e)
            if(e.getClickCount() == 2)
                adaptee.jTablePerson_mouseClicked(e);
        public void mousePressed(MouseEvent e)
            maybeShowPopup(e);
        public void mouseReleased(MouseEvent e)
            maybeShowPopup(e);
        private void maybeShowPopup(MouseEvent e)
            if(e.isPopupTrigger())
                int clickedRow = adaptee.jTablePerson.rowAtPoint(e.getPoint());
                adaptee.jTablePerson.addRowSelectionInterval(clickedRow, clickedRow);
                adaptee.jPopupMenuRow.show(e.getComponent(), e.getX(), e.getY());
    }

Maybe you are looking for

  • From one iMac to another...

    hi guys the day has arrived ( drum roll & blow horns !!.. ) : i'm getting my 27'', i7 iMac tomorrow morning ! O.K. those were the good news, now the bad ones & my reason to panic : i have my extensive iTunes library in two Western Digital My Books (

  • How to unblock and ipad 2

    my ipad is showing that ipad is deactivated connect to itunes, but try different options can get activate

  • IPad won't send mail

    Please can anyone help. I can receive email but not send. All server details are correct. No problem with iPhone.

  • HT4623 Should iPhone s/w v5.1.1 and itunes 10.7.0.21 work?

    I've not backed up my iphone previously on my laptop yet when connecting my iphone to my laptop which has itunes 10.7.0.21 installed, I get a message indicating that I can't do this and have to re-install the itunes.  Please can someone advise if the

  • Change DB port in RAC

    Hi, This is the present configuration of Oracle EBS R12. Applications: R12.1.1 DB : 11.2.0.3 DB Tier: 4 node RAC Apps Tier: Windows DB port : 1523 At the moment DB port is 1523. Local listeners are on 1523 and Remote listeners are on Scan port 1881.