JLabel label = new JLabel("<HTML><U>YOUR TEXT HERE</U></HTML>");label.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
要么
JLabel label = new JLabel("Underlined Label");Font font = label.getFont();Map attributes = font.getAttributes();attributes.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);label.setFont(font.deriveFont(attributes));
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)