⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sendfocuseadapter.java

📁 一个简单的学生成绩管理系统.具有完备的学生信息管理模块,基本信息的全面设置
💻 JAVA
字号:
/*
 * SendFocuseAdapter.java
 *
 * Created on 2008年5月15日, 上午10:05
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package appstu.util;

import java.awt.event.KeyAdapter;
import javax.swing.JFormattedTextField;
import javax.swing.JTextField;
import javax.swing.JFrame;
import java.awt.event.KeyEvent;
import javax.swing.JComboBox;
public class SendFocuseAdapter extends KeyAdapter {
    private JFrame adaptee;
    private JTextField jTextField = null;
    private JComboBox jComboBox = null;
    public SendFocuseAdapter(JTextField ss) {
        this.jTextField = ss;
    }
    public SendFocuseAdapter(JComboBox ss) {
        this.jComboBox = ss;
    }

    public void keyPressed(KeyEvent e) {

   // System.out.println("我在匿名类中执行那");
    if (e.getKeyCode() == KeyEvent.VK_ENTER){
        if(jTextField instanceof JTextField){
            this.jTextField.requestFocus();
        }
        if (jComboBox instanceof JComboBox){
            this.jComboBox.requestFocus();
        }
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -