Questions tagged [jtable]
JTable is a Java Swing component used to display and edit regular two-dimensional tables of cells.
8,487
questions
-1
votes
0
answers
20
views
Java jtable cell change color if condition [duplicate]
i need help please im newbie
enter image description here
enter image description here
Output
enter image description here
enter image description here
-1
votes
1
answer
29
views
JTable vertical size based on rows
I'm insert the JTable database and getting the print.
In some cases it can fill up to 5 lines and in some cases 100 lines. When there are many lines, print does not appear.
My goal is to increase the ...
-1
votes
1
answer
36
views
How to individually set the width of a row on a table/scrollpane
i have a DefaultTableModel:
DefaultTableModel model = new DefaultTableModel(data, beschriftung)
{
// Returning the Class of each column will allow different
// ...
-1
votes
0
answers
30
views
How to fill my Object with something in an ArrayList [closed]
I need help.
I have a Object, it’s as big as my ArrayList:
Object[][] = new Object [ArrayList.size()] [ArrayList.size()]
Inside the first [] of the Object should be an Icon. The number for the Icon ...
1
vote
1
answer
43
views
How to decrement the quantity in a specific row while clicking
I have a problem in my code while clicking the selected row the quantity reset to 1
I want to decrement it by 1 and also when the quantity hits the minimum value the selected row will be removed.
BTW ...
0
votes
0
answers
46
views
MongoDB data: how to display in a JTable
i am beginner of Java MongoDB i want to display my data in to mongodb.i checked th console data loaded successfullly how to pass the mongodb database data into to jtable.what i tried so far i attached ...
0
votes
0
answers
37
views
JTable JCombobox not deselecting
If I have a JComboBox within a JTable then it all works great except if you click on the combobox to trigger it's dropdown to appear and then either click on the same location on the combobox again or ...
0
votes
1
answer
47
views
Java FlatLaf - NullPointerException when serializing TableModel on another Thread while UI is visible
A NullPointerException is thrown when trying to serialize a TableModel object while the associated JTable object is visible in a JFrame. I created a minimal, reproducible Example and will also include ...
0
votes
0
answers
24
views
How to add row instantly in Jtable while receiving data from socket in JAVA? [duplicate]
I have tried to create a program that can view real-time data on jtable from the socket. Program run properly and received data from socket and can be printed on the output terminal. But apending (add ...
-2
votes
2
answers
33
views
Jtable data retrieval problem in swing java [duplicate]
I want to retrieve data in jtable from MySQL database everything is right but the data present at index 1 are not shown plz loo image 1 and 2.
jtable img 1:
MySQL table img2:
public void ...
0
votes
0
answers
31
views
Java NullPointerException on serialization of TableModel when associated JTable is on visible JFrame
A NullPointerException is thrown when trying to serialize a TableModel object while the associated JTable object is visible in a JFrame. I created a minimal, reproducible Example and will also include ...
0
votes
0
answers
22
views
how to create JTables with POJOs with a composite key with a single table model
I'm trying to implement the use of reflection and annotations, just like the solution suggested by ardayigit on how to create a JTable with POJOs with a single table model, but the problem comes with ...
-1
votes
1
answer
31
views
Is it possible to move a part of a row of a JTable?
I want to move down a row of a table one position down except for one column. My table is something like this:
1 | a | aa
2 | b | bb
3 | c | cc
And I want it to be like this:
1 | b | bb
2 | a | ...
-1
votes
0
answers
19
views
Setting Jtable and other labels in Jframe [duplicate]
I'm encountering an issue while trying to make a JFrame of a Jtable with rows and cells according to the Imported file and some labels. every time I try to make it the JTable takes the whole window or ...
-1
votes
0
answers
23
views
Problem: JTable populated with duplicate data per row
I've been testing various ways of populating a JTable with data from an array, arraylist/list to a two-dimensional array of type Object (Object[][]), and with every attempt, I end up with duplicate ...
1
vote
1
answer
18
views
Refreshing Jtable which get's it's data from an ArrayList
What I'm trying to do is to get some data from an ArrayList, which contains data like GroupName, Name, Time, URL, and Memo, sort it using the insert() class, which basically sorts up the data by group,...
-1
votes
0
answers
26
views
I have to use a single column of a jtable to fill an array of strings, how can I do it? with java
I've spent a couple of days trying it, and not being an expert in this topic of arrays and jtables, I'm looking for some help here, this is the code I use to try to do what I asked, "model" ...
-1
votes
1
answer
31
views
Setting values to a cell using setValueAt seems to be not working
I am trying to make an attendance program in Java Swing and I try to count the number of Boolean values in every column of the first table as the number of days attended except for the 0 column index (...
-1
votes
1
answer
35
views
How to copy row cell values from a JTable and transfer to another JTable
I want to get the values from the row cells on my first table and transfer it to my second table in a button click, but I fail to make it happen. I tried using for loop to evenly assign each row ...
1
vote
1
answer
37
views
Can`t dynamic refresh JTable
First of all i'm new with Java. I make an Gui with 4 pannels (MainProgram).
image
In centerPanel is JTable which shows data from database.
In topPanel i put button that open new class / window - (...
0
votes
0
answers
34
views
Remove table separator in JTable
I want my table to have the same line width but every 4th rows, there is a thick line between two rows. For example between row number 4 and 5. How can I remove that? Also there is a thick vertical ...
0
votes
0
answers
29
views
Adding a column with type Boolean in button click
I am trying to make a program that whenever a button is clicked, it adds a column with a boolean type. I was guessing that calling the columnTypes variable inside the ActionEvent of the button that ...
0
votes
1
answer
24
views
Set the view to a specific cell
Do you know how to set the view to a specific cell in a JTable?
Because I'm working on searching for specific content in cells (Such Ctrl + F)
I have a specific cell such as row 39 and column 5, but I ...
2
votes
1
answer
16
views
Fill JTable with data from database
I need to create JTable with data loaded from database, but I am struggling with converting ArrayList to something, that supports table model.
I need to store data like this:
loadProducts();
...
0
votes
1
answer
26
views
Create a JTable using an ArrayList of "n" AbstractDrawablePoints
I have an ArrayList<AbstractDrawablePoint> nodePoints which changes dynamically/can have anywhere from 1 to n number of points within it.
I would like to have a JTable fill dynamically based on ...
0
votes
1
answer
33
views
JTable not showing any information. Reading from a text file and adding it to a DefaultTableModel
I am working on a Java Swing project and I am trying to understand how to use JTable.
I have a text file with a list of user information which is all separated by a comma without spaces. I am trying ...
0
votes
0
answers
19
views
AbstractTableModel isCellEditable method is not called
I am trying to edit a column with class type Product. But sometimes the isCellEditable() is not called. Sometimes it works as expected.
@Override
public boolean isCellEditable(int row, int column)
...
1
vote
1
answer
21
views
How do I make it so that the table is displayed inside the JFrame in Main?
I am currently making a program for my school project, it is a fast food order calculator, my problem is that I have to be able to display the table inside the JFrame in Main, if I add "frame.add(...
0
votes
2
answers
45
views
Multi dimensional array to JTable?
How do I get my multi dimensional array to output all results from User class to Email_GUI class so I can input it as my data for JTable? Currently, it only display one result. Should I create a ...
0
votes
0
answers
28
views
How to set a JTable column to accept only a specific data type?
I'm trying to create a simple grocery list GUI using JTable, before I go to the problem here is my code:
package com.main;
import java.awt.*;
import javax.swing.*;
import javax.swing.table....
0
votes
0
answers
28
views
regex filter show only empty string
I have made a java replica of excel's filter for jtables. It works fine, however, I can't get empty string filter to work with regexfilter, since adding "" to regexFilter would lead to show ...
-1
votes
1
answer
52
views
Cannot align in a cell the text on the left and Icon on the right
I am trying to achieve a very simple thing, I tried different options but none seems to work.
I have a simple JTable, in a column I use JLabel in order to show the text and the icon.
I just want to ...
0
votes
1
answer
28
views
Why are none of the titles showing in JTable?
I added some rows to a DefaultTableModel, but none of them was shown. My question is - what is the problem? It seems to me like Intellij idea just playing a joke on me.
public class Main extends ...
0
votes
2
answers
36
views
Make JTable cells in specific column scrollable
I'm creating GUI in java using swing. I use JTable that looks like this.
I need to make cells of last column("Popis") to be scrollable as there will be description so String containing this ...
2
votes
2
answers
74
views
When using TableCellRenderer to display a localdate in format dd.mm.yyyy my JTable search function does not work as expected
Basically the problem here is as follow, I have this TableCellRenderer:
public class CellRenderer_LocalDate extends DefaultTableCellRenderer implements TableCellRenderer {
private static final long ...
0
votes
1
answer
30
views
How to get the whole row of a JTable to save it into another table?
I am trying to validate that when the column step is equal to 2 the row is copied to another JTable.
But the jtable_step2 I have not initialized correctly,
that's why it returns the error:
...
0
votes
1
answer
40
views
Disable JTableHeader update after row sorting
I customized a Jtable headers with a TableCellRenderer so filter icon would appear, and as the user clicks on the filter icon, a pop-up filter like excel's appears (picture 1). However, if the user ...
2
votes
0
answers
54
views
How do I update a JTable that is an ArrayList?
I was testing an example code that lets people insert their names and the table will fill the name entered along with a seat number.
When the user presses the reserve seat button their name will be ...
1
vote
0
answers
26
views
Buttons from JTable borrow the text of the other columns
Every time I click on the task column, the buttons column have the same text as the task column. How could I make that the button keep the text and also very important my buttons are not clickable. ...
1
vote
0
answers
34
views
Search data for JTable using PLSQL stored procedure
I have a JFrame in which I have populated some data by stored procedure. Now I want to search the data through a JTextField. I used a RowSorter filter method but it didn't filter row in a proper ...
0
votes
0
answers
23
views
How to display multiple lines in a JTable Cell which is populated by query
I have a jTable in which data populate by sql query....jTable have 15 columns...I want if any of the column reach the end of cell it shift to the next line of the cell(means multiline or wrap the text)...
0
votes
0
answers
5
views
java jtable key bind hold X key with numbers (123) print 123 after key up?
i want to save the values that typed after holding (X) key in variable for later use
on jTable for example X + 379 when you up your finger over X + 379 the value 379 assigned to String variable String ...
0
votes
0
answers
30
views
How AbstractTableModel works?
I couldn't Get my head around how AbstractTableModel works,
it implements : getValueAt(),getColumnClass(),getColumnName(),etc..
what I didn't understand how JTable takes the data and meta data from ...
0
votes
1
answer
33
views
Java: row's index does not changes when sorted
when I sort the row, the indexes of the rows doesn't seems to change at all - thus resulting the old row which was initially in that position before making any sort.
here my code is
DefaultTableModel ...
0
votes
1
answer
30
views
Change JTabel header renderer with JCheckBox
enter image description here
Hi All, I'm trying to add a checkbox in Jtable header to select and deselect all, that is working fine except that the header renderer is different that the rest of the ...
0
votes
0
answers
33
views
How can I read a binary file and display it in JTable?
How can I read a binary file and display it in a JTable?
From the code that saves the file like this in Java:
private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {
int returnVal = ...
0
votes
2
answers
41
views
How to fill jtable with the right data from another table?
I have a JTable with 6 columns, the rows for the first 3 columns comes from table1(subject_records_bsit_first_year) and the last 3 will come from table2(evaluation_permission). The two database table ...
0
votes
0
answers
28
views
How can I remove the time next to Date in jtable using jdatechooser? my Datatype in my access is date/time
I'm new to programming. How can I remove the zero next to the date (2022-04-21 00:00:00.000000)?
here is my code:
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String date = sdf....
-1
votes
1
answer
61
views
Java ArrayList returning 0 value
I'm trying to build an application on java with swing that the user need to enter some product and store them in an arraylist and show the list of products on table (JTable) in another Jframe , the ...
0
votes
0
answers
15
views
How can I modify this code in order for it to show image in jTable from database? [duplicate]
As it says in the Title, I am wondering how can I show image (that's on MySQL server) inside of jTable in Java?
I've tried following, but unfortunately I am not getting wanted results. Here's what I'...