在java 中怎么样可以打开一个特定的应用程序,象doc,txt,pfd,gif,jpg等对用的应用程序,并且使这个应用程序显示于一个java的容器中?用什么容器可以实现啊? 希望各位帮忙我知道用runtime.getruntime(".\\command.exe filepath");可以打开一个应用,但不知道如何将这个应用程序包容在一个类似于panel一样的容器中!关注各位的赐教!在线等候!
解决方案 »
- 关于 String类 codePointCount()和 offsetBycodePoints()
- 关于读取properties文件的问题,急
- 圆点相同,半径不同,为什么画出来的圆不同心呢
- 我用小颖java反编译反编译一个目录怎么列表里面说生成文件了,但是实际文件都没有
- 'class' or 'interface' expected 编译错误
- 还是焦头烂额的APPLET,在MS的1.1的JVM中,我要画带坐标带小数的线,怎么办???
- Applet从html文件中读取参数内容 ?????
- 请问microsoft access中是否支持sql语句的嵌套?
- 如何防止JtextArea里的文字被用户选择并copy???
- 关于类中属性的get() set()方法太多,怎么解决?
- java 接收邮件报错,请各位帮忙看看
- 我想学java,目前什么也不懂,请大家给点意见?
我是要用一个容器,包住外部应用程序,比如说:我让word应用程序,打开后,不是全屏幕或自由显示,是将它的框架限制在一个我自己的容器中!
比如 我想打开也doc文件,但不知道word安装的路径,怎么打开啊,用runtime.exe("word完整路径","dd.doc");可以打开,但如果不知道word程序的安装路径应该怎么办啊,请各位帮忙!
yourFrame: 装载Applet的窗口
yourApplet: 将要装载的Appletclass yourFrame extends JFrame
implements AppletStub, AppletContext
{
public yourFrame(Applet yourApplet)
{
applet=yourApplet;
getContentPane().add(applet);
applet.setStub(this);
} public void show()
{
applet.init();
super.show();
applet.start();
}
// AppletStub Method
public boolean isActive() { return true; }
public URL getDocumentBase() { return null; }
public URL getCodeBase() { return null; }
public String getParameter(String name) { return ""; }
public AppletContext getAppletContext() { return this; }
public void appletResize(int width,int height) {}
// AppletContext methods
public AudioClip getAudioClip(URL url) { return null; }
public Image getImage(URL url) { return null; }
public Applet getApplet(String name) { return null; }
public Enumeration getApplets() { return null; }
public void showDocument(URL url) { }
public void showDocument(URL url,String target) { }
public void showStatus(String status) { }
public InputStream getStream(String key) { return null; }
public Iterator getStreamKeys() { return null; }
public void setStream(String key,InputStream stream) throws IOException { } private Applet applet;
}