/*功能:统计一篇英文中每个单词出现的次数
*实现:用HashMap处理统计,用StringBuffer处理输出
*Date:2014-5-14 深夜
*Author:何龙
*QQ:471628912
*/
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import java.util.Iterator;
public class StringTokenPro extends JFrame implements ActionListener {
private static final long serialVersionUID = 1L;
private JLabel l1, l2;
private JPanel p1, p2;
private JTextArea input, output;
private JButton b1, b2;
private JScrollPane sc1, sc2;
private Map map;
public StringTokenPro() {
super("【何龙作品】 QQ:471628912");// 设置标题
this.setSize(600, 400); // 设置窗体大小
this.setLocation
统计一篇英文中每个单词出现的次数
最新推荐文章于 2023-04-11 09:52:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)