views:

25

answers:

1

Hi,

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 theme.


Jtree view Under Normal Mode
alt Text


Jtree view Under High Contrast Mode
alt text


Eclipse Package Explorer view Under Normal Mode
alt text


Eclipse Package Explorer view Under High Contrast Mode
alt text

I 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!!

A: 

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.

Rastislav Komara