做Eclipse的RCP开发时,怎样实现用回车实现TAB的效果

2024-12-21 21:11:03
推荐回答(1个)
回答1:

faultButton(null);
textField.addKeyListener(new KeyListener() {

public void keyPressed(KeyEvent e) {
// TODO Auto-generated method stub
try {
if(e.keyCode == SWT.KEYPAD_CR) {
Robot robot = new Robot();
robot.keyPress(java.awt.event.KeyEvent.VK_TAB);
}
}catch(Exception ex) {
ex.printStackTrace();