swing点击按钮 打开一个浏览器窗口的方法

RolloverButton ib1=new RolloverButton("百度",BusinessPluginRes.getImageIcon(BusinessPluginRes.ESTATERES));

 ib1.addActionListener(new ActionListener() {
  
  @Override
  public void actionPerformed(ActionEvent e) {
   Runtime rt=Runtime.getRuntime();
   try {
    Process proc=rt.exec("C:\\Program Files\\Internet Explorer\\iexplore.exe www.baidu.com");
   } catch (IOException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
   }
  }
 });

posted @ 2013-03-12 10:49  IamThat  阅读(577)  评论(0编辑  收藏  举报