我在做一个登录界面事情处理代码
public void actionPerformed(ActionEvent event){
if(event.getSource()==LoginButton){
try{
stat.setString(1,TitleText.getText());
stat.setString(2,UserPassword.getPassword());
pid=stat.executeQuery();

if(pid.next()){
//System.out.println("OK");
JOptionPane.showMessageDialog(Employee_Login,"登录成功");
}else{
//System.out.println("NO");
JOptionPane.showMessageDialog(Employee_Login,"登录失败");
}
}catch(Exception e){
System.out.println(e);
}
}
if(event.getSource()==ExitButton){
Employee_Login.dispose();
}
if(event.getSource()==ResetButton){
TitleText.setText("");
UserPassword.setText("");
}
}错误1
F:\学习\java\项目\Employee_Management.java:79: 无法将 java.sql.PreparedStatement 中的 setString(int,java.lang.String) 应用于 (int,char[])
stat.setString(2,UserPassword.getPassword());
                                    ^
1 错误
请大侠解决下啊  我不会这里谢谢