Results 1 to 3 of 3
  1. #1
    rattaman is offline Member
    Join Date
    Nov 2009
    Posts
    5
    Rep Power
    0

    Red face Jtable and cell coordinates

    Dear all,

    I'm using a JTable in NetBeans and I'm using some user-defined JDialog(s) as cell editors (as matter of fact, the data within the cells needs to be formatted in a very specific way).

    Well, I wanna show this JDialog(s) just beside the selected cell from the JTable object, but I don't find any method in JTable that let me get the X and Y coordinate of the top-left corrner (or any other corner) of the cell. However, I can get the mouse location when I click on the cell and I also can find the width of the column from which the cell belongs to.

    Any idea?

    Thanks in advance.
    Best regards.

    Roy

  2. #2
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default

    but I don't find any method in JTable that let me get the X and Y coordinate of the top-left corrner
    Look for a method that returns a Rectangle object.

  3. #3
    rattaman is offline Member
    Join Date
    Nov 2009
    Posts
    5
    Rep Power
    0

    Default

    First of all, thanks for your answer.

    Quote Originally Posted by camickr View Post
    Look for a method that returns a Rectangle object.
    ...and the answer is: getCellRect(...) method from JTable!

    Thanks again camickr.
    Roy

Similar Threads

  1. jtable cell renderer
    By ankitmcgill in forum New To Java
    Replies: 2
    Last Post: 05-22-2009, 02:08 AM
  2. add a check box to only one cell in a JTable
    By aruna1 in forum New To Java
    Replies: 4
    Last Post: 04-03-2009, 07:28 PM
  3. Color cell in JTable
    By ippacciani in forum AWT / Swing
    Replies: 3
    Last Post: 03-25-2009, 12:53 PM
  4. jTable Cell editing
    By mahaling_m in forum AWT / Swing
    Replies: 0
    Last Post: 06-23-2008, 09:17 AM
  5. Jframe In Jtable cell
    By Clarion in forum AWT / Swing
    Replies: 4
    Last Post: 06-23-2008, 05:42 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •