Questions tagged [abstracttablemodel]

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

294 questions
0
votes
1 answer

Not able to get the correct row from a JTable after Sorting it (Swing)

I got an AbstractTableModel, like this: public class TableModelClienteFornecedor extends AbstractTableModel { private List linhas; private String[] colunas = new String[]{"Nome", "Conta"}; public…
Rafael Paz
  • 497
  • 7
  • 22
0
votes
2 answers

display in JTable part of a collection

I have created a JTable using AbstractTableModel in which I added a collection of objects (ArrayList). I want to be able to search through the objects and return in the same JTable only the ones that meet a conditions (for example the names starts…
bluesony
  • 459
  • 1
  • 5
  • 28
0
votes
1 answer

Importing XML elements into a JTable from an Action Performed Event

There appears to be numerous examples and tutorials where the contents of a JTable are populated when initially creating the table but I'm struggling to understand how to populate the table from an Action event. Courtesy of source code derived from…
newToJava
  • 173
  • 1
  • 15
0
votes
0 answers

Trouble Updating AbstractTableModel from another Class

I'm trying to update a JTable that pulls in data from an ArrayList. I have two frames in my program. The first frame is a JTable (AbstractTableModel) that displays the contents of the ArrayList. I click the "New" button on that frame to bring up…
0
votes
1 answer

NullPointer in AbstractTableModel

I am trying to substitute the null value of VCID and VCIDBACKUP for "Dont Have". Here is my code: if (controladorExcel == false) { WritableWorkbook workbookVazio = Workbook.createWorkbook(file); WritableSheet sheet1 =…
Murilo
  • 4,453
  • 5
  • 19
  • 28
0
votes
2 answers

setCellRenderer() not working

I am trying to set a Renderer for a specific Column, but somehow this renderer is not being used for rendering that column. Is there any explanation for that? tabledata = new LendDataTable(); table.setModel(tabledata); TableColumn xx =…
joz
  • 652
  • 2
  • 8
  • 19
0
votes
0 answers

How to add row MyTableModel created AbstractTableModel from JavaDerby

I have datas in JavaDerby database.I can not add row my table model which is created by AbstractTableModel.What is wrong. MyTableModel class public class MyTableModel extends AbstractTableModel{ private Vector str; .....other codes...... public…
Alify
  • 59
  • 1
  • 7
0
votes
1 answer

Change data in a specific JTable cell

I use a AbstractTableModel for my JTable. public class MyTableModel extends AbstractTableModel { private List columnNames = new ArrayList(); private List data = new ArrayList(); MyTableModel() { …
bluevoxel
  • 4,978
  • 11
  • 45
  • 63
0
votes
2 answers

Generic way to give a table model a list of objects

Is there a way to make a generic table model that take a list of object and present them in the jtable. i can make a transfer object that has an array of strings define table column and a list of object then use reflection on the object to get the…
Mohammed Falha
  • 967
  • 8
  • 22
0
votes
1 answer

Show different image for each row in JTable

I'm building an application to manage a store's product for my project. I'm facing a problem and I really need your idea to solve it. I successfully show image in product basic info table at the main screen using DefaultTableCellRenderer. But I can…
0
votes
0 answers

AbstractTableModel: from cell to column and row header

I have a table that extends AbstractTableModel, I have implemented a method to return the number of column and row of a double-clicked cell (in this way I can individuate univocally the cell in question). I would like to have the column and the row…
Bernheart
  • 607
  • 1
  • 8
  • 17
0
votes
2 answers

An exception occurred when I tried to add more columns

I'm making a GUI project, using MVC design pattern. This program contains JTable component, for which I've created a class MyTableModel which extends AbstractTableModel. As you can see below in MyModelClass, I have two methods addColumn &…
0
votes
1 answer

Having trouble with JTable and JModel

This is my ClanModel class. The table is based on a tree map. public class ClanModel extends AbstractTableModel{ private Map clanMembers; private final String[] columnNames = {"Name", "Rank"}; ClanModel(Map
0
votes
5 answers

Java Boolean into Object[][]

I got following code and there is this error (I tried to keep the code as short as possible, ignore the getColumnCount etc. functions just the constructor): The following code is used to make a JTable in Swing by an SQLite statement, I need the…
faebuk
  • 51
  • 2
  • 8
0
votes
1 answer

How enable/disable calling tableChanged(TableModelEvent e) method of AbstractTableModel

The method tableChanged(TableModelEvent e) of TableModelListener is getting called whenever data is loaded into table from a CSV file. I don't want this to happen. I want tableChanged(TableModelEvent e) of TableModelListener to be called only when…
merlachandra
  • 376
  • 2
  • 17