hi all,
I am trying to write a GUI program which will show different images in
the background and foreground.The images shown depend on the user
inputs.I am presently using JFRames, JPanels and all to do
these.Somtimes the images are to be very frequently changed and
sometimes we require to toggle between some images.I am using JFrames
and Swings components .We have a JDesktop pane in which the background
and foregroud images are shown.The desktop pane knows which screen is
present at the moment and it has a button to shift between previouss
and next screens.I request you to please tell whether this is the right
approach or should I use applets and threads to avoid any difficulties
in future.If you feel this is a stupid question please leave it.I
request you to please help.
Raam
raam - 20 Apr 2006 04:33 GMT
James - 09 Jan 2007 00:16 GMT
> hi all,
> I am trying to write a GUI program which will show different images in
[quoted text clipped - 10 lines]
> request you to please help.
> Raam
What you might find helpful is JLayeredPane. Put each image in a layer,
and rotate the z-order of the layers. It also has convenience methods like:
* moveToBack(Component c)
* moveToFront(Component c)
* add(component c,int index))
* remove(int index)
* setLayer(Component c, int layer).
For more info see:
http://java.sun.com/j2se/1.5.0/docs/api/index.html
-AND-
http://java.sun.com/docs/books/tutorial/uiswing/components/layeredpane.html