File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Jtable refresh Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Jtable refresh" Watch "Jtable refresh" New topic

Jtable refresh

hassan ali
Ranch Hand

Joined: Apr 23, 2006
Posts: 127
i have table list name and ID

i choose row then name it apper in textfield i give this name password in another textfield

then click Jbutton save

i need this name and its row to be removed from jTable

note my JTable use TableModel extends from DefaultTableModel and in JScrollPane

this TableModel has implemented function called go() to reload data[][]

i call go() function ,then fireTableDataChanged()

but no effect
hassan ali
Ranch Hand

Joined: Apr 23, 2006
Posts: 127
it looks need some steps and organizing

1-new object from your tableModel that extends DefaultTableModel
Tablemodel new_model=new Tablemodel();

2-use command setModel in your JTable Object to set new Model that you create last step


3- run function that you create it that re_fil your data array (data[][]) in side your new Model to get the new data


4-Fire data change function to take new data and put it inside your table


these steps for refresh all the table i hope it understandable
Rob Spoor

Joined: Oct 27, 2005
Posts: 19911

Why don't you just use DefaultTableModel and use its methods for removal?

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: Jtable refresh