Hello the Community,
I try to display the result of a resultset in a JPanel but it does work.
In a textArea it works. But the problem is you can write in it.
Thank you for your advice.
Habiler
[CODE]
private void intEmployeeNbrFocusLost(java.awt.event.FocusEvent evt) {
searchPerson();
// TODO add your handling code here:
System.out.println("TextArea -1:" + EmployeeNbr);
try {
Class.forName("net.ucanaccess.jdbc.UcanaccessDrive r");
} catch (ClassNotFoundException ex) {
Logger.getLogger(Ecran.class.getName()).log(Level. SEVERE, null, ex);
}
try {
// establishing connection
conn = DriverManager.getConnection("jdbc:ucanaccess://c:/Users\\hab\\Desktop\\Decisions1.accdb","","");
} catch (SQLException ex) {
Logger.getLogger(Ecran.class.getName()).log(Level. SEVERE, null, ex);
}
//JLabel lblFname, lblLname, lblPhoneNumber;
PreparedStatement ps;
int EmployeeNbr = Integer.parseInt(intEmployeeNbr.getText());
try {
System.out.println("TextArea 1:" + EmployeeNbr);
String SQL = "SELECT * FROM Decisions where EmployeeNbr = ?";
ps = conn.prepareStatement(SQL);
ps.setInt(1 , EmployeeNbr);
ResultSet rs2 = ps.executeQuery();
System.out.println("TextArea 2:" + EmployeeNbr);
while ( rs2.next()) {
// String newValue = Double.toString(Math.floor(EmployeeNbr));
int newDecNumber = (int)Math.floor(DecNumber);
int newEmployeeNbr = (int)Math.floor(EmployeeNbr);
int newPourcent = (int)Math.floor(Pourcent);
long nelleValEmployeeNbr = new Double(newEmployeeNbr).longValue();
long nelleValDecNumber = new Double(newDecNumber).longValue();
long nelleValPourcent = new Double(newPourcent).longValue();
System.out.println("NewValue:" + nelleValEmployeeNbr);
String ListeSQL = (rs2.getString(1) + " " +nelleValEmployeeNbr + " " + nelleValDecNumber+ " "+ nelleValPourcent+"\n");
jTextArea1.append(ListeSQL);
jTextArea1.append(rs2.getString(1));
System.out.println("panel:" + ListeSQL);
}
ps.close();
}catch(SQLException e){
JOptionPane.showMessageDialog(null, e);
}