<?xml version="1.0" encoding="utf-8"?> <rcp:RCPModule xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:rcp="http://www.smartrcp.org" creationComplete="init()" xmlns:mx="library://ns.adobe.com/flex/halo" layout="vertical" paddingLeft="3" ?paddingRight="3"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <fx:Script> <![CDATA[ import cn.smartinvoke.RemoteObject; import cn.smartinvoke.smartrcp.CApplication; import cn.smartinvoke.smartrcp.gui.module.CommonDialogs; import mx.collections.ArrayCollection; private var fileService:RemoteObject=null; function init():void{ var info:String="本模块通过调用java扩展库实现文件的读写功能,点击打开文件按钮 读取一txt文件,点击保存文件按钮保存编辑后的文件信息"; smartrcpDemo.Instance.setInfo(info); this.fileService=new RemoteObject(); this.fileService.create("cn.smartinvoke.smartrcp.demo.CServiceFile"); //this.fileService.call("readFile", } function onOpenFile():void{ CommonDialogs.Instance.openFileSelDialog(function (paths:ArrayCollection): void{ if(paths!=null && paths.length>0){ var path:String=paths[0] as String; textArea.text=fileService.call("readFile",[path]) as String; } },this,false,["*.txt"]); } function onSaveFile():void{ CommonDialogs.Instance.openFileSaveDialog(function (path:String):void{ if(path!=null){ this.fileService.call("writeFile",[path,this.textArea.text]); } },this,CApplication.Instance.getBaseFolder()); } ]]> </fx:Script> <s:HGroup width="100%" height="31" contentBackgroundColor="#6696F0" verticalAlign="bottom"> <s:Button label="打开文件" click="onOpenFile()"/> <s:Button label="保存文件" click="onSaveFile()"/> </s:HGroup> <s:TextArea id="textArea" width="100%" height="100%"/> </rcp:RCPModule>?
详细解决方案
smartrcp的兑现java本地调用演示代码
热度:135 发布时间:2012-11-01 11:11:32.0
相关解决方案
- java 乱码 汉字是 ? 如何转换成汉字
- java web 登录次数限制,该如何解决
- java 工商银行网银支付 B2B的 都亟需什么,需要注意什么
- Java Applet程序从JDK6升级到7时遇到的有关问题
- java web 视频相干
- 请教一个关于链接后缀的有关问题(java web 应用)
- java 系统单点登录解决方案
- java.lang.NumberFormatException: For input string: "id"该如何处理
- java.lang.NoSuchMethodException: setId([Ljava.lang.String;)解决方法
- java 获取客户端IP解决办法
- JAVA 后台怎么获得前台页面FCKedit编辑器中的内容以及内容的样式
- java 正则化匹配有关问题
- java web 受阻
- java.lang.IllegalStateException: No output folder,该怎么解决
- java.lang.NoSuchMethodError: org.springframework.util.ReflectionUtils.makeAccess,该如何解决
- java 乱码有关问题 急求大神
- java EE错误如何解决阿,都是过了,没有能解决的!
- java 工程打包有关问题 多谢各位大神!多谢
- JAVA WEB导航条,该怎么处理
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password,该如何处理
- java 中Node 有关问题
- 关于 java 引述传递和值传递,你的知否
- 吐了,java Timer 终止不了。
- Java Web 学习中有关问题,请高手指教
- java web中的url地址小疑点。
- java web开发解决办法
- java.lang.NullPointerException解决方法
- 关于 java cast 有关问题,你明白不
- java ftp 下传和上载乱码有关问题
- java web项目上的一些文件