File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes any idea about JComboBox Modal? with JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "any idea about JComboBox Modal? with JDBC" Watch "any idea about JComboBox Modal? with JDBC" New topic
Author

any idea about JComboBox Modal? with JDBC

Farhad Rahmati
Ranch Hand

Joined: Dec 16, 2010
Posts: 96
hi guys

I am using JDBC to connect to database and it's relational database which tables are related.

I have used combo box, list box and JTable

but I have a problem with combo box.

how do you retrieve and store data in a related table. I mean if you have primary key and foriegn keys with Dialog box.

I used modals and each combo box has modal.

but when you enter data, i tried to send the combo box index in to database . which is a stupid idea, and it's not working properly

I am looking for a method which modal shoul have it to retrieve data and send data.

thanks in advance
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2182
    
    7
Not sure if I understand the question but here is a solution that allows you to store an Object in the combo box model. It will contain a String value which is visible in the combo box and and "int" value which can be used as the key to access data in the database:

Farhad Rahmati
Ranch Hand

Joined: Dec 16, 2010
Posts: 96
Thank you very much Rob

I think that is what I need

I just went through your code and I understand it. I will try it today and I'll let you know,

thank you very much
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: any idea about JComboBox Modal? with JDBC