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 add JButton to a JTable using CustomTableModel

I am creating a Table using a CustomTableModel which extends AbstractTableModel. I am not able to add JButton to the column using this my custom model. If I do new JButton("One") to the model .. I am seeing text "javax.swing.JButton[,0 ....…
Amarnath
  • 8,736
  • 10
  • 54
  • 81
0
votes
2 answers

Button in Cell of JTable: Keep Caption constant while storing data in the cell

I am working on a JTable that has one column that contains a List>. This column should show a button to the user. When he clicks on the Button, something is to be done with the data of the cell. All that works really fine with the…
Skrodde
  • 41
  • 10
0
votes
1 answer

Refreshing JTable when data has changed

I have a problem with refreshing a JTable. I start with an empty ArrayList and after setting my choice of a combo box I load content to the ArrayList but JTable does not react to it - it remains empty. Is it a problem with a TableModel? This is my…
Swemack
  • 11
  • 3
0
votes
1 answer

Equivalent to AbstractTableModel in c#

As title says, is there equivalent to AbstractTableModel in c#, or is there another, better, solution for creating table model in c#?
user1033698
  • 89
  • 1
  • 7
0
votes
1 answer

Column names don't appear when using AbstractTableModel

Hy. I am trying to build a simple JTable using AbstractTableModel,but the column names don't appear even though I used a JScrollPane. public class TableModel extends AbstractTableModel{ private String[] columnNames = new…
Daniel S.
  • 151
  • 2
  • 8
0
votes
2 answers

Implementing AbstractTableModel to JTable. How to add the methods?

I used to display my database data in a JTable and it was working fine. I found out that I need to implement AbstractTableModel or DefaultTableModel to update the data instantly. I am not sure what I should write in getValueAt()? Where should I add…
Lily S
  • 245
  • 1
  • 8
  • 18
0
votes
1 answer

NullPointerException in custom TableModel

I wrote a custom table model for a JTable: class MessageTableModel{ private static Set messages = Collections.synchronizedSet(new TreeSet()); . . . public void setMessages(List newMessages) { …
elias
  • 15,010
  • 4
  • 40
  • 65
-1
votes
1 answer

Between JTable and TableModel

Now I get confused... JTable is a part of a swing API so it's handling with how we view the table stated with JTable table = new JTable(); However to do things with database it needs another class, either it's extended from AbstractTableModel or…
Levian
  • 11
  • 4
-1
votes
3 answers

Java Swing | extend AbstractTableModel and use it with JTable | several questions

I followed Oracle's model for implementing an AbstractTableModel http://download.oracle.com/javase/tutorial/uiswing/examples/components/TableDemoProject/src/components/TableDemo.java I did this because my table has to contain 3 columns, and the…
JavaHater
  • 45
  • 1
  • 4
  • 8
-1
votes
2 answers

Java Swing JTable NullPointerException

I have a simple Window with a table. But if I add more than 4 objects to my model, I get various NullPointerExceptions. Here's the model code: public class CarTableModel extends AbstractTableModel { public LinkedList cars=new…
small-j
  • 309
  • 1
  • 4
  • 12
-1
votes
1 answer

Removing and Adding Rows in a JTable using AbstractTableModel

I have a serious problem, removing rows from my JTable, my code is the same as what I saw when I tried to learn AbstractTableModel: import javax.swing.table.AbstractTableModel; public class MyTableModel extends AbstractTableModel { …
Marjan
  • 1
  • 2
-1
votes
1 answer

AbstractTableModel GUI display issue

I'm making a GUI Project for database there are two classes which are for GUI's. And connector class is used to connect from user credentials. If credentials are correct than it fetch all data in the from of AbstractTableModel. When program run…
hamel123
  • 304
  • 4
  • 18
-1
votes
1 answer

Unable to set a DefaultTableModel to a JTable contained in a JDialog

I have created a JDialog that contains a JTable, when I try to assign a DefaultTableModel to it, it gives me an exception and the JDialog does not even appear. java.lang.ArrayIndexOutOfBoundsException: 11. Code to assign the table…
-1
votes
1 answer

How To Display a ArrayList that Contains a another ArrayList In Jtable with A tableModel

I have An Object called Student and in this Object i have A arrayList of Object That Contains material(name,note) Public Class Student{ private String StudentFirstName; private String StudentLastName; private List materials; } public…
user3299124
  • 23
  • 2
  • 7
-1
votes
1 answer

Adding a row to Abstract JTable model

I am trying to add a row to my JTable, I am using an abstract method which is shown below. I am currently taking data from a List to setValueAt my JTable. Does anyone have any idea on how to add a row to this without changing the types of…
Fjondor
  • 39
  • 7
1 2 3
19
20