How to know the row and col numbers of a cell in JTable at mouseclicked

Hi, I'm coding an app using swing and JTable, in this table I will display the records from a database, now, each time the user has click in any cell I want to display it value, whit this method:
    private void setpuntero(JTable table, int row, int col){
        Object o = table.getValueAt(row, col);
        System.out.println("Valor de la celda: "+o.toString());
}The mouseclick event was coded like this:
            table.addMouseListener(new MouseAdapter() {
                public void mouseClicked(MouseEvent e) {
                    setpuntero(table, 1, 3);
            });My question is:
how in the mouseClicked I can pass to setpuntero() method the dynamic values of the cell that the user clicked?
In this example, setpuntero(table, 1, 3); I have chosen the cell(1,3) to display the value, but really I don't know how to capture those values dinamically using the mouse click
Regards
Herbert

perhaps:
      public void mouseClicked(MouseEvent e)
        int row = table.getSelectedRow();
        int col = table.getSelectedColumn();
        String selected = table.getValueAt(row, col).toString(); // this will need to be changed if not String data
      }

Similar Messages

  • How can I preserve row and column addresses on multiple cells at once in Numbers?

    How can I preserve row and column addresses on multiple cells at once in Numbers 3.2.2? I do a lot of rearranging and sorting and want to reference cells in other sheets. After entering the formulas (example: '=Sheet1::Table 1::H126') I will sort the table and the formulas will not move with the sort.  I think I can fix this by going cell by cell checking the 'preserve row' and 'preserve column' boxes when editing the formula.  I want to avoid having to go one by one.  I know that checking the boxes creates a formula like this: '=Sheet1::Table 1::$H$126'  I have also tried entering this manually and filling down but it doesn't include the preservations (the $$) in the autofill.  If there is another way to remedy my sorting problem that would also be welcomed!
    THANKS!!

    The title of the post is this
    How can I preserve row and column addresses on multiple cells at once in Numbers?
    I restated the Question as follows
    Can "Preserve Row" an / or "Preserve Column" be set on multiple cells at the same time.
    In both cases it is not asked if multiple cells can be set to....
    That is a given.
    Step back a second...  It is like selecting multiple cells and setting the text color of the currently selected cells to red. This can be done. More than one cell at a time modified because they are currently selected.
    Whats is being asked is:  if more than one cell is selected at the same time can the settings "Preserve Row" an / or "Preserve Column" be applied. No table I put up will help with that question.
    YES or NO
    If YES how?

  • How to Increase the Rows and Columns Size of Bex Query in Enterprise Portal  of SAP  7.3

    Dear All,
    Please let me know the process how to Increase the Rows and Columns  Size of Bex Query in Enterprise Portal  of SAP  7.3 .
    Currently I am getting Only  4 columns and 10 rows in One Page .And I am getting 1,2 etc tabs for both row and column. So i want to increase the column length more than 100  and row length more than 10000.
    Please suggest me a suitable solution to over come this issue.
    Please find the Below screen shot.
    Thanks
    Regards,
    Sai

    Dear All,
    Please find the attached screen shot.
    The report be open with 4 or 5 columns and 5 or 6 rows.
    So, please  let me know how to increase the length of the table.
    Do the needful for me to over come this issue.
    Thanks
    Regards,
    Sai.

  • How to know the balance and validity of internet data in iPad

    How to know the balance and validity of internet data in iPad?

    Sir I m using internet in ipad4 with airtel network
    They provide me 2gb data with the amount of 255 rupees
    And now I inserted the sim in my ipad4
    And start the surfing on safari n all
    And now I wanted to know how much data is balance.

  • .How do I find out what Version (generation) of Ipod touch I have, as I want to know if I can download IOS 5 onto it? It was a gift so I only know the model and serial numbers but not the type

    Hi, can anyone help me out with this question?
    How can I find out which version of Ipod touch I have. I only have the model and serial numbers as it was a gift, but I would like to download IOS 5 if it is compatible?
    Very frustrated Ipod user, any advice would be much appreciated.
    Lynda.

    I had the same problem because there are so many iPod models.  There is a great article in Wikileaks that explains it all and also has pictures.  I'm confident this answer your question.

  • How to increase the row and Column length of Bex query in EP Portal 7.3

    Dear All,
    Please let me know the process  to Increase the Rows and Columns  Size of Bex Query in Enterprise Portal  of SAP  7.3 .
    Please  let settings to increase rows up 10000 and column 100 in one page.
    Thanks
    Regards,
    Sai

    Dear All,
    Please find the attached screen shot.
    The report be open with 4 or 5 columns and 5 or 6 rows.
    So, please  let me know how to increase the length of the table.
    Do the needful for me to over come this issue.
    Thanks
    Regards,
    Sai.

  • How to know the time and date when someone empty trash?

    someone delete very important videos on my mac PC , i need to know the time and date of what happens on my pc for 2 days ago to can know who delete these files and when the trash being empty
    also, i tried very hard to recovery these videos by using Data rescue program but i found old videos instead of the last videos hasa been removed??? i don't know how???!!
    so can anyone help me please

    Open the Console app located in HD > Applications > Utilities
    Select System Log on the left.
    Type trash in the search fileld top right corner of that window.
    That should reveal the date and name of the file or files that were deleted but they cannot be extracted from there.

  • How to know the printprogram and output type for perticular standard script

    how to know the print program and output type for perticular standard script and wt the proceure we will fallow to modifie the standard script..if possible u have any sample code plz share with me.....

    Hi Phani,
    To know the print program and output type for a standard script we have a table called TNAPR. So just you go to SE11 and provide the table name as TNAPR and choose display option.Then go with display entries option and in selection screen you have to provide the form name for whic you want to know the print program and output type.
    To modify a standard script first of all you have to copy the standard form for which you need modifications into Zform. Once you done this you can modify the layout set as per your requirement.Then what ever the modifications you have done in layout set for that you need to populate the data.For this you also need to do some modifications to the print program.so you have to options like directly you can modify the print program as per your requirement and other one is you can create a subroutine and do coding in that subroutine. Then you need call this subroutine in the Script Form.like this you can do modifications to the standard script........................... Reward me if its helpful..........
    Thanks & Regards.
    Laxman.P
    B'lore.

  • How to know the filename and extension of a file in PKCS7  envelope

    Hi! I've a programm that makes a PKCS7 file. I'm enveloping just one file at a time. I want to know if there is a way to know the filename and extension of the file INSIDE de PKCS7 envelope. Because I receive a file that has .p7 extension, but the real document, the one to be decyprted, I don't know its name nor its extension, and I need both for writing it (I will not just invent some name).
    Best regards!

    The construct of the PKCS7 structure you have, is defined in rfc2633. The part defining EncapsulatedContent is introduced in CMS [rfc2639], where no such attribute for a file name is saved in the structure.
    In some occasions, when it is critical, organizations add own object identifier and attibutes to save such descrptivie information as filename and extension.
    A practical approach is, on the signing side, sign the file A.ext to A-ext.p7m resp. A-ext.p7s
    You can not assume a global approach to get back the original filename (if you have no agreement on not the signing peer as above) of the encapsulated data. The reason is, the encapsulated data field is general and it does not neccesarily mean it was a file (a part of a stream or any definite sequence of bytes in general).

  • BEX formula.. How to know the row value in formulas dynamically

    Hi all,
    I just need to clarify a doubt..
    Requirement:
    COL1      -               COL2
    Y1            -               X
    Y2            -               X + 12
    Y3            -               X + 12 + 12
    YN           -               X + 12 + 12 + u2026 12(n)
    Y is dynamic from the source datau2026.. Itu2019s the year (2009,2008u2026 etc..)
    X value is from the user (i/p variable value). Some dummy valueu2026
    Now, the main logic I want to incorporate is like using a formula for COL2
    COL2 Formula looks like thisu2026.          X + (12 * N)             where N= 0 for the 1st row; 1 for the 2nd row; 2 for the 3rd row like thatu2026..
    How to dynamically allocate value for N based on the row count?
    Pls. let me know if you find somethingu2026.
    Thanks.
    Edited by: Arun Bala G on May 21, 2010 10:59 AM

    how abt this:
    This approach only valid for Workbboks..
    create COLUMN3 just type like this
    0
    12
    24
    and drag this upto end of Col1 and Col2 so it will poulate multiples of 12 then in Column 4 apply the C1-C2+C3..
    hope it helps
    Sorry Bhaskar,
    Hardcoding the formula is not relevant at all. May be you had not read this query properly. Its no way related to being dynamic right... If it was Excel workbook, anyone would have used a simple formula & moved values like cakewalk.
    So unfortunate! BEx has some limitations..
    All I need in my query is some counter like 1,2,3.... till the end of the last record. That's all.
    Pl. find the sample data
    COL1     COL2          
    2009     1.3          
    2008     13.3          Which is 1.3+12
    2007     25.3          Which is 1.3+12+12
    2006     37.3          Which is 1.3+12+12+12
    Do let me know if you have any clues?
    Thanks!
    Edited by: Arun Bala G on May 21, 2010 11:20 AM

  • How to get the Row and Column values in ALV (without using Objects)

    Hi All,
    I need to get the Row / Column when double click is used in ALV, I can use the double click event for this. However, I do not want to use the Object Oriented ALV. I want to implement the same functionality using general (using functions) ALV.
    Is there any way to get the row / column values for a Generia (non-OOPs) ALV report.
    Please help.
    Thanks,
    Vishal.

    Hello,
    The only think you have to do is to get the index where the user clicked, and then read the internal table you sent to the alv
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = 'prg_name'
          i_callback_pf_status_set = 'SET_PF_STATUS'
          i_callback_user_command  = 'USER_COMMAND' " this is to the click event!!
          i_callback_top_of_page   = 'TOP_OF_PAGE'
          is_layout                = alv_layout
          it_fieldcat              = alv_fieldcat
          i_save                   = 'A'
          it_events                = alv_events[]
        TABLES
          t_outtab                 = i_totmez.  ---> TOUR IT.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    " then....
    FORM user_commandUSING r_ucomm     TYPE sy-ucomm
                                    ls_selfield TYPE slis_selfield.
    " r_ucomm -> HAS THE STATUS
    " ls_selfield-tabindex  -> HAS THE SELECTED INDEX
    " THEN READ THE INTERNAL TABLE
    " HERE YOU WILL HAVE THE SELECTED ROW
    READ TABLE i_totmez INDEX ls_selfield-tabindex.
    ENDFORM.
    cheers,
    Gabriel P.

  • How to find the paragraph and line numbers [CS3] [JS]

    Hello,
    I have a script that finds certain text formatting. Rather than having the script select all the instances of this text I have an alert that lists the page number and the contents for each found instance. The following gets those.
    var pageNumber = myFoundSet[n].parentTextFrames[0].parent.name;
    var foundContents = myFoundSet[n].contents;
    However, I would like to include the number of the paragraph where the found text resides as well as the line number in that paragraph.
    I am stumped on how to do this. Would be nice if there were a parentParagraph and a parentLine.
    Can someone point me in a direction?
    Thanks,
    Tom

    Tom,
    Assuming that you're looking for the number of the paragraph on the page, you'd need to count the number of paragraphs in the text frame that a found item occurs in. Since indexes are always counted from the beginning of the story, you isolate the text between the top of the page and the found item by starting at the index of the first insertion point of the found item's parent text frame and the found item itself. You capture that with this single long line:
    // range over ...
    paragraph_number = myFoundSet[n].parentStory.characters.itemByRange (
       // ... index of first ins. point of found item's parent text frame ...
       myFoundSet[n].parentTextFrames[0].insertionPoints[0].index,
       // ... and index of found item
       myFoundSet[n].index
       ).paragraphs.length;
    This includes any paragraph that started on the previous page. To find the found item's line number within its parent paragraph you do something similar:
    line_number = myFoundSet[n].parentStory.characters.itemByRange (
       myFoundSet[n].paragraphs[0].index, //first insertion point of paragraph
       myFoundSet[n].index
       ).lines.length;
    There's no need for parentParagraph and parentLine: myFoundSet[n].paragraphs[0] returns an item's parent paragraph, myFoundSet[n].lines[0], the item's parent line.
    Peter

  • How to know the nos. and variable name from Jframe ?

    Hello Everyone,
    I have just started java programming. I have one form (using jframe) and there are nos. of components like text field, radio buttons, list box, buttons etc.).
    I want to know nos. and type of components (text field, radio buttons, button etc..) and variable name of these components ?
    Is there any way class / method or technique for the same ?
    With Thanks !
    Prashant Shukla

    Since if you are dealing strictly swing here, and no mixed in awt, all you have is JComponents, then where's the problem ... why do you even need to know which JComponent it is?
    This what you have?
    class StuffWithListeners  extends JFrame  implements ActionListener, KeyListener {
      StuffWithListeners() {
        jb = new JButton("GO");
        ta = new JTextArea(10,20);
        jb.addActionListener(this);
        ta.addKeyListener(this);
      public void actionPerformed(ActionEvent ae) {
      public void KeyPressed(KeyEvent ke) {
    }Edited by: abillconsl on Dec 14, 2007 5:23 PM
    null

  • Sap.table.table onAfterRendering event breaks the table rows and cols

    Hi guys,
    I am coloring all the rows, which don't have an entry.
    I do that by using the event onAfterRendering from the table control.
    The coloring is working fine, but the rows and cols get broken as u can see on the attached picture.
    By adding a new entry to the table, they get fixed.
    Any ideas how could i fix that?
    I appreciate any help.
    Regars,
    Georgi

    This is because you have overwritten the library code :-)
    please do this.
    <yourControl>.onAfterRendering = function() {
         sap.ui.table.Table.prototype.onAfterRendering.apply(this);
         <your code> ....
    -D

  • How to know the User name and date, who executed the report last time.

    Hi All,
    We are collecting a list of reports which are not executed for past 3 months. Can anybody tell me how to know the username and date they executed the report last time.
    Is there any table to look ? or is there any process ?
    Thanks,
    Ravi.

    Ravi,
    Use SE16 - then look at rszcompdir.
    We look up Version = 13 for queries.
    Regards
    Gill

Maybe you are looking for

  • [SOLVED] Ctrl+Alt+T

    hi guys sorry if my question is repeated but I can't use Ctrl+Alt+T to launch terminal. i use gnome 3. thank you Last edited by Hossan (2011-11-01 12:39:49)

  • Reporting Server best practices ...

    we are migrating a bunch of reports from reporting services native mode to sharepoint 2013. Ideally these reports would be accessible (some mutually and some exclusively) between n number of companies that are supported by the BI IT Department. There

  • Since I upgraded Itunes to 10.5 when I sync to ipad I cannot display lyrics downloaded to lyrics in info

    What to do

  • UNCAUGHT_EXCEPTION on load data for 0PU_C02 infocube

    Hi Everybody, I am trying to load data into 0PU_C02 infocube from 0PU_O31 ODS, but the system shows me a problem in the log (ST22), the message includes: "UNCAUGHT_EXCEPTION" "CX_RSR_X_MESSAGE" "SAPLRRMS" or "LRRMSU13" "RRMS_X_MESSAGE" Thanks for you

  • Data Fetching

    Hi, I am working with a report. Input parameters as kunnr, hityp, hvkorg from the table knvh. My data in the table is as KUNNR   vkorg   hkunnr 10255   2001   30349 53344   2001   30349 45678   2001   30349 74152   2001   30349 In this i need to pick