当前位置: 技术问答>java相关
如何通过java程序调用vb程序
来源: 互联网 发布时间:2015-01-19
本文导语: 如何实现JAVA程序调用vb程序, | import java.awt.*; import java.awt.event.*; public class test extends Frame { Button t =new Button("run program"); public test() { add(t); t.addActionListener(new ActionListener() { public...
如何实现JAVA程序调用vb程序,
|
import java.awt.*;
import java.awt.event.*;
public class test extends Frame
{
Button t =new Button("run program");
public test()
{
add(t);
t.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
try{
Runtime.getRuntime().exec("C:\test\java\callexe\test.exe");
}
catch(Exception ee)
{}
}
});
}
public static void main(String args[])
{
test t=new test();
t.setSize(400,400);
t.setVisible(true);
}
}
import java.awt.event.*;
public class test extends Frame
{
Button t =new Button("run program");
public test()
{
add(t);
t.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
try{
Runtime.getRuntime().exec("C:\test\java\callexe\test.exe");
}
catch(Exception ee)
{}
}
});
}
public static void main(String args[])
{
test t=new test();
t.setSize(400,400);
t.setVisible(true);
}
}
|
to masterz()
很正确;
很正确;