Dear sirs,

I would just like to ask a quick question:

What control would i use for creating a paint-like program but with layered features?

It was a choice between GlassPane (but am not to sure how to use it despite the fact i have been up all night researching which control to use) or a JLayeredPane.

If someone could give me a bit of a general idea of what control to use, basics on how it works i would be very grateful.

Kind regards,


Recommended Answers

All 12 Replies

both aren't userfriedly, if there needed something overlay, then look for paintComponent() JLayeredPane, because is not confortable paint() Graphics2D to GlassPane/RootPane

otherwise (if is possible) to look for CardLayout

Thank you for your quick reply, i shall try my best to implement a JLayeredPane Component.

Kind regards,


Dear sir/ madam,

I have encountered a problem, a JLayeredPane will only handle a maximum of 5 layers.

Is there any other tool i can use?

Kind regards,


JDesktop with JInternalFrame

you can save layers in the form of bufferedimage type vector.
Retrive or repaint the needed layers when wanted.

Yes, a List of BufferedImages may be a useful way to go, especially if you wish to merge layers later or flatten to a single image.

What component would i display them on though?

Kind regards,


i guess it wouldnt matter too much would it?


Nope, wouldn't matter. JPanel, JLabel, or even just an extension of JComponent.

Thank you very much Ezzaral.

Kind regards,


Thank efxee, I just agreed with his/her suggestion. :)

Thanks too to efxee :D.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.