I was hoping to stack instances of JLayers
ontop of each other to get a layered effect but they don't seem to want to work that way. I'd like to decorate a single JPanel
with multiple effects implemented by multiple LayerUI<JPanel>
classes.
For example
frame.add(new JLayer<>(panel, new LayerUI<> ...));
frame.add(new JLayer<>(panel, new LayerUI<> ...));
where the argument to new JLayer
is the same JPanel
instance but the LayerUI
instances do different things.
It seems the last one added wins. They both draw directly to the context in the paint
method, perhaps thats it..?
See here for Oracles' tutorial