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

Dynamic Filling up Jtable for Database

 
Raj kalaria
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am new to Jtable and experiencing a hard time to achieve following thing.

I have two pane One pane has the Search buttong and below it i have 2nd panel
which will hold the result.

I want to show the result in table ( due to my limited knowledge on swings, i can only think of showing in table as of now).
So i want to create the table at run time

I am trying following thing
1) i am trying with some hard code values but my table is not getting displayed in the panel
2) later i want to fill up my table with the rows fetch from Database

I am really struggling any help with code would be appreciated

 
Rob Spoor
Sheriff
Pie
Posts: 20605
60
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swing Is A Proper Noun. So please don't use swings anymore

Try repainting / revalidating the result panel after adding the scroll pane.


As for filling it with real data, use ResultSetMetaData. If you use the search you should be able to find the exact same problem in this forum, including some code that can help you out.
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob,
You said:

Swing Is A Proper Noun. So please don't use swings anymore

A commonly occurring phenomenon, particularly amongst non-native English speakers although not necessarily limited to them, is the adoption of incorrect language.
Take for example use of the word "hoover" instead of vacuum cleaner.
It appears to me that for some reason in India java developers have adopted using the term "swings" when referring to java "Swing".
[Edited by Maneesh Godbole]
I realize this post is not really on topic and I hope that readers will tolerate the digression.

Cheers,
Avi.

[Reason for edit: Remove possible offending statement]
[ November 04, 2008: Message edited by: Maneesh Godbole ]
 
Maneesh Godbole
Saloon Keeper
Posts: 11085
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Avi,

I can relate with you to a certain extent on the "Swings" issue.
However, your next statement was uncalled for.

Like you rightly quoted at the beginning of your post, having a non-English mother tongue has its own unique challenges. Everybody here at the ranch acknowledges and understands this issue.

So let us try and follow the "Be Nice" policy.
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh,
Here in Israel everyone who uses PuTTY pronounces it "poo-tee". It's just a fact of life.
Pardon my ignorance, but please explain what part of my post was "not nice", so I will know not to repeat it.

Thanks,
Avi.
 
Maneesh Godbole
Saloon Keeper
Posts: 11085
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The part which I removed.
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh,
I wonder how your actions would be interpreted in the reference of the USA's freedom of speech laws?

Cheers,
Avi.
 
Maneesh Godbole
Saloon Keeper
Posts: 11085
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you insist on continuing this, could you please start a new topic in this fourm?
After all the OP has a right to expect his thread to be related to his problem.
Thank you.
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh,
Point taken, but I believe that this forum is definitely the more appropriate one. In fact, I would say that your suggestion is quite condascending.

Cheers,
Avi.
 
Rob Spoor
Sheriff
Pie
Posts: 20605
60
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And that's the end of this discussion. Anything not related to the initial problem will be removed. If you want to keep the discussion alive, please go to one of the forums mentioned before or use PM.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic