Java help

  • Permalink
  • submit to reddit
  • Email
  • Follow


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
Reply hjas99 (1) 6/18/2007 7:27:03 PM

See related articles to this posting


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
Reply Roedy 6/29/2007 3:31:53 PM
comp.lang.java.programmer 51942 articles. 38 followers. Post

1 Replies
250 Views

Similar Articles

[PageSpeed] 41


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

Help Help, I am intermediate in Java...need help in follow case
There is two java classes second class is for execute ant file. First Class does the most. first create a plain class which accepts two java.io.File object in constructor as input and output and a method which performs replacement. - the replacement must take into account the file ending of the input file: + for .java, .cpp, .c and .css remove the FIRST occurrence of "/ * ... */" + for .xml, .xhtml, .html and .xsl remove the FIRST occurrence of "<!-- ... -->" has any body have an example class to do it? Thanks a lot...if you can help...I create a class but is n...

urgent help with the program
Hello, im studying Java, something I am very much new to. I was assigned a program - its a lengthy read, but i would appreciate your input if you have. Attached you will see code, my question is what would be a good way to develop METRO section of my program, since its giving me a lot of trouble, and im not sure what is the smartest way to approach this. Please kindly give me your comments and suggestions on how to go about it. Thank you in advance. ------ Include constructors for each class, set and get methods as needed in each subclass. Use this and super whenever possible to simplify the...

Help debugging Java code with Java 1.3.1_01 Java HotSpot Client VM (jvm.dll)
Hi everybody, I am seeking help in my attempt to configure proper debugging functionality for my classes with an application on a win32 platform that uses Java HotSpot(TM) Client VM (JRE 1.3.1_01 - jvm.dll). For those of you that may actually know this application, it is Matlab. For those not familiar, it is an executable that links jvm.dll. I have a number of Java IDEs (Sun ONE Studio, JBuilder, NetBeans) and I would appreciate help in setting up at least one of them to be able to debug my classes. Does anybody have an idea where to start? I think I have figured out a way to pass...

New to advane java help me in Java beans!
Hai! I am new to ad.java.I want to do java beans programs.I have Jdk1.6,j2eesdk 1.4,j2sdk 1.4,tomcat 6,netbeans ide 5.5. is there needany other software? And give complete details how to run beans programwith small example step viz pleas! NANY(kshore) wrote:> Hai!> I am new to ad.java.I want to do java beans programs.I have Jdk> 1.6,j2eesdk 1.4,j2sdk 1.4,tomcat 6,netbeans ide 5.5. is there need> any other software? And give complete details how to run beans program> with small example step viz pleas!> Try Sun's tutorial:http://java.sun.com/docs/books/tutorial/javab...

Help: Could you help me understand this Java GUI project?
Dear All, I have received a small Java GUI project. I am a Java programmer. But I don't fully understand the requirement. The project is: Using J2SE 5.0, develop a JPanel that draws a list of semi-transparent (alpha = 128) rectangles with a border. The control must have the following public API: public void enableZoom (boolean enabled) When set to true (default value), the panel draws its contents 10 times as big as the screen resolution. Similar to the �View - Zoom - Large Size� menu option in Windows Paint*. public bool AddRectangle (java.awt.Rectangle r) Adds a rectangle to ...

Help I'm a Java Dummy, Please Help
Hey guys I'm Gessa I recently started my graduate studies where I have to take at least programming two, the last programming class I took was in my associates degree and one in the beginning of my bachelor's degree. And need some real help with some code and how to solve some problems if any of you can find the time to help me it would deeply appreciate this. Feel free to e mail me in private concerning my problem I will at one of them to this topic so that if you can and want to assist me you can see what I am having trouble with. Thank you for your help and attention 1* This is ...

Please Help!!Daughter needs help with java code
Hello everyone, I apologize for taking up anyone's time with such a newbie question. However, my daughter is tearing her hair out over this code. I myself don't know anything about programming however, being the father that I am, I am hoping that someone can respond to my plea for help and provide her with a solution. Below is her code. Thank you all and God Bless!! Problem: Print out all the 4 number combinations using only the following numbers: 6, 9,0,3,1 The code is giving her only 5 combinations at the moment. This is where she needs help. //Source code// import java.mat...

Thunerbird help... [not java related , but please help if you can!]
Hi all... I know this is not a java question, but after seeking help on the Thunderbird newsgroup, I was not able to get an answer to my question. So since i know there are a lot of smart people in this group, I thought of asking here. here is the link to my question on the Thunderbird forum, please read, and offer your insight! http://forums.mozillazine.org/viewtopic.php?t=334466 many thanks here is the text of my question, if you do not want to follow the link in the OP: Hi group. I've been using Thunderbird for reading newsgroups for quite a while now, after being an Ou...

PLEASE HELP at Java Servlet / Java Server Pages !!!!!
// Forgive my English :) I have to write a program (JS or JSP), which connect with Oracle and get out date from some table. I've found some example, but it makes errors :(( I installed these : J2EE 5.0 Tomcat 5.5.17 Oracle Express Edition 10.2g I put ojdbc14.jar in in folder, where is my .jsp file. Source of .jsp : <% Class.forName("oracle.jdbc.driver.OracleDriver"); java.sql.Connection connection=java.sql.DriverManager.getConnection("jdbc: oracle:thin//localhost:3306/"baza","login","haslo"); java.sql.ResultSet rs=connection.createStatement...

PLEASE HELP at Java Servlet / Java Server Pages !!!!!
// Forgive my English :) I have to write a program (JS or JSP), which connect with Oracle and get out date from some table. I've found some example, but it makes errors :(( I installed these : J2EE 5.0 Tomcat 5.5.17 Oracle Express Edition 10.2g I put ojdbc14.jar in in folder, where is my .jsp file. Source of .jsp : <% Class.forName("oracle.jdbc.driver.OracleDriver"); java.sql.Connection connection=java.sql.DriverManager.getConnection("jdbc: oracle:thin//localhost:3306/"baza","login","haslo"); java.sql.ResultSet rs=connection.createStatement(...

HELP !!! java.sql.SQLException: General error HELP!!!!!
Hello When I wanna remove a record from my Database or update a record in my database. I get a java.sql.SQLException: General error, but he does remove the record. what does it mean java.sql.SQLException: General error and how can i fix it?! Greets Vampyrotica There might be another thread running a query on the table which has locked the table. Vampyrotica wrote: > Hello > > When I wanna remove a record from my Database or update a record in my > database. I get a java.sql.SQLException: General error, but he does > remove the record. what does it mean ja...

Help with Java
My wife's computer seems to be freezing up since she installed SunJava, JRE V1.5. I'm very unfamiliar with all of this so if my terminology is not correct please forgive me and I'll try to explain it better. Are there any issues with this install? She installed it because the site she hangs out on told her it was necessary to have this installed. Can anyone help? Thanks, Don.............. Does it hang up permanently, or just for awhile? It takes some time for Java to load up the first time you go to a Java-enabled page. Factors like the speed of your connection, the speed of...

Java Help
hi all im new to the whole java thing and need some help! im trying to make an e mail form and when i test it, it sends the e mail to the designated e mail address but when i go to the e mail account i sent it to it doesnt have any info that should have been submitted all i get in the e mail is: name= im using the following e mail form template: JavaFile.com e-mail form Thanks for any help you can offer! Eagle35 wrote: > im new to the whole java thing and need some help! This is a JavaScript newsgroup, not a Java newsgroup. > im trying to make an e mail form and when i test i...

help on java
Hello, if one user wants to access our server via a gui(running on the client side) and send data(may be a file) to the server.Once server got a data, server running one program to process that data, and send the output to the client(May be a file). Also the server wants to keep track of the client information(such as login name,date) in a database for future use.Now the question is which java technology i can use to satisfy these requirments. Please share the information that will help us for developing. Thanks in advance. On 21 Apr 2004 22:54:12 -0700, Narayanan Kaleeswaram wrote: ...

help me in java
hi! i am new in java. i am just trying to learn it. but i have got a problem. please anyone help me: here is the code: public class ap1{ public static void main(String[] args){ System.out.println("Hello there!"); } } i save it as ap1.java in c: drive. when i compile it with java : javac ap1.java it is compiled and a class file named ap1.class is created in c: drive. but when i am trying to run the class file by java ap1.class it shows following errors: Exception in thread "main" java.lang.NoCl...

help on java
hi all, I'm calling a 32bit executable(.exe)-(console application written in C) within my java code using RunTime.I've made a swing application and it is calling the executable. It is executed properly and a console window is created which displays the output of the called program.But I'm trying to hide the console ,so that it does not appear in the taskbar also. Can Anyone help me on how to carry this out. Thanking in advance . Regards. Arnab e_mail:-arnab@galieosoft.com http://www.galieosoft.com Arnab wrote: > I'm calling a 32bit executable(.exe)-(console appli...

java help
the code i have done retreives teh text from a file and displays it in the system.out.println, just wondering if anyone could help me change it so that it displays with a java gui interface, say in a JFrame or JTextArea?? Open.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { FileReader file = new FileReader("IP Information.txt"); BufferedReader buffer = new BufferedReader(file); String textline = null; while((textline = buffer.readLine()) !=null) System.out.println(textline); buffer.close(); } catch ( IOException f ...

java help
I have an exercise that I cannot figure out. Here it is: There is a reference variable myAC to an object of this class, which has already been created. Send a message to this object using the reference variable, telling it to turn the air conditioner on. there is also a method turnOn that has to be used but cannot pass any arguments through for some reason. Im so confused, thanks for the help. ...

Help With Java
I'm trying to use xml in my java program but I keep getting an error message saying that package org.xml doesn't exist. I un jarred the jar files to make sure it is there and it is. I also tried to setting the classpath variable to make sure javac was pointing to the right jar files. That made no difference though. Also, javax.xml and javax.security can't be found either even though they are visible in java browser. I'm using 10.2.8 and project builder 2.1. Any help would be appreciated. -- ...

Some java help
While I code in Objective C most of the time and used to use C++, I've got a call to learn Java so I've been messing around with some play projects and looking at a lot of source. In the course of this I came across an article from the February 2002 MacTech by Andrew S. Downs which offered up some classes for use in debugging such as a StackTrace class which writes out a stack trace to a file. It gets the stack trace from an exception which is either passed to the StackTrace object when it is initialized or which is thrown by the StackTrace constructor. My question, whic...

Help with Java
Hi. I need create a GUI with a text area not editable. For this I'm using Java with this code: wOutput = javax.swing.JFrame(); wOutput.setSize(700,500); tArea = java.awt.TextArea(); tArea.setSize(wOutput.getSize()); tArea.setEditable(false); tArea.setBackgroud(java.awt.Color.WHITE); wOutput.add(tArea); wOutput.setVisible(true); At this point, all is working great. But now I need add text. For this, I can use following code: tArea.append('Hello world'); My question: How add a new line in TextArea object? If I use '\n', don't add a new line; write '\n' "...

Help on java
Hi, if one user wants to access our server via a gui(running on the client side) and send data(may be a file) to the server.Once server got a data, server running one program to process that data, and send the output to the client(May be a file). Also the server wants to keep track of the client information(such as login name,date) in a database for future use.Now the question is which java technology i can use to satisfy these requirments. Please share the information that will help us for developing. Thanks in advance. narayanan_p@rediffmail.com (Narayanan Kaleeswaram...

Help on java
Hello, if one user wants to access our server via a gui(running on the client side) and send data(may be a file) to the server.Once server got a data, server running one program to process that data, and send the output to the client(May be a file). Also the server wants to keep track of the client information(such as login name,date) in a database for future use.Now the question is which java technology i can use to satisfy these requirments. Please share the information that will help us for developing. Thanks in advance. > if one user wants to access our server...

help java
I am new to java but got a problem > > I am going to print something but have the alignment problem. The problem > is > that i have a label and the value > However, it may be a repeating item so it would like > > label value1 > value2 > value3 > > I plan to do something like to getLabellength and then put the space with > the same length to align the value1,2,3 > But I dont know how to write that Thank you raymond but my stuff is not related to GUI I simply write to a text file for alignment problem ti...