Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2007

Tip: Looking for answers? Try searching our database.

Java help

Thread view: 
hjas99@gmail.com - 18 Jun 2007 20:27 GMT
Hi
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/SpringL
aunchedBowler/Main.html


or

http://sstl.cee.uiuc.edu/java/twostory/index.html

i have basic knowledge on Java.. but dont know flash player that
well..

please let me know its part of my class project
Roedy Green - 29 Jun 2007 16:31 GMT
>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/SpringL
aunchedBowler/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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.