954,554 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Layering Paint Program - Which Control to use...

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,

MitchyMoo.

MitchyMoo
Newbie Poster
7 posts since Sep 2011
Reputation Points: 19
Solved Threads: 0
 

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

mKorbel
Veteran Poster
1,141 posts since Feb 2011
Reputation Points: 480
Solved Threads: 224
 

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

Kind regards,

MitchyMoo.

MitchyMoo
Newbie Poster
7 posts since Sep 2011
Reputation Points: 19
Solved Threads: 0
 

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,

MitchyMoo.

MitchyMoo
Newbie Poster
7 posts since Sep 2011
Reputation Points: 19
Solved Threads: 0
 

JDesktop with JInternalFrame

mKorbel
Veteran Poster
1,141 posts since Feb 2011
Reputation Points: 480
Solved Threads: 224
 

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

efxee
Newbie Poster
12 posts since Aug 2011
Reputation Points: 19
Solved Threads: 2
 

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.

Ezzaral
Posting Genius
Moderator
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
 

What component would i display them on though?

Kind regards,

MitchyMoo.

MitchyMoo
Newbie Poster
7 posts since Sep 2011
Reputation Points: 19
Solved Threads: 0
 

i guess it wouldnt matter too much would it?

MitchyMoo.

MitchyMoo
Newbie Poster
7 posts since Sep 2011
Reputation Points: 19
Solved Threads: 0
 

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

Ezzaral
Posting Genius
Moderator
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
 

Thank you very much Ezzaral.

Kind regards,

MitchyMoo

MitchyMoo
Newbie Poster
7 posts since Sep 2011
Reputation Points: 19
Solved Threads: 0
 

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

Ezzaral
Posting Genius
Moderator
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
 

Thanks too to efxee :D.

MitchyMoo
Newbie Poster
7 posts since Sep 2011
Reputation Points: 19
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You