Originally posted by Kristof Camelbeke:
I need some help to update a Jtextfield.
when the value in the Jlist changes I want a change in the Jtextfield. Here is some code :
// this updates the Jlist (which is read from a MS-Access Database)
public void veldenListUpdate(){
DefaultListModel m = ((DefaultListModel) VeldenList.getModel());
m.removeAllElements();
try{
// create a statement handlez
Statement sqlStatement = databaseConnection.createStatement();
// create a sql-string
String sql = "SELECT * FROM VELD";
ResultSet results = sqlStatement.executeQuery(sql);
while (results.next()){
m.addElement(results.getString(1));