Questions tagged [defaulttablemodel]

An implementation of the TableModel interface. Used (by default) by JTable to manage the data found in the table. Custom/alternative implementations of the TableModel interface may be provided.

370 questions
2
votes
1 answer

JTable populated but not shown. Using DefaultTableModel

I can't understand why my JTable does not update. Below is my code: package it.franpic.chat.client.prestazioni.view; import java.awt.BorderLayout; import java.awt.Color; import java.awt.EventQueue; import java.util.List; import…
2
votes
1 answer

Error when calling getColumnCount() from ResultSet metadata

I seem to be have a problem when trying to get the coulmn count from a resultset's metadata. THe error is Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: SQLite JDBC: inconsistent internal state. THe idea is to use this…
user3444341
  • 31
  • 1
  • 1
  • 3
2
votes
1 answer

Any way to connect JTable (TableModel) with H2 database

My current project is some kind of a database system that has a gui for maintenance. Before my major code rewrite, I used to serialize and de-serialize the TableModel to save and load data to the gui. Because this was not a good solution for obvious…
Flatron
  • 1,375
  • 2
  • 12
  • 33
2
votes
1 answer

Explicitly writing a Class for inserting Data into JTable Swing

In my Application i wrote a class which inserts data into JTable. App have two Entities 1: Category 2: Product For Category I have written this class . When i want to show data in JTable i call any method from this class according to…
2
votes
1 answer

Java TableModel duplicating rows - How do I stop this from happening?

So in application I've created a search for name page where the user will enter there the name and as the user types ( Every time a key is pressed) an SQL statement is ran that will get the records like 'name%'. This works fine but when it comes to…
James111
  • 15,378
  • 15
  • 78
  • 121
2
votes
1 answer

I want to update table when Button is clicked

I am newbie of Swing. I want to update table after click button (done button). I think data correct but the screen does not work. The followings are explanation of my program check checkBoxes and the click Done button the bottom layer should…
Ui-Gyun Jeong
  • 143
  • 1
  • 4
  • 14
2
votes
1 answer

JTable add File object, but only display File Name

I have a Java application which uses JTables to add files for browsing. It contains only 1 column: DefaultTableModel model = new DefaultTableModel(new String[] {"Name"}, 0); JTable tracks = new JTable(model){ public boolean…
tihomirbz
  • 95
  • 6
2
votes
2 answers

Java - Mouse event does not work in JTable

I am having trouble trying to make a click row event on my JTable work. I have added the event to my JTable, but when I run my program and click on the row, it does not show the message. Here is my code: import java.awt.*; import…
2
votes
2 answers

show an image when hover over a jtable cell

I have a JTable created with a DefaultTableModel, and I want to show an image when the mouse hovers over a particular cell of that JTable, and I need the image to be different for each cell. Thanks in advance
Simo03
  • 273
  • 3
  • 10
  • 21
2
votes
1 answer

delete not null record from Jtable

in this code i am getting data from data base that data represent in rows and column but i am not getting fifth column data from data base .i am entering that data through keyboard when i perform action on submit button at that time i want to…
fanky
  • 515
  • 4
  • 14
2
votes
2 answers

ResultSet.beforeFirst() gets ignored in Java

I would like to create DefaultTableModel from ResultSet. To do that, I need Object[][]. For that, I have to specify the size of the object before I iterate through the table: I go to the rs.last(), then rs.getRow(), then rs.beforeFirst(); After…
Ágota Horváth
  • 1,353
  • 3
  • 13
  • 20
2
votes
1 answer

Swing DefaultTableModel separated from GUI

I'm using ResultSets to create my DefaultTableModel, so I'm thinking that it might be good to avoid using ResultSets in the view, where the DefaultTableModel populates my JTables. I suspect my reasoning is wrong, guessing that Swing components…
user1128272
2
votes
2 answers

re-size JTable when useing Default table model

I have a JTable built using DefaultModel which is displayed in JPane but I would like to re-size the table to make it bigger. Could any one please explain how I could do that? I have tried the following code: TableColumnModel colsize =…
Sarah
  • 133
  • 1
  • 9
2
votes
3 answers

updating java table

I have a timer class updating my table but the only way I have found to affect a change is to use this code. It is essentially a break time application. I am using ini4j to read an ini file on the network. It does work but it's creating speed issues…
user1753429
  • 89
  • 1
  • 7
2
votes
2 answers

ArrayIndexOutOfBoundsException when adding row in jtable

this.tModel = new AdvancedMibTableModel(); this.table = new JTable(this.tModel); this.tModel.addRow(new Object[]{"sysLocation","1.3.6.1.2.1.1.6","0",""}); when running the above code the following exception…
Nikhil
  • 2,857
  • 9
  • 34
  • 58
1 2
3
24 25