On Mon, 18 Jun 2007 19:27:03 -0000, email@example.com wrote, quoted or
indirectly quoted someone who said :
>i am trying to make a graphic similar to following link in Java.. or
If you do this is Java, you are tackling something fairly difficult
for a newbie. There are no widgets that behave like that, so you have
to write or your own components or do it from the Canvas.paint or
Here is how to proceed. Write an applet the draws the bars and plops
the icons on top of them. See http://mindprod.com/jgloss/canvas.html
and follow links for hints on how to proceed.
Then you need to start fielding mouse click events on your canvas. You
do some division to figure out which bar the refer to and how tall you
want the bar. then you adjust the numbers for the heights of the
various bars and call repaint. Your paint then wakes up and paints the
bars the proper lengths and exits.
You might start by writing this as an application, the flip it later
to an Applet. Don't try to debug in inside a browser. That will just
drive you nuts. See http://mindprod.com/jgloss/japplet.html on how to
convert applets to hybrids that will also run as applications.
To get warmed up, try a static application that just draws something
rather than dynamically changing. Learn how to draw lines, shapes,
text, images. Then deal with the complications of dynamics.
See http://mindprod.com/products.html#SCREWS for a sample app.
Roedy Green Canadian Mind Products
The Java Glossary