Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Some demo with JTable with Form

 
Jiri Nejedly
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I seek some swing example/demo, which would show me data from simple database table in JTable interconnected with editable form (preferably on the same panel). Form should browse rows by First/Prev/Next/Last buttons. Form or (and) JTable should be able to insert a new record and delete one.

I found many JTable examples, but I didn't found any with form.

Thanks in advance for any tips.
 
Maneesh Godbole
Saloon Keeper
Posts: 11091
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by Form?
 
Jiri Nejedly
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set of editable fields, which represent one database row (each db (JTable) column has its own field).
 
Maneesh Godbole
Saloon Keeper
Posts: 11091
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I still dont really understand what you mean by Form. From what I gathered of your requirement, what you require is
1) Paginated table
2) Data to be loaded from the DB
3) Currently displayed data should be editable
4) New data creation.

Is this correct?
 
Jiri Nejedly
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK Let's say so.
 
Maneesh Godbole
Saloon Keeper
Posts: 11091
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK Let's say so.

Huh? You can't say if the requirements I identified are correct or not?


 
Jiri Nejedly
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I finally found some picture , which shows what I need:



 
Maneesh Godbole
Saloon Keeper
Posts: 11091
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That helps clarify the requirement.
So what have you got so far and where are you stuck?
 
Jiri Nejedly
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am able to code all what I need. But I feel, that I dont't need to define every button's event etc... That I can save some time and work, that some basic behaviour can be generated automatically by few clicks in my development environment (JDeveloper).
Some years ago we did something similar with Struts/ADF. The difference was, that web application was made and table and form were separated on their own respecive pages.

So I seek some tutorial/demo/example which shows me, how to generate simple swing aplication from database table.
 
Hauke Ingmar Schmidt
Rancher
Posts: 436
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ADF/JDeveloper can be used with Swing: http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/ADF_Swing_Overview/SwingOverview.htm . The other GUI builders (Windowbuilder, Netbeans) do support bindings so the work is not that hard, you don't need to write event listeners by hand (at least for the edit fields) - in fact, I think with the customization needed nearly every time it easier to build this from scratch.

Asking for JTable is a little too low level in your case; JTable is only the base component for the table part. If you are searching, try "swing master detail view".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic