首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

求大神们帮忙解决方案

2013-03-06 
求大神们帮忙public JLabelDemo() throws Exception{super()this.setTitle(哈哈)this.setBounds(100,

求大神们帮忙
public JLabelDemo() throws Exception{
super();
this.setTitle("哈哈");
this.setBounds(100, 100,500,500);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//System.out.println("hhh");
JLabel jLabel=new JLabel();
jLabel.setToolTipText("上海海洋大学");
jLabel.setDisplayedMnemonic('0');
jLabel.setHorizontalAlignment(SwingConstants.CENTER);
jLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
jLabel.setText("<html><body><font size=10pt><a href=http://www.baidu.com>上海海洋大学</a></font></body></html>");
jLabel.addMouseListener(new java.awt.event.MouseAdapter(){

public void mouseReleased(MouseEvent e){
jLabel_mouseReleased(e);
     }
void jLabel_mouseReleased(MouseEvent e){
try {
     System.out.println("");
Runtime.getRuntime().exec("cmd/c start http://www.baidu.com");
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();}
}
}
);
this.add(jLabel);
}调试出现如下错误
求大神们帮忙解决方案
电脑是win7 32位系统 exception
[解决办法]
这样玩就好..


try {
Runtime.getRuntime().exec(new String[]{"cmd","/c","start http://www.baidu.com"});
} catch (IOException e) {
e.printStackTrace();
}

热点排行