qq444716720的gravatar頭像
qq4447167202017-04-12 12:37:55

java swing繪制軟鍵盤

swing繪制的軟鍵盤

效果圖如下:

java swing繪制軟鍵盤

public class KeyboardTest extends JFrame {

	private static final long serialVersionUID = 1L;
	private JPanel contentPane;
	public static JTextField jTextField;
	private Keyboard keyboard;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					KeyboardTest frame = new KeyboardTest();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public KeyboardTest() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 1000, 500);
		contentPane = new JPanel();
		contentPane.setBorder(null);
		contentPane.setLayout(null);
		setContentPane(contentPane);
		
		jTextField = new JTextField();
		jTextField.setBounds(350, 50, 200, 30);
		
		keyboard = new Keyboard();
		keyboard.setBounds(100, 100, 555, 221);
		contentPane.add(keyboard);
		contentPane.add(jTextField);
	}

}

項目圖:
java swing繪制軟鍵盤


打賞

文件名:KeyboardTest.zip,文件大小:21.406K下載
頂部客服微信二維碼底部
>掃描二維碼關注最代碼為好友掃描二維碼關注最代碼為好友
2008大乐透走势图