?? inputfield.java
字號:
import java.awt.*;
public class InputField extends TextField {
public char whatKey(int key) throws NotValidChar {
int last;
char smallest = ' ';
char largest = '~';
if ((key >= smallest) && (key <= largest)) {
this.setText(this.getText() + int2string(key) );
last = this.getText().length();
this.select(last, last);
return (char)key;
} else {
throw new NotValidChar();
}
}
static public String int2string(int i) {
StringBuffer s = new StringBuffer(1);
s.append( (char)(i) );
return s.toString();
}
}
class NotValidChar extends Exception {
NotValidChar() {
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -