• 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
Marshal
Posts: 34656
366
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic