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();
   }
  }
 });

转载于:https://www.cnblogs.com/IamThat/archive/2013/03/12/2955245.html

你可能感兴趣的:(swing点击按钮 打开一个浏览器窗口的方法)