java amateur
java amateur
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
java amateur
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.String cannot be cast to [Ljava.lang.Object;
at gui.TableModelActivo.getValueAt(TableModelActivo.java:56)
java amateur
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
java amateur
Rob Camick wrote:(...) so the problem is solved.
java amateur
java amateur
There is no need to create a custom TableModel. You can use the DefaultTableModel to hold the data.
a) forget about creating a custom model and use the DefaultTableModel to hold the data.
There is no need to use a custom model period. Don't reinvent the wheel unless you have a specific reason.
Rob Camick wrote: (...)
Have you even looked at the DefaultTableModel API yet? If so you would have noticed the following constructor:
So all you need to do is create some hard coded data in the Vectors, then create the DefaultTableModel using these Vectors and then create the JTable using the DefaultTableModel. Many times when problem solving the mind gets on a single track. Another benefit of a SSCCE is that it gets you thinking in another direction as its all about simplifying the problem. Now that you don't have to worry about the SQL the task is simpler, the code is simpler and the code can be posted as a SSCCE if problems are encountered.
java amateur
please take another look at my last post (which improves the previous one)
where i'm stuck is in creating - i guess - the vector of vectors
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Camick wrote:(...)So I don't understand the problem with a Vector of Vectors.
No SSCCE, no more help.
java amateur
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Prime wrote:In your code you never attach the model to the table.
java amateur
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|