在Swing中自动增加字体大小 [英] Automatically increasing font size in Swing
问题描述
我想知道是否有方法根据组件的大小自动增加字体大小。这里有这个gui:
http://img823.imageshack.us/ img823 / 9140 / hz7.png
Hovewer如果我增加框架的大小,它会变成这样:
http://img259.imageshack.us/img259/6308/eari.png
字体大小不会增加。我不知道如何做这件事。
I would like to know if there are methods of automatically increasing the font size based on the size of a component. I have this gui here: http://img823.imageshack.us/img823/9140/hz7.png Hovewer if i increase the size of the frame, it becomes like this: http://img259.imageshack.us/img259/6308/eari.png the font size doesn't increase. and i don't have an idea on how to make this work.
推荐答案
一些L& F支持 sizeVariant
,图解使用 com.apple.laf.AquaLookAndFeel
此处。或者,您可以缩放字体以填充由您选择的布局分配的空间,如此处所示。
Some L&Fs support a sizeVariant
, illustrated here with com.apple.laf.AquaLookAndFeel
. Alternatively, you can scale the font to fill the space allocated by your chosen layout, as shown here.
这篇关于在Swing中自动增加字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!