private void addArea() {
ta = new TextArea();
ta.setFont(new Font("Courier New", Font.PLAIN, 15));
add(ta);
}
private void getMenuBar1() {
MenuBar menu = new MenuBar();
// 创建菜单,并添加到菜单栏
Menu m1 = new Menu("文件(F)");
Menu m2 = new Menu("编辑(E)");
Menu m3 = new Menu("查看(S)");
// 创建菜单项并给菜单上添加功能
mi1 = new MenuItem("打开");
mi2 = new MenuItem("保存");
mi3 = new MenuItem("退出");
mi4 = new MenuItem("GBK");
mi5 = new MenuItem("UTF-8");