Questions tagged [abstracttablemodel]

Java abstract class which provides default implementations for most of the methods in the TableModel interface.

294 questions
1
vote
0 answers

LinkedLists and AbstractTableModels

I'm still working my way through Java, and am currently having an issue with my AbstractTableModel implementation. At present I have a group of LinkedLists such that a Menu has a LinkedList of Courses, and each Course has a LinkedList of Meals.…
1
vote
1 answer

Adding double values to a TableModel in java

I have written a table model using AbstractTableModel as below. class DataTableModel extends AbstractTableModel { /** The table. */ private DataTable table; /** The Constant LOGGER. */ static final Logger LOGGER =…
Hasanthi
  • 1,251
  • 3
  • 14
  • 30
1
vote
1 answer

AbstractTableModel contains proper data but will not update on fireTablDataChanged

I've searched and seen this question multiple times, and none of the solutions work. I have an AbstractTableModel that I've extended and called AccountTableModel. The code is as such. import InvAcntItem.Account; import java.util.LinkedList; import…
KDecker
  • 6,928
  • 8
  • 40
  • 81
1
vote
1 answer

Java swing Jtable not updating through fireXXX using AbstractTableModel

I have a JTable in my GUI, which I wish to update dynamically. Associated to the Jtable is of course a TableModel, where I've extended the AbstractTableModel and overridden appropiate methods. I have four methods for my JTable: AddRow…
Harpunius
  • 120
  • 7
1
vote
2 answers

AbstractTableModel getValueAt perfomance

I am newbie in JTable, maybe I don't understand something. Let's suppose I have ArrayList of 1000 Students (id, name, surname, age). And I want to show all students in JTable. As far as I understood I must create StudentTableModel that extends…
user2022068
1
vote
1 answer

Dynamic JTable extending AbstractTableModel

I would like to make a JTable which can add rows to itself dynamically,initially the table should have no data in it. I did this by creating a TableModel class extends AbstractTableModel, code is attached. class MyTableModel extends…
user3595179
  • 15
  • 1
  • 4
1
vote
2 answers

Using TableCellRenderer and getColumnClass together

when i add getcolumn class to my abstracttablemodel, i couldnt use my custom TableCellRenderer to set background color. (i use this for sorting,alignment numeric columns) public Class getColumnClass(int columnIndex) { Object o =…
engtuncay
  • 867
  • 10
  • 29
1
vote
3 answers

Populating a JTable using ArrayList

So I try to populate jtable using my arraylist, I also want to keep 3-layer architecture My DAL I read data from file and try to populate it into table public class E { public ArrayList getinformationforthetable() { …
user2121038
  • 153
  • 1
  • 3
  • 14
1
vote
1 answer

What is the proper relationship between an AbstractTableModel and the actual SQL statements?

What is the proper relationship, in code, between a table model and the actual database queries? Inside the addRow() method in the table model, should I place a further call to my database class, which in turn inserts the row into the database? …
JDJ
  • 4,298
  • 3
  • 25
  • 44
1
vote
1 answer

What are the benefits of using a ResultSetTableModel for a JTable?

I am writing a desktop application in Java and it uses two JTables as the main output. I have a working version of the program where I use DefaultTableModels to manage the underlying data of the JTables and I use an ArrayList to store the data in…
JDJ
  • 4,298
  • 3
  • 25
  • 44
1
vote
1 answer

AbstractTableModel Implementation

I'm trying to view a table in a Jtable when a button is actioned.I hold the table in a two dimensional array and i implemented TableModel class but did not worked.I don't get an error but table doesn't appear.What am i missing? Here is my code :…
mekafe
  • 596
  • 4
  • 13
  • 32
1
vote
1 answer

Custom DataModel for JTable return Type-Safe value

Suppose I am creating a custom JTable with CustomDataModel and CustomTableListener. Suppose they work gloriously. Now suppose in the implementation that every JTable is guaranteed to have its first row populated with type-safe data, and that that…
Sean Newell
  • 1,033
  • 1
  • 10
  • 25
1
vote
1 answer

AbstractTableModel won't update JTable

i'm trying to make my JTable show changes made to my TableModel extending AbstractTableModel. I made a Heap to insert all the documents and then I apply a heapSort on my heap array, so this ordered array should be my TableModel data. It looks like…
Sergio Garcia
  • 85
  • 1
  • 8
1
vote
3 answers

Populate JTable given an object

Let's say I have a List of Items(my own class that I created that have 5 fields). I want to somehow inject these items into the JTable. And in the JTable I want to have some kind of method like public String determineColumnText(Object o, int col)…
Quillion
  • 6,346
  • 11
  • 60
  • 97
1
vote
1 answer

Create custom table model with column header in java

I'm developing a software for my friend.I have developed 90% of my project and my problem is I have a table which I fill with data in database.I have used a custom table model to fill jtable. It fills data perfectly but the problem is it doesn't…