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

📄 quick123.java

📁 这里面有150个从简单到难的java 程序的源代码
💻 JAVA
字号:
import Lot123.*; 
public class Quick123
{
	public static void main(java.lang.String[] args) {
		Application app; 
		Ranges ranges; 
		Document doc; 
		Range rangeA1, rangeA2; 
		try {
			// 建立com环境 
			com.ibm.bridge2java.OleEnvironment.Initialize();
			// 创建一个新的用来启动"123"的文档
			doc = new Document();
			// 获得 application object. 
			app = new Application(doc.get_Parent());
			// 使application可见. 
			app.set_Visible(new Boolean("true"));
			// 打开Range workbook. 
			doc = new Document(app.NewDocument());
			// 获得所有的 ranges. 
			ranges = new Ranges(doc.get_Ranges());
			// 获得cell A1. 
			rangeA1 = new Range(ranges.Item(new String("A1")) ); 
			// 设置cell A1的内容
			rangeA1.set_Contents("This is a test");
			// 获得 cell A2. 
			rangeA2 = new Range(ranges.Item(new String("A2")) ); 
			// 把 cell A1 的内容复制给 cell A2
			rangeA1.QuickCopy(rangeA2); 
			// 等待一秒
			Thread.sleep(1000); 
			// 推出"123"并且不保存
			app.Quit("false");
		} catch (com.ibm.bridge2java.ComException e)  {
			// 处理com异常
			System.out.println( "COM Exception:" ); 
			System.out.println( Long.toHexString((e.getHResult())) ); 
			System.out.println( e.getMessage() ); 
		} catch (Exception e) {
			System.out.println("message: " + e.getMessage());
		} finally {
			app = null; 
			com.ibm.bridge2java.OleEnvironment.UnInitialize();
		}
	}
}

⌨️ 快捷键说明

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