File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and Relational Databases and the fly likes Display data from database into JComboBox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Display data from database into JComboBox" Watch "Display data from database into JComboBox" New topic
Author

Display data from database into JComboBox

chiatai goh
Greenhorn

Joined: Mar 19, 2005
Posts: 3
Hi programmers!

How can i display the datas from database into JComboBox?
This are the codes for actionPerformed:

public void actionPerformed (ActionEvent e){

JButton clickedButton = (JButton) e.getSource();

if(clickedButton == retrieving)
retrievingClicked();

JComboBox typeList = (JComboBox)e.getSource();
String typeStrings = (String)typeList.getSelectedItem();
//updateLabel(typeStrings);
typeList.addItem(typeStrings);

}


What's the next step?
[ March 19, 2005: Message edited by: chiatai goh ]
[ March 19, 2005: Message edited by: chiatai goh ]
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31888
    
197

Chiatai,
Welcome to JavaRanch!

Take a look at Sun's JDBC tutorial for the basics of JDBC. Feel free to post in this thread when you have a more specific question.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
 
subject: Display data from database into JComboBox