shuoming_actionlistener.java

来自「字符识别程序」· Java 代码 · 共 53 行

JAVA
53
字号
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

	public class Shuoming_actionListener implements ActionListener {
		/**
		 * <p>Title: 字符识别程序</p>
		 *
		 * <p>Description: </p>
		 *
		 * <p>Copyright: Copyright (c) 2006</p>
		 *
		 * <p>Company: 04医学应用2班</p>
		 *
		 * @author 郭镇波
		 * @version 1.0
		 */
		private JFrame frame = null;
		public Shuoming_actionListener(JFrame frame)
		{
			this.frame = frame;
		}
		public void actionPerformed(ActionEvent e)
		{
		  final JDialog dialog = new JDialog(frame,"字符识别程序",true);
		  JPanel jp = new JPanel();
		
		  Container dialogPane = dialog.getContentPane();
		  dialogPane.add(new JLabel("相应字符代码",JLabel.CENTER),BorderLayout.NORTH);
		  dialogPane.add(new JLabel("'c'->字母  'n'->数字  'o'->特殊符号",JLabel.CENTER),BorderLayout.CENTER);
		  JButton jb = new JButton("确定");
		  jb.setSize(30,20);
		  jb.addActionListener(new ActionListener()
		  {
		  	public void actionPerformed(ActionEvent ex)
		  	{
		  		dialog.dispose();
		  	}
		  });
		  jp.add(jb,BorderLayout.CENTER);
		  dialogPane.add(jp,BorderLayout.SOUTH);
		  dialog.setBounds(370,280,250,120);
		  dialog.setResizable(false);
		  dialog.setVisible(true);
		}
	}

⌨️ 快捷键说明

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