79190802

Date: 2024-11-15 00:36:41
Score: 1
Natty:
Report link

Thank you, Morinar, for your contribution; it helped me a lot. I'm sharing a small modification to Morinar's method that works.

private void setWindowsPlacesBackground(Container con) {
    Component[] components = con.getComponents();

    for (int i = 0; i < components.length; i++) {
        Component c = components[i];

        // If we find a WindowsPlacesBar, we nullify the "XPStyle.subAppName" property
        if (c instanceof sun.swing.WindowsPlacesBar) {
            System.out.println("Found WindowsPlacesBar, nullifying XPStyle.subAppName property...");
            ((sun.swing.WindowsPlacesBar) c).putClientProperty("XPStyle.subAppName", null);

            // Now you can apply the background color
            c.setBackground(new Color(101, 96, 118)); // Change the color here
            return; // Exit, as we have modified the first WindowsPlacesBar found
        }

        // If the component is a container, we continue searching recursively
        if (c instanceof Container) {
            setWindowsPlacesBackground((Container) c);
        }
    }
}
Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Blacklisted phrase (1): helped me a lot
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Todo-System Todo-System