ツールチップのサイズをグローバルに変更しようとしています。
私は使用しています:
UIManager.put("ToolTip.font", new Font("SansSerif",Font.PLAIN,25));
これは一般的にうまく機能します。しかし、私の場合、次のコードで Nimbus LaF を使用しています。
UIManager.LookAndFeelInfo plafinfo[] = UIManager.getInstalledLookAndFeels();
boolean LaFfound=false;
int LaFindex=0;
for (int look = 0; look < plafinfo.length && !LaFfound; look++)
{
if(plafinfo[look].getClassName().toLowerCase().contains("nimbus"))
{
LaFfound=true;
LaFindex=look;
}
}
try {
if(LaFfound) {
UIManager.setLookAndFeel(plafinfo[LaFindex].getClassName());
}
else {UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());}
}
catch(Exception e){Logger.getLogger(Fenetre.class.getName()).log(Level.SEVERE, null, e);}
//correct tooltips size
UIManager.put("ToolTip.font", new Font("SansSerif",Font.PLAIN,25));
この場合、「ToolTip.font」が Nimbus LaF で許可されたプロパティではないかのように、UIManager は私の指示を完全に無視しているようです...
しかし、このページによると: http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/_nimbusDefaults.htmlこのプロパティは存在します。
私のコードの何が問題になっていますか? または、これを別の方法で修正するにはどうすればよいですか?
どうもありがとう !