aspose file tools*
The moose likes JDBC 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
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30506
    
150

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.


[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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Display data from database into JComboBox