Skip to content
Advertisement

Tag: jtable

JTable becomes blank after executing update on table? [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 2 years ago. Improve this question I am trying to write some software where when a user adds a

How to deal with “cannot be cast to class” error – GSON JAVA

i am trying to write my list to jtable in abstract model and then its return to me this error. In my opinion it could be cause by list format? name and amount are in wrong place. This is my full error message: Exception in thread “AWT-EventQueue-0” java.lang.ClassCastException: class com.google.gson.internal.LinkedTreeMap cannot be cast to class Model.Medicine (com.google.gson.internal.LinkedTreeMap and Model.Medicine are

How to resize JScrollPane rowHeader

The code bellow will generate this table: As the image indicates, in this table you can resize the column A, B, … But you cannot resize the column with the lowercase letters a,b,c,e… i.e., the rowHeader of the JScrollPane. Any Ideas how can I do that? Answer As @MadProgrammer has already suggested, a MouseMotionListener is probably the only way to

Java JTable getting the data of the selected row

Are there any methods that are used to get the data of the selected row? I just want to simply click a specific row with data on it and click a button that will print the data in the Console. Answer http://docs.oracle.com/javase/7/docs/api/javax/swing/JTable.html You will find these methods in it: Use a mix of these to achieve your result.

Advertisement