2
我有一个随机字符串发生器:移动值的JTextField
public class string{
private static final String dCase = "abcdefghij";
private static Random r = new Random();
private static String pass = "";
public static void main (String[] args) {
while (pass.length() != 1){
int rPick = r.nextInt(4);
if (rPick == 0){
int spot = r.nextInt(10);
pass += dCase.charAt(spot);
}
}
System.out.println (pass);
}
}
我怎么会得到一个什么样的位置印入我的JTextField的结果呢?
public void mouseClicked(MouseEvent arg0) {
string s = new string();
textField_tf1.setText(); //This is the bit I'm unsure on
}