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
0
hjas99 (1)
6/18/2007 7:27:03 PM
comp.lang.java.programmer 52520 articles. 0 followers. Post Follow

1 Replies
333 Views

Similar Articles

[PageSpeed] 43

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
>
>http://media.pearsoncmg.com/bc/aw_young_physics_11/pt1a/Media/WorkEnergy/SpringLaunchedBowler/Main.html

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
http://mindprod.com
0
Roedy
6/29/2007 3:31:53 PM
Reply: