⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chinaquery.java

📁 是一个电子词典
💻 JAVA
字号:
import java.awt.event.*;
import com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable;

public class ChinaQuery implements ActionListener{
	
	JMenus jm;//将界面的对象引进来
	public static Hashtable hashb=new Hashtable();
	public ChinaQuery(JMenus ac){
		jm=ac;
	}
	public void actionPerformed(ActionEvent e) {
		/*input a chinese word ,
		if pressed the query butten will excute the method*/
		if(e.getSource()==jm.querybtn){// 如果触发的是查询事件
		 String text=(String)jm.inbox.getSelectedItem();//取得输入的中文单词
   		 if(text==null){//如果没有输入单词,则没有相应的查询操作	        			
   			jm.tf.setText("您没有输入要查询的单词");
   		  }
   		 else{
   			ConnectionClass ConClass=new ConnectionClass(jm);
   			String tran=(String)ConClass.hash.get(text);   			
   			jm.tf.setText(tran);   			
   			text="";
   		}//end else
   	 }//end if	 
	}//end actionPerformed
}//end ChinaQuery

⌨️ 快捷键说明

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