Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem whit entering data at table.

 
Boba Jeff
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all, i am working some embedded CRUD database, and i have foloved two tutorials, one for searching at table and tha works very well.
Second is how to bind data from from to database, and there i have some problem. I am guessing that i dont see or understand something about it.

This is a tutorial for use search for table, and works great. http://weblogs.java.net/blog/pkeegan/archive/2008/06/using_beans_bin.html

And i have foloving this tutorial for new form, biding fileds for database. http://weblogs.java.net/blog/pkeegan/archive/2008/05/beans_binding_b.html

Anyway whole pages are merged into one tutorial http://netbeans.org/kb/67/java/gui-db-custom.html

Problem is when i press new button i got new row at table and window pops out and i enter a data and press save i dont get data at the table row.

This is a code from main fame for new action and added a code for opening the window, i think there is a problem



In tutorial is set (c) i have changed to be (z) for SetCurrnetRecords, changed aswell delcaration from z to c and leave in comment just in case of swaping and testing.



Now this is chunk of code for new window what will open when i press new button



Problem is when i press new button he make new row at database and then i need to press one more time to get window open, when i enter data and press save i dont get anything on the database.

I think that is problem at this 2 chunks of code, but i dont see it. I am still learning and geting my way at java.
 
Rob Spoor
Sheriff
Pie
Posts: 20529
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Boba Jeff wrote:

Is list the main source of your table model? If so, you need to fire an event that indicates a row was added. If your table model extends AbstractTableModel you can use fireTableRowsInserted(row, row);.
 
Boba Jeff
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:
Boba Jeff wrote:

Is list the main source of your table model? If so, you need to fire an event that indicates a row was added. If your table model extends AbstractTableModel you can use fireTableRowsInserted(row, row);.


Thanks for replay Rob, Oh wait a second. I forgot to say that i use netbeans so code is generated. I didint look at table model, untill now. Yea main sorce is list. like i say i was folowing that tuorial for the netbeans.

Anyway i got this on the mastertable as listiner.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic