[英]How to put the text of a JLabel under its icon
我試圖將JLabel的文本放在它的圖標(居中)下面,我可以得到這個
使用JLabel north = new JLabel("North")
我嘗試在標簽JLabel("<HTML><BR>North</HTML>")
使用html JLabel("<HTML><BR>North</HTML>")
但它沒有正確對齊。 有什么建議?
看到這個:
基本上,在你的情況下使用它:
north.setHorizontalTextPosition(JLabel.CENTER);
north.setVerticalTextPosition(JLabel.BOTTOM);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.