-1
我想将两种文本类型放在一个按钮中。 上面的那个将是一个大数字,下面的那个将是一个更小的文本。 下面的代码已经打破了行,但我无法操纵字体。JButton - 我如何分割线条并在同一个按钮中设置两种不同的文字大小?
String twoLines = "Two\nLines";
JButton b = new JButton("<html>" + twoLines.replaceAll("\\n", "<br>") + "</html>");
_thank你的帮助,它的工作:)_ –