I have one issue related to JTree swing component, I want to use JTree under Windows high contrast Mode, but it never shows tree nodes according to windows High contrast t开发者_如何学运维heme.
Jtree view Under Normal ModeI want to make my applications jtree view same as eclipse's "high contrast" view.
Can anybody guide on this?? I am trying to write a logic like:
// calling this On application load - or via some kind of listener
Toolkit toolkit = Toolkit.getDefaultToolkit();
Boolean highContrast = (Boolean)toolkit.getDesktopProperty( "win.highContrast.on" );
boolean flag=highContrast.booleanValue();
if(flag){
// do stuff for high contrast
}
else{
// show in normal mode
}
Thanks for your help!!
According to this issue is this bug in Swing L&F implementation. There is possible to accept this by modifying Windows L&F and provide it as own, or use different L&F which supports this.
I implemented this with the help of toolkit calls pscode.org/prop/form.html - get Changed font and font size details and apply to jtree
精彩评论