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 {
	
	

	JTextArea Newwordstext;
	
	JLabel lable;
	
	

	Newwordsbook ()
	{
		super("ʱ");
		setSize(670,400);
		setVisible(true);
		setLocationRelativeTo(null);           //ʱĻʾ
		getContentPane().add(new JScrollPane(Newwordstext));
		
	
		
		Newwordstext=new JTextArea(8,15);
		Newwordstext.setEditable(false);
		Newwordstext.setFont(new Font("",28,28));
      
     JPanel p1=new JPanel();
     JPanel p2=new JPanel();
     lable=new JLabel("£");
    
     
     lable.setFont(new Font("",20,20));
     p1.add(lable);
    
    setResizable(false);      //ʹ󻯲
     getContentPane().add(p1,"North");
     getContentPane().add(p2,"South");
   getContentPane().add(new JScrollPane(Newwordstext),"Center");
   
		
	}

	public void Addnewwords()throws SQLException
	{

		String cname,ename;
	try{
		Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
	   }
		catch(ClassNotFoundException e)
		{
		System.out.println(e.getMessage());
		}
		String conURL ="jdbc:odbc:TSDIC";
		Connection con=DriverManager.getConnection(conURL);
		Statement st=con.createStatement();
			ResultSet re=st.executeQuery("select * from Addnewwords");
		
		while(re.next())
		{
			
			ename=re.getString("");
			cname=re.getString("");
			
			
			 Newwordstext.append(ename+"   "+cname+'\n');
			
		}
		
	}

}
