An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.
One of a set of tools we're offering as a way of saying thank you for being a part of the community.
JPanel p = new JPanel();
p.setBackground(Color.RED)
I think this should work; did you try it this way?