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

How to set width column AbstractTableModel

Need help how to set width column in AbstractTableModel?? i am set autoRsizeMode=Off in my table properties and i am trying like this tablePriceList.getColumn(0).setWidth(400);this code working fine when i am using DefaultTableModel but it does'nt…
1
vote
1 answer

The data in JTable doesn't change

I tried so far too much and was reading lots of things. Still couldn't find any working solution on my case. So, here is the deal. During the game, players money are changing. What I am trying to achieve is to display money instantly from the…
Kutay Demireren
  • 640
  • 1
  • 10
  • 25
1
vote
2 answers

JTable ComboBox

For some reason this was removed. This question is CLOSED and i won't be reading it as i have moved onwards and implemented more methods working. So no need putting snarky comments here, i won't read them. Ok, so this might be quite the simple…
1
vote
2 answers

AbstractTableModel inheritance set column header text?

I have MyTableModel class extent AbstractTableModel, How can I add the columns name and set the columns header text in the MyTableModel class itself, so I don't have to set theme everytime the model is used?
Andiana
  • 1,912
  • 5
  • 37
  • 73
1
vote
1 answer

Set JTable not editable

I want to make my table uneditable. I tried this but it doesn't work : public MyModel model = new MyModel(); // Here i am declaring my model import javax.swing.table.AbstractTableModel; // the other class for the model public class MyModel…
Ann
  • 377
  • 5
  • 16
1
vote
0 answers

Can't seem to understand where(how) to add the tableModel listener

Good day! I've been trying to solve this riddle with the tableModel listener, but can't seem to understand how it works and where to add addTableModelListener and fireTableChanged so that my code starts to listen to table data changes in the…
Deniss M.
  • 3,617
  • 17
  • 52
  • 100
1
vote
1 answer

Java Custom AbstractTableModel doesn't update values on JTable till Window/JTable resize

So i have my AbstractTableModel: public class ClientTableModel extends AbstractTableModel { private String[] columns = new String [] { "UserNames", "Passwords" }; @Override public int getRowCount() { return…
Hugh Macdonald
  • 143
  • 1
  • 12
1
vote
1 answer

AbstractTabelModel won't show the JTable column names

For some reason my JTable is not displaying it's column names?! I'm certain I've done everything correctly. I've literally copied this from a demonstration so I don't understand why it won't work. Here is my code: public class MemTableModel extends…
James111
  • 15,378
  • 15
  • 78
  • 121
1
vote
1 answer

Custom TableModel and render for JTable wont display anything

I have a list of activities where i want the content to be shown. "name, isdone, sdate, endate, description" i have been reading, but nothing of why my table wont even…
Zeplinn
  • 13
  • 2
1
vote
0 answers

Method getRowCount() return error when tring to sort Jtable

I'm novice in java swing and please help me with this. I have a simple app that receives data from 2 JTextfileds (name and occupation) and introduce them in a JTable after a button is pressed. The data are stored in a List where…
1
vote
2 answers

JTable Cell Isn't Updated On Enter Click

I have an app that has a JTable of some data.. So I add the data and it appears well.. But when I try to edit a cell, I can edit it but when I click enter or tab to save the new content it reflects as it was earlier.. I don't know why that happens..…
Muhammad Ashraf
  • 1,252
  • 1
  • 14
  • 32
1
vote
1 answer

Removing a row from a JTable using AbstractTableModel

I have a JTable. This table is using a custom model that I designed; the custom model is extends AbstractTableModel. I have a button which enables a user to delete a selected/highlighted row. I have tried this code but its giving me a class cast…
CN1002
  • 1,115
  • 3
  • 20
  • 40
1
vote
2 answers

Creating a JTable from AbstractTableModel in NetBeans

I have this library that extends AbstractTableModel that I have to use to create a JTable in Netbeans: package flickr; import java.sql.ResultSet; import java.sql.SQLException; import javax.swing.table.AbstractTableModel; /** * Modello di JTable…
Ozeta
  • 321
  • 4
  • 18
1
vote
1 answer

JTable Actionlistener on click an row with parameter

I have a table created over AbstractTableModel. In this table I have a rows. And I need add ActionListener with parameter from column "ID from database" - viz. Image. This ActionListener should call when you double click the row. Image So my…
1
vote
1 answer

AbstractTableModel Help in name Columns sql

I have a subclass of AbstractTableModel and a JFrame to display the data from my table, ran over and the only error that appears instead of the column names appear A, B, C What am I doing wrong? Here are my classes package Biblioteca; import…