aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Problem whit entering data at table. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem whit entering data at table." Watch "Problem whit entering data at table." New topic
Author

Problem whit entering data at table.

Boba Jeff
Greenhorn

Joined: Jul 05, 2011
Posts: 12
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

Joined: Oct 27, 2005
Posts: 19790
    
  20

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);.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Boba Jeff
Greenhorn

Joined: Jul 05, 2011
Posts: 12
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.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem whit entering data at table.