I'm trying to create a transparent JSpinner on top of a JPanel with an image as background. Apparently setOpaque(false) isn't enough to acheive this and so I'm wondering if there's another way to do it. Can I override some paint method for the JFormattedTextField or customize some UI class?

These two methods together will make a component transparent under most look and feels.

setOpaque(false);
setBackground(new Color(0,0,0,0);

Some components, like the JSpinner, are composed of several sub-components that would also need to be made transparent. So just use a helper method that recursively calls the above two methods on each subcomponent.