Java help

Hii am trying to make a graphic similar to following link in Java.. orflash playerhttp://media.pearsoncmg.com/bc/aw_young_physics_11/pt1a/Media/WorkEnergy/SpringLaunchedBowler/Main.htmlorhttp://sstl.cee.uiuc.edu/java/twostory/index.htmli have basic knowledge on Java.. but dont know flash player thatwell..please let me know its part of my class project
hjas99 (1)
6/18/2007 7:27:03 PM
comp.lang.java.programmer 52633 articles. 0 followers. Post Follow

1 Replies

Similar Articles

[PageSpeed] 15

On Mon, 18 Jun 2007 19:27:03 -0000, hjas99@gmail.com wrote, quoted or
indirectly quoted someone who said :

>i am trying to make a graphic similar to following link in Java.. or
>flash player

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
JPanel.paintComponent level.

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
6/29/2007 3:31:53 PM