Questions tagged [abstracttablemodel]

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

294 questions
0
votes
4 answers

How to override getValueAt for HashSet?

I need to extend AbstractTableModel to represent some data in a table. I have a class Car which should represent one item (row) in a table: public class Car implements Comparable { public String make; public int year; public double…
yabee-dabee
  • 106
  • 2
  • 5
0
votes
1 answer

How AbstractTableModel class exactly works in Java?

I have a swing application where I mainly have a Jtree and a JTable. when the app starts, the tree shows a list of values and the table only displays its column names.Once a node is selected from the tree, some data related to the selected node…
sher17
  • 607
  • 1
  • 12
  • 31
0
votes
0 answers

Does there exist a fix / best-practice approach for sorting JTables with dynamic model

I found the following question regarding sorting a JTable whichs model is not "static" but elements may be added to it, automatically updating the sort order. The accepted answer states: So, I changed fireTableCellUpdated(row,…
Markus Weninger
  • 11,931
  • 7
  • 64
  • 137
0
votes
1 answer

JTable object [][] data

I am trying to create a table based on my trial class. When I try to run my table class the table prints with the proper heading, but it does not print anything in the body of the table. How should I fix my for loop so the data enters the table? Do…
Maggie
  • 1
  • 2
0
votes
0 answers

Displaying data from a MySQL database in an AbstractTableModel

I'm struggling to find out how to add the data from my MySQL database to my Table Model (which extends AbstractTableModel) using Netbeans. At the moment I can retrieve the data and display it in the Netbeans output window, but I can't, for the life…
PBT
  • 21
  • 2
0
votes
1 answer

Issue with fireTableDataChanged()

I am almost finished creating a program in Java using Eclipse that uses a JTable. What I did was a made the JTable, associated it with a class that extends AbstractTableModel that I called ResultsTableModel, and made a method called refresh that…
0
votes
1 answer

Issues with JTable Row Selection

I am making use of a custom JTable and AbstractTableModel, but have encountered some interesting behavior when it comes to highlighting/selecting rows. Alright, upon startup my table looks like so, which is good: But unfortunately, selecting a row…
Hunter S
  • 1,293
  • 1
  • 15
  • 26
0
votes
0 answers

How to set the column class as "float " in java swing AbstractTableModel?

public class BuySideTableModel extends AbstractTableModel { private ArrayList m_orders; private String[] m_columnNames={"Order ID", "Quantity", "Price" }; public Class[] m_colTypes={ String.class,Integer.class, Float.class}; public…
Lasitha Konara
  • 1,111
  • 3
  • 12
  • 19
0
votes
1 answer

Selected row is not getting deleted; instead last row is getting deleted from JTable

I'm using the AbstractTableModel, and I'm trying to remove the selected row from the JTable. I'm able to select the specific row from the table; but when I click on delete button, the selected row becomes empty (i.e. all the data in the selected…
0
votes
1 answer

Java Resultset and AbstractTableModel to update JTable

I'm a beginner, I have JTable that I want to fill with a Resultset that should change everytime a user enters a Search keyword in a TextField and then click the Search Button. I searched for a week now and I still don't know how to use the…
Dwix
  • 1,139
  • 3
  • 20
  • 45
0
votes
0 answers

Issue rendering JTable with AbstractTableModel

I've been trying to display a JTable and have been getting strange artifacts. I have a class that extends AbstractTableModel. I'm not sure why I'm getting these artifacts. How do I get JTable to display correctly? Below is my TableModel public…
Reversial
  • 1
  • 1
0
votes
1 answer

Reusable AbstractTableModel

I am trying to create one AbstractTableModel instead of three. The application uses the MVC architecture so the controller would update the model. I am a bit confused on how to do the column names, creation of an empty list, and setValueAt method.…
Grim
  • 2,398
  • 4
  • 35
  • 54
0
votes
2 answers

Java AbstractTableModel Dynamically populating rows

I am trying to add rows dynamically in a table with AbstractTableModel. The rows are being added in a loop. When the second row gets added, the values of the first row show as null in table. The program is designed such a way that the rows values…
user2100513
  • 101
  • 8
0
votes
1 answer

Appropriate collection for model of JTable used for selection

What is best collection for storing data in JTable's model (extending AbstractTableModel) if table contains check box for selection in first column and object's attributes in other columns (so boolean attribute is not part of domain object in…
0
votes
1 answer

Hibernate, Dao Objects insert into JTable (AbstractTableModel)

I am trying to insert Entity Objects into a JTable. The Object i am receiving through hibernate querys are saved here. list = businessLayer.showAllUsers(); I am two problems. columnnames from Object insert objects into row What i basically have…
Boermt-die-Buse
  • 94
  • 1
  • 3
  • 12