• Post Reply Bookmark Topic Watch Topic
  • New Topic

Display data from database into JComboBox

 
chiatai goh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 36032
432
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!