Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8577741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:13:40+00:00 2026-06-11T20:13:40+00:00

Hi have a Jtable with a specific cell rendered model for one column. This

  • 0

Hi have a Jtable with a specific cell rendered model for one column. This model, just put buttons in this column instead of text data.

The first display of the table works well. WHen I’m using a function that change the order of the content, the model is still called for this column (the redraw is forced through a call to fireTableDataChanged()).

Now, I want that the delete key delete the current row of my table. For this, I’m using the following code:

public void keyTyped(KeyEvent arg0) {
    if (arg0.getKeyChar() == KeyEvent.VK_DELETE) {
        int currentRow = this.m_data.currentRow();
        if (currentRow >= 0) {
            this.m_data.deleteRow(currentRow);
            System.out.println("mise a jour après destruction de ligne");
            this.fireTableRowsDeleted(currentRow, currentRow);
        }
    }
}

(m_data is my table model).
Surprisingly, the data are updated (row has disappeared), but the first column is empty. And my traces show that just getValueAt() are called. getTableCellRendererComponent() is not called.

I have tried to fire fireTableDataChanged() instead of fireTableRowsDeleted() but it is the same thing. Hence it does not seem to be relative to the fire function. Any idea about the origin of this problem, and the way to solve it?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T20:13:41+00:00Added an answer on June 11, 2026 at 8:13 pm

    OK, finally I found the problem. I had a ListSelectionListener, that, in somes circonstances, sent a fireTableCellUpdated(-1,0). This is this command that “stupid Java” interpreted as “remove the table rendering”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I Have a JTable where the data model contains information from a sql query.
I have a JTable of which one column is pre-filled with 30min time slots
I have a jTable with two columns.First column is set as Boolean(for checkbox) and
I have a JTable that I want to use to display some data (a
I have a JTable with two columns and both are JComboBox, for this purpose
I have a Jtable on which I called the method table1.setAutoCreateRowSorter(true); . So this
I have a JTable with a predefined model how to ask the model to
How can I make my JTable show specific stuff for each column? Can I
I have a standard JTable with certain data inside. I would like to create
I have a JTable that is using a TableColumnModelListener() to detect when the column

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.