mcmahling
asked on
Adding a TableModel to an exisitng JTable at runtime
I am using NetBeans 6.1 for Mac to create a desktop application. I want to query a database and use an attached resultset to create a tablemodel that will be eventually used to fill a JTable that I created at runtime. I am new to java and can not find a way to attach a tablemodel to a jtable at runtime. Can anyone suggest some code?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
check this example to create your own table model and set to table,
https://java.sun.com/docs/books/tutorial/uiswing/components/table.html#data
https://java.sun.com/docs/books/tutorial/uiswing/components/table.html#data
Netbeans will build automagically the JTable connected to the database with buttons for adding, editing, removing, committing and rollbacking ;)