By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,313 Members | 1,113 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,313 IT Pros & Developers. It's quick & easy.

java swings problem

P: 1
hi i am developing a gui in java swings and i am getting my database displayed in jtable...
i have a textfield labeled CUSTID and my table also has its sec column as CUSTID (which is not a primary key)............i want that when i write a value in that textfield then, only those rows with that value of custid gets displayed in my jatable in my gui...
plz can anyone help me??
Jul 10 '08 #1
Share this Question
Share on Google+
1 Reply

Expert 10K+
P: 11,448
So if there is no text in your JTextField you'd have to use a sql statement like this:
"select * from yourtable", otherwise use a PreparedStatement like this one:
"select * from yourtable where CUSTID = ?" and fill in the ? parameter with the
value from obtained your JTextField. An ActionListener registered to that field
should start the job.

kind regards,


ps. btw, the name is 'Swing' not 'swings'
Jul 10 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.