//鼠标显示小手标志Cursor myCursor = new Cursor(Cursor.HAND_CURSOR); jblFgt = new JLabel("点击显示小手形状",JLabel.CENTER);jblFgt.setCursor(myCursor);//点击打开默认浏览器并跳转//监听鼠标事件jblFgt.addMouseListener(this);//通过Runtimr执行点击跳转到相应网页public void mouseClicked(MouseEvent e) {// TODO Auto-generated method stubtry {if(e.getSource()==jblFgt){//任选一个就可以//Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler /");Runtime.getRuntime().exec("cmd /c start ");}}catch (IOException e4) {// TODO Auto-generated catch blocke4.printStackTrace();}}
如果觉得《JLabel鼠标停在上面显示小手图标 点击跳转到相应网页》对你有帮助,请点赞、收藏,并留下你的观点哦!