Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
JButtonの1つでハイパーリンクのフォントに下線と青を付ける必要がありますが、フォントクラスにはこれを行う明確な方法がないようです。Graphicsクラスでこれを表示しないため、attributedtextを使用できません。とにかく私はこれを達成することができますか?JButtonのタイトルを青で下線を引く必要があります。
JButton button = new JButton("OK"); button.setBackground(Color.blue); Font buttonFont=new Font(button.getFont().getName(),Font.UNDERLINED+Font.BOLD,button.getFont().getSize()); button.setFont(buttonFont);