日期:2014-05-20 浏览次数:20797 次
runbutton.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent arg0) {
try {
String str = chooser.getSelectedFile().getPath();
String path = str.substring(0,str.length()-5);
Runtime rt = Runtime.getRuntime();
rt.exec("cmd /k start java " + path);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});