怎么给JLabel加下划线

[复制链接]
查看11 | 回复1 | 2009-8-8 20:51:41 | 显示全部楼层 |阅读模式
rnxefe正解,用html
回复

使用道具 举报

千问 | 2009-8-8 20:51:41 | 显示全部楼层
下面的程序可以直接运行package com; import javax.swing.*;public class Testextends JFrame {
public static void main(String args[]) {
new Test();
}
public Test(){
super("JLabel Test");
//JLabel 里面的 Text 支持简单的 HTML 语言
JLabel label = new JLabel("[U]这 是 下 划 线[/U]");
this.getContentPane().add(label);
this.setSize(300,200);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行