Forums Register Login

JTable doesn't refresh :(

+Pie Number of slices to send: Send
Hi Guys,
I'm doing a project for the university and I've got a problem with a JTable.
When I add some items it doesn't get updated, if someone could help I'd appreciate it.

Here is my code :



As you can understand... my attempt at the method reloadTheGUI() doesn't work. I'm planning on implementing there the code to refresh the JTable.
+Pie Number of slices to send: Send
Anybody ?
+Pie Number of slices to send: Send
Hi,

First, a bit of business: you may not have read our naming policy on your way in. It requires that you use a full, real (sounding) first and last name for your display name. An initial isn't enough for a last name. You can change your display name here. Thanks!

Now, as to your problem: the TableModel needs to let the rest of the world know the data has changed. The way to do that is via a TableModelEvent, and the easiest thing you could do would be to call fireTableDataChanged() on your TableModel. This will cause the JTable to refetch all of its contents from the model.
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1235 times.
Similar Threads
JTable ........
JTable -Adding Column and Fix Columns Problems
DefaultListModel & JTable; how to sync the items in the DefaultListModel
jtable change cell value effect
JTable help
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 09:01:30.