welshspoon
Technical User
Hiya
I have a JPanel which adds a new JPanel to it when an item is selected from a JList.
The updated panels display data from an SQL table but this data can change as the user is able to select other records from a combo box which then update the relevant text fields. However, fields that you need to scroll down for do not update and i cant work out why?
For example i get the data from the combo which then gets the data from the table and then update the fields. Below is an example of how i do that.
Thanks in advance for any help
I have a JPanel which adds a new JPanel to it when an item is selected from a JList.
The updated panels display data from an SQL table but this data can change as the user is able to select other records from a combo box which then update the relevant text fields. However, fields that you need to scroll down for do not update and i cant work out why?
For example i get the data from the combo which then gets the data from the table and then update the fields. Below is an example of how i do that.
Code:
public void getQuestion4Details() {
try {
stmt5 = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE );
String Query5 = "SELECT * FROM QuestionBank WHERE QuestionID = ?";
QueryStmt5 = con.prepareStatement(Query5);
QueryStmt5.setString(1,Question4);
rs5 = QueryStmt5.executeQuery();
String test3 = QueryStmt5.toString();
while (rs5.next()) {
String Q4 = rs5.getString(3);
String Q4A = rs5.getString(4);
String Q4B = rs5.getString(5);
String Q4C = rs5.getString(6);
String Q4D = rs5.getString(7);
QuestionFourLabelBox.setText(Q4);
QuestionFourABox.setText(Q4A);
QuestionFourBBox.setText(Q4B);
QuestionFourCBox.setText(Q4C);
QuestionFourDBox.setText(Q4D);
pPane.validate();
pPane.repaint();
}
} // end try
catch (java.lang.Exception ex) {
ex.printStackTrace();
}
}
Thanks in advance for any help