import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.*;
import java.sql.*;
import javax.swing.*;
public class Newwordsbook extends JFrame implements ActionListener {
	JFrame topFrame;
	JDesktopPane desktop;
	FileDialog filesave;
	JTextField englishtext;
	JTextArea chinesetext;
	JButton b1,b2,b3,b4,b5;
	JLabel lable;
	JMenuBar mbar;
	JMenu mfile, medit,mhelp,mexit;
	JMenuItem edic,cdic,openbook,quit,add,mode,delete,hhelp,about, exit;
	JRadioButton Rb1,Rb2;
	ButtonGroup bg;
	Newwordsbook ()
	{
		super("ʱ");
		setSize(670,400);
		setVisible(true);
		setLocationRelativeTo(null);           //ʱĻʾ
		getContentPane().add(new JScrollPane(chinesetext));
		
	
		mbar=new JMenuBar();
		setJMenuBar(mbar);
        mbar.setOpaque(true);
        mfile=new JMenu("ļ");    //˵
        medit=new JMenu("༭");
        mhelp=new JMenu("");
        mexit=new JMenu("˳");
        mbar.add(mfile);
        mbar.add(medit);
        mbar.add(mhelp);
        mbar.add(mexit);
      
        edic=new JMenuItem("Ӣʵ");    //ļ˵
        cdic=new JMenuItem("Ӣʵ");
        openbook=new JMenuItem("ʱ");
  
         quit=new JMenuItem("˳");
         add=new JMenuItem("Ӵʻ");   //༭˵
         mode=new JMenuItem("޸Ĵʻ");
       delete=new JMenuItem("ɾʻ");
       
       hhelp=new JMenuItem("");     //˵
       about=new JMenuItem("");
       exit=new JMenuItem("˳");
       
       mfile.add(edic);
       mfile.add(cdic);
       mfile.add(openbook);

       mfile.addSeparator();
       mfile.add(quit);
       medit.add(add);
       medit.add(mode);
       medit.add(delete);
       mhelp.add(hhelp);
       mhelp.add(about);
       mexit.add(exit);
       edic.addActionListener(this);
       cdic.addActionListener(this);
       openbook.addActionListener(this);       //ʱļ¼
       quit.addActionListener(this);
       add.addActionListener(this);
       mode.addActionListener(this);
       delete.addActionListener(this);
       hhelp.addActionListener(this);
       about.addActionListener(this);
       exit.addActionListener(this);
     
       englishtext=new JTextField(16);
       englishtext.setFont(new Font("",15,15));
       chinesetext=new JTextArea(8,15);
      chinesetext.setEditable(false);
       chinesetext.setFont(new Font("",28,28));
       b1=new JButton("ѯ");
       b2=new JButton("");
       b3=new JButton("޸");
       b4=new JButton("ɾ");
       b5=new JButton("ӵʱ");
     JPanel p1=new JPanel();
     JPanel p2=new JPanel();
     lable=new JLabel("ѯӢﵥʣ");
     Rb1=new JRadioButton("Ӣ뺺");             //ѡť
     Rb2=new JRadioButton("Ӣ");
     bg=new ButtonGroup();
     bg.add(Rb1);
     bg.add(Rb2);
     
     lable.setFont(new Font("",20,20));
     p1.add(lable);
     p1.add(englishtext);
     p1.add(b1);
     p1.add(Rb1);
     p1.add(Rb2);
     Rb1.setSelected(true);
     Rb1.addActionListener(this);
     Rb2.addActionListener(this);
     
     p2.add(b2);
     p2.add(b3);
     p2.add(b4);
     p2.add(b5);
    setResizable(false);      //ʹ󻯲
     getContentPane().add(p1,"North");
     getContentPane().add(p2,"South");
   getContentPane().add(new JScrollPane(chinesetext),"Center");
     b1.addActionListener(this);
     b2.addActionListener(this);
     b3.addActionListener(this);
     b4.addActionListener(this);
    b5.addActionListener(this);
     englishtext.addActionListener(this);
		
	}

	public void actionPerformed(ActionEvent arg0) {
		// TODO Auto-generated method stub
		
	}

}
