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

📄 dictionary.java

📁 利用开源词典star-dict编写的一个小词典程序,使用方法仿照金山词霸
💻 JAVA
字号:
/**
 * Java小作业--词典
 *
 * @张天明-041221120 
 * @version 1.00 07/04/19
 */

 
public class Dictionary {
    
    public static void main(String[] args) throws Exception {
        // Create application frame.
        DictionaryFrame frame = new DictionaryFrame();
        
        // Show frame
        frame.setVisible(true);
      

        
    }
}

/*

	public String getWord(String s) throws Exception
	{
		
		int off,len;
		
		s = s.toLowerCase();
		
		byte []s1 = s.getBytes();
		int lenth = s.length();
		
		byte attempt[] = new byte [200];

		int i;
		
		while(true)
		{
			i = -1;
			do
			{
				i++;
				attempt[i] = idx.readByte();	
			}while(attempt[i] > 0 );

			if(i == lenth)
			{
				int out = 0;
				for(i = 0;i<lenth;i++)
				{
					if(attempt[i] < s1[i])
					{
						break;
					}
					if(attempt[i] > s1[i])
					{
						idx.close();
						idx=new RandomAccessFile(f2,"r");
						return "No Such Word";
					}
					
						
				}
				if(i == lenth) break;
			}	
			idx.skipBytes(8);
			if(idx.getFilePointer()>=idx.length())
			{
				return "No Such Word";
			}
			
		}
		
		off = idx.readInt();
		len = idx.readInt();
		return getMeaning(off,len);
		
	}
	*/

⌨️ 快捷键说明

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