404 questions
1 vote
1 answer
93 views
JTable custom CellRenderer: Display Cell in color depending on another property of current item
I have a class Person, with an attribute boolean isDead. I want to display a list or Persons in a JTable. Each row in the JTable represents one Person. I want to display the Person's name in a ...
2 votes
0 answers
46 views
Java custom JTable handling multiple TableModels
Have a custom JTable class that implements dynamic tooltips that only appear when the ellipsis is shown for any value. Using that TooltipsTable class for several different TableModels. Question: Is ...
0 votes
0 answers
30 views
Adding data to a JTable from a database
I've created a class 'ProductTable' which is extends to JTable. The purpose of the class is to load data from a database and add all the data to the table when it is instantiating. Below is what I ...
0 votes
1 answer
54 views
How can I manage columns of varying data types in my JTable data model?
Here is sample code I found. It works because the entire data structure is initialized in one statement. Object[][] data = { {"Buy", "IBM", new Integer(...
0 votes
0 answers
452 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
1 answer
45 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: ...
1 vote
0 answers
85 views
Displaying a LinkedHashMap in a JTable
I have an Order object which among other things stores a LinkedHashList (Product : amount). I use a LinkedHashList because I specifically want to keep the insertion order. public class Order { ...
1 vote
1 answer
163 views
How to create a scatterplot GUI linked to change in a tablemodel(dataframe)
I have a GUI, which consist of a Qtableview and dataframe scatter plot widget. Plot draws the X, Y value from the table and has colormap with Z value. Here's the point. When I modify Y value in ...
0 votes
1 answer
49 views
Turning ArrayList of Rows into a JTable
I decided it would be easiest to store my data in a custom Row object based on this post Java data structure to store tabular data But Im wondering how I actually go onto then create a JTable with ...
0 votes
1 answer
416 views
How to use Class construct a TableModel in Java
I want use a class to construct a TableModel. I know how to use method return a TableModel. But I wonder how to use class to construct a TableModel. So far I failed. The dataset did not get all the ...
1 vote
0 answers
223 views
Update changes In JTable to database?
It's not working. Using the select syntax put table to JTable. Then I want update the changes in JTable to the Database. It's a reasonable idea, if there is an better idea to Update GUI changes to ...
0 votes
0 answers
70 views
JTable isn't updating when adding to Arraylist?
Ok so I currently have a array list constructed as static List<List<String>> lines = new ArrayList<>(); with values like this {["ID", "Last Name", "...
0 votes
1 answer
212 views
JTable when searched - not getting right ID
So I'm trying to after searching a name click on the table and then edit it in other table, the problem is that I'm not getting the right ID but instead only getting the ID that is the first. JTable ...
0 votes
1 answer
137 views
JTable column stops working after a certain column number
I am under the impression that after column 4 [index 3] the rest of my jtable does react to formatting or data validation. As you can see in this image the colour just stops after column 4: ...
0 votes
1 answer
355 views
Java Swing's TableModel getValueAt responsibility
What responsibilities fall with Java Swing's TableModel... Who should present the formatted display to the user? Is there any official guidance? JavaDocs The help for getValueAt states: Returns the ...