Java abstract class which provides default implementations for most of the methods in the TableModel interface.
Questions tagged [abstracttablemodel]
294 questions
0
votes
0 answers
AbstractTableModel with ArrayList and CheckBoxes has setValueAt error
I receive a java.lang.IndexOutOfBoundsException: Invalid range error with the AbstractTableModel that I am setting up to display the contents of my ArrayList. I think it has to do with auto sorting the table. How do I fix the…

Ebad
- 131
- 11
0
votes
2 answers
Making a cell visible in JTable when AbstractTableModel is extended
I have extended the AbstractTableModel to suit my requirements. Now this table can be altered by other methods of my GUI. I want the table to scroll to the currently edited cell into view. To do this, I think I have to first get the JViewport of the…

sasidhar
- 7,523
- 15
- 49
- 75
0
votes
0 answers
JTable using abstracttablemodel not updating after insert
This is a follow-up question to my post here.
My JTable is populated using abstracttablemodel. I implemented an insertRow method which works perfectly in the database but does not refresh my JTable. As seen in the code below, after the insert, I use…

Probius
- 79
- 10
0
votes
1 answer
Update JTable after delete or insert
I have a JTable that is populated by an Access DB using a ResultSet &AbstractTableModel. I have a method that deletes the record from the DB correctly but am having trouble refreshing the current view of the table model. I've looked at similar posts…

Probius
- 79
- 10
0
votes
1 answer
Insert empty row into jtable if lowest row gets edited
Is there a way to insert always an empty row if the lowest row gets edited?
I always want to have a free row on the bottom and if someone edits the lowest row, there should be automatically inserted a new one.
I use that AbstractTableModel:
public…

mafioso
- 1,630
- 4
- 25
- 45
0
votes
0 answers
Removing and Adding Rows in a Sorted JTable using AbstractTableModel
I have a JTable using AbstractTableModel where I activated the sort with :
table.setAutoCreateRowSorter(true);
I have my own insert and delete functions which were working fine as long as the table is not sorted.
private void insertLine(JTable…

Djoz
- 161
- 2
- 9
0
votes
1 answer
Jtable will not save data of the cell when editing
I have JTable that has a column editable. It should get Integer values and update table. But when I edit a cell and go to another cell, the data will erase and goes back to null but the program does not throw any exceptions. How can I fix it?…

s_puria
- 397
- 1
- 8
- 19
0
votes
1 answer
How do I write an addElement method for a custom Model class extending AbstractTableModel?
For a hw assignment, I need to setup a JTable in Swing, and populate the table's contents via a custom model class that extends the AbstractTableModel. My questions regarding this overly complicated process are many fold, but I'll try and keep it…

Jerry
- 537
- 1
- 9
- 16
0
votes
1 answer
Object Initalization in AbstractTableModel
I am working on a small programm that should display recipies in a JTable.
All seems to work fine, the only problem I've got is that I can't initialize the object that should hold the data properly. Here's the class that gives me headache:
class…

ALMA
- 1
- 1
0
votes
2 answers
Refresh JScrollPane JTable Data on JPanel in JFrame
I wnat to fill my Table with new Datas which i get by my DataBase(MySQL). I get all datas and create a new Model with them, but if i want to refresh the specific panel, then it wont be repainted.
public class PanelWest extends JPanel implements…

Reptain
- 9
- 2
0
votes
1 answer
How do I make Swing delete an entry from a table by selecting rows and clicking delete?
I have a panel with one table in it. The table is a simple view of entities from database. I want the user to be able to select the entries(=rows) and click delete.
I have my own table model that extends AbstractTableModel.
I didn't find any method…

tensojka
- 302
- 1
- 5
- 20
0
votes
1 answer
How to refresh table model after data and size change
My project is simple implementation of app like MC, NC or Total Commander. I use 2 JTables with custom model that extends AbstractTableModel and my problem is updating these tables with new data and size.
Whenever I try to update it with my method,…

PlainLazy
- 67
- 1
- 6
0
votes
1 answer
How are listeners handled in Java Swing?
The question is how swing handles listeners. In this example it is the TableModelListener which is in focus.
The table model (let us call it TableModelImpl) I have is extended from AbstractTableModel. Between this table model and the JTable I have…

patrik
- 4,506
- 6
- 24
- 48
0
votes
1 answer
Java Swing AbstractTableModel-IndexOutOfBounds exception when deleting a row
I'm making a Swing project. Probably, it's too big to be pasted here. I even tried to log a table.getSelectedRow() and it was showing a correct index. But somehow, when I press a delete button, which leads to the remove method called in this class,…

small-j
- 309
- 1
- 4
- 12
0
votes
0 answers
Table model not displaying in Java
In my table model, I give it the data, put it in a 2d array, but it still does not show up. This table model has worked for me in the past, so I have no idea why it is not. Nothing is displayed when using this. I KNOW for a fact that the data 2D…

Rabbit Guy
- 1,840
- 3
- 18
- 28