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
0
votes
0 answers

How to use model.addRow() to add rows after the JTable is already added?

public void initJTabPane() throws FileNotFoundException, IOException{ //JTable Bot Shit model = new DefaultTableModel() { @Override public boolean isCellEditable(int row, int column) { //Only the third…
0
votes
1 answer

java: dialog with 2 button for event "click on Jtable cell"?

I have a jtable with "data" in my java project: DefaultTableModel model=(DefaultTableModel)jTablePolicyView.getModel(); for(Policy policy : sngltn.GetPerPolicies(cstmr.getPer())) { model.addRow(new Object[]…
user3515151
  • 97
  • 2
  • 10
0
votes
0 answers

add new row to JTable from a Different class

I want to add data to a JTable which is situated on a JTabbedpane. Data which I want to insert in JTable is a user input data(TextField) from a different class named (addcontact). cntctus is the tab in which Jtable is situated. it contains a method…
puprog
  • 55
  • 2
  • 10
0
votes
0 answers

What is proper way to add/remove columns from JTable

I've been trying to find answer for this question for two hours already, but couldn't find working answer. I'm using NetBeans and JTable. I need to add or remove rows dynamically depending on value of JSpinner. This is NetBeans' uneditable…
Marko
  • 1,267
  • 1
  • 16
  • 25
0
votes
1 answer

Java event handling on DefaultTableModel when a cell is clicked

How can I perform a mouse event handling when clicking a cell on my DefaultTableModel for example when clicking the first column of a row it prints the whole row. static DefaultTableModel dTableModel = new DefaultTableModel(databaseInfo, columns){ …
kirowaxoaw
  • 29
  • 4
0
votes
1 answer

Refresh data in JTable when using a DefaultTableModel

I have a JFrame where I construct a JTable. The JTable is made in two steps: I make a function initTable() where I make my table I make another function initDataintoTable() which ads my data from an arraylist to my table. Everything works fine…
user3450862
  • 379
  • 1
  • 6
  • 22
0
votes
1 answer

JTable aren't refreshing when selecting from Combobox

The scrollPane table isn't refreshing for every time I selected something from the combo. Initially it has data but after I selected something, the data is removed successfully but new data isn't populating in public void ConsultFrame(String id,…
Leon
  • 446
  • 1
  • 5
  • 16
0
votes
2 answers

JTable - how to get deleted rows

I'm using JTable with DefaultTableModel as model and DefaultListModel as underlying data within the model itself - so JTable is displaying the data, which is stored in this List. In JTable I'm getting notification when elements are added/removed…
gurbi
  • 163
  • 2
  • 14
0
votes
0 answers

Data not showing in jtable using DefaultTableModel on adding as per below code

Data not showing in jTable using DefaultTableModel below the code is. here I create >object of DefaultTableModel and then set the value to the table model. Values are coming >as i printed them. DefaultTableModel…
0
votes
1 answer

How to get the data back of a JTable?

Question: I would like to get the information in the JTable back into an Array of String[][] 2-dimensional array when the save button is pressed. Actually I would like to update a new String[][] array every time a key is pressed but that will have…
Doug Hauf
  • 3,025
  • 8
  • 46
  • 70
0
votes
1 answer

JTable won't repaint/refresh on data insert into mysql

I'm not sure what I'm doing wrong but I get data from MySQL db and populate the JTable with DefaultTableModel. Then I show it on screen. After data is added from textboxes into the db, JTable wont refresh. I've checked the db and inserted data is…
Lord Zed
  • 750
  • 7
  • 28
0
votes
1 answer

jtable checkbox checked row remove from table when click button?

The below code is part of my button action.Jtable contain last row is checkbox. When i click save button the selected row must delete from table row...!!!' Action performed code @Override public void actionPerformed(ActionEvent e)…
jijesh Aj
  • 614
  • 4
  • 10
  • 25
0
votes
2 answers

how to set jcheckbox inside jtable dynamically

In this picture the return table head values show in the checkbox . here jtable the values from database I tried it but classcastexception occured because of boolean value cast to string i don't know why that error occured this is my code …
Prasanth A R
  • 4,046
  • 9
  • 48
  • 76
0
votes
0 answers

Reset row numbers after row sort?

I am attempting to sort the rows of columns in a table model. I set the 'setAutoCreateRowSorter()' method to true for the table model I am using. String[] columnNames = {"Name (1)"}; Object[][] data = {}; dbModel = new DefaultTableModel(data,…
BitWar
  • 43
  • 1
  • 2
  • 7
0
votes
1 answer

LWUIT Table's cells formatting

I have a LWUIT Table that contains a DefaultTableModel which itself contains some values written on it cells. I just want to change my table's cells formatting. In other words I want to set the direction of values in cells from Right to Left …
PHPFan
  • 756
  • 3
  • 12
  • 46