Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By DarrylBurke

Thread: selected cell is not rendering of Jtable with AbstractTableModel

  1. #1
    kpras is offline Member
    Join Date
    Mar 2012
    Posts
    2
    Rep Power
    0

    Default selected cell is not rendering of Jtable with AbstractTableModel

    We have Jtable with AbstractTableModel , with out selecting any row if i sort the table everything is working fine.
    But the problem is ..selecting a row and click on the sort , sorting is working fine ..only problem is to select the row (we have to click on any of the cell in that row), selected cell is not rendering , rest all cells and rows are rendering properly. if I press escape or any other action like click on same cell now the data in the cell is rendered.

    we have implemented getTableCellRendererComponent and getTableCellEditorComponent methods ...i have inspected renderer method ..can confirm that only selected cell is not coming in the renderer.

    After performing sorting , invoking fireTableDataChanged() (tried with fireTableRowsUpdated(0, getRowCount())).

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: selected cell is not rendering of Jtable with AbstractTableModel

    Why AbstractTableModel? Do you really have a customization that precludes extending DefaultTableModel, where all of the basic functionality is already implemented?

    To get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    kpras is offline Member
    Join Date
    Mar 2012
    Posts
    2
    Rep Power
    0

    Default Re: selected cell is not rendering of Jtable with AbstractTableModel

    Yes , we have lot of customizations , rendering checkbox , images ,textfieds in table cell and filtering and sorting for each cell and highlight and unhighlight

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: selected cell is not rendering of Jtable with AbstractTableModel

    Then you'll need to post that SSCCE.

    Incidentally, if your custom model is dealing with
    rendering checkbox , images ,textfieds in table cell ... highlight and unhighlight
    you have a wrong design. Those are all the jobs of the renderer and editor.

    db
    Fubarable likes this.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. checking if a cell in JTable is selected
    By Dcalladi in forum AWT / Swing
    Replies: 4
    Last Post: 10-21-2011, 12:17 AM
  2. JButton to detect if cell in a table is selected
    By Levian in forum New To Java
    Replies: 5
    Last Post: 08-09-2011, 06:56 AM
  3. how to get the currently selected row fo a jtable?
    By kulangotski in forum AWT / Swing
    Replies: 4
    Last Post: 01-16-2011, 05:22 AM
  4. Replies: 6
    Last Post: 01-30-2010, 02:55 PM
  5. Help with JTable rendering
    By daniel2008 in forum AWT / Swing
    Replies: 8
    Last Post: 01-18-2009, 03:51 AM

Posting Permissions

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