aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Dynamic Filling up Jtable for Database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Dynamic Filling up Jtable for Database" Watch "Dynamic Filling up Jtable for Database" New topic
Author

Dynamic Filling up Jtable for Database

Raj kalaria
Ranch Hand

Joined: Sep 08, 2005
Posts: 72
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

Joined: Oct 27, 2005
Posts: 19723
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1134

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

Joined: Jul 26, 2007
Posts: 10451
    
    8

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.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1134

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

Joined: Jul 26, 2007
Posts: 10451
    
    8

The part which I removed.
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1134

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

Joined: Jul 26, 2007
Posts: 10451
    
    8

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

Joined: Oct 11, 2000
Posts: 1134

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

Joined: Oct 27, 2005
Posts: 19723
    
  20

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.
 
jQuery in Action, 2nd edition
 
subject: Dynamic Filling up Jtable for Database