Questions tagged [abstracttablemodel]

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

294 questions
20
votes
2 answers

JTable Clickable Column Sorting: Sorting sorts content of cells, but doesn't update cell formatting?

I have a sortable JTable set up to use a custom extension of the AbstractTableModel. However, some behavior of this table is what I expected, and I would love some advice on how to figure this out. I have the JTable set up to be sortable…
Panky
  • 563
  • 1
  • 3
  • 18
8
votes
2 answers

Jtable with different types of cells depending on data type

How can I implement a JTable with different types of cell editors depending on the type of input a particular row is displaying? For example some rows could be checkboxes (for boolean types) some rows could be comboboxes (if I want to provide a…
MxLDevs
  • 19,048
  • 36
  • 123
  • 194
7
votes
3 answers

create TableModel and populate jTable dynamically

I want to store the results of reading lucene index into jTable, so that I can make it sortable by different columns. From index I am reading terms with different measures of their frequencies. Table columns are these : [string term][int…
Julia
  • 1,217
  • 8
  • 23
  • 46
5
votes
2 answers

Remove multiple rows in a single pass in JTable AbstractDataModel

i've got an issue with Jtable and my dataModel. My table model extends AbstracttableModel, the datas are stored in a Vector. I'have a function witch is suppose to remove one or more row. These rows are not necessarily contiguous because my jtable…
Simon Mardiné
  • 510
  • 2
  • 7
  • 23
5
votes
6 answers

Add column to exiting TableModel

I have a class; public class A extends AbstractTableModel { ... } Using ResultSetMetaData I build the TableModel to match my result set from the database. public class B extends JPanel { ... } In class B where I extends JPanel and added class A…
Bitmap
  • 12,402
  • 16
  • 64
  • 91
5
votes
4 answers

Getting column names from an AbstractTableModel

I can't figure out something using the constructor JTable(TableModel dm). I'm using a LinkedList to manage my data so, to display it, I extended AbstractTableModel: public class VolumeListTableModel extends AbstractTableModel { private static…
dierre
  • 7,140
  • 12
  • 75
  • 120
5
votes
1 answer

Reading data from CSV file and displaying it in a JTable

I am trying to read data from a CSV file and display it on a JTable but i have a few problems. I am a noob so please bear with me. I have looked at and incorporated example code from several sources but to no avail. The table shows but it is…
Alpha
  • 51
  • 1
  • 1
  • 2
4
votes
1 answer

JTable not showing

In my application everything is distributed. On a action, application retrieves data from DB and saves in ArrayList. I create an object of RelativeTableModel where I pass the ArrayList. public void RelationsClicked() { …
Tvd
  • 4,463
  • 18
  • 79
  • 125
4
votes
3 answers

Make a JCheckBox in a JTable editable

I need some help with my JTable. I am writing a program, wich extracts data from a database into a JTable. The first column should be a editable JCheckBox so I am able to work with the checked (true or false) rows and the data. I am using a…
Gerret
  • 2,948
  • 4
  • 18
  • 28
4
votes
2 answers

Using custom TableModel make isCellEditable true for a particular row on button click

I have a table like above. Initially all the cells except button column are not editable. I have created the table using custom TableModel. My isCellEditable in custom TableModel looks like this: public boolean isCellEditable(int rowIndex, int…
Amarnath
  • 8,736
  • 10
  • 54
  • 81
4
votes
1 answer

Error in getRowCount() on DefaultTableModel

EDIT I've tried changing the table model back to DefaultTableModel but I am getting an Exception when compiling my code and I can't figure out why! Here's my table init: jTable1.setModel(new Table1Model()); jTable1.setDefaultRenderer(Color.class,new…
3
votes
1 answer

Java: how to make fireTableStructureChanged change an AbstractTableModel?

I have made a custom AbstractTableModel. The constructor initialises the model with data from a file. However, I wish to add an extra column to the model (this is because of SQL limitations in its columns). I seek to achieve this by adding to the…
Arvanem
  • 1,043
  • 12
  • 22
3
votes
1 answer

AbstractTableModel tutorial

I am working on a project that needs to show some data on a jtable. I found many tutorials about jtables but few on how to customise a AbstractTableModel, the most parts are ready code. Even in Oracle's page I found this general jtable tutorial, but…
Vagelism
  • 601
  • 1
  • 16
  • 27
3
votes
1 answer

How to notify a TableCellEditor that a table row is deleted?

I try to implement a TableCellEditor that conains some fields and a delete-button. It works good, but whe the row is deleted, the content in the deleted cell (rendered with TableCellEditor) is not updated. I have tried to call both…
Jonas
  • 121,568
  • 97
  • 310
  • 388
3
votes
2 answers

Swing : Single AbstractTableModel for multiple objects ??

I have different objects which is used to store the data from DB in an ArrayList. I got to show records of each in a Table. I use an AbstractTableModel for first object am working on. The AbstractTableModel class has an ArrayList and an…
Tvd
  • 4,463
  • 18
  • 79
  • 125
1
2 3
19 20