Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Beginning Java 2
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Java 2
This is the forum to discuss the Wrox book Beginning Java 2, SDK 1.4 Edition by Ivor Horton; ISBN: 9780764543654
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Java 2 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 4th, 2003, 09:03 PM
Authorized User
Points: 78, Level: 1
Points: 78, Level: 1 Points: 78, Level: 1 Points: 78, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Socorro, NM, USA.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Plotting a graph on a Java Applet

Hi,
   First of all, I would like to thank all Wrox members for having this web site back again, we really missed it!!!. Thank you for your efforts.:D

   I have a problem where I have to draw a graph on an applet using some data in a text file. I would need to design an applet where I can display the graph and the data on the same applet. I had a hard time writing some code in Java to read the text file since I am novice in Java. Now, I am really stuck in how to take this data and graph it on an applet. I don't know which class to use for drawing the graph and how to scale it and draw the actual points or designing the applet itself. I would appreciate if someone can help me out by any suggestions or comments

 Thank you
  #2 (permalink)  
Old June 12th, 2003, 08:04 AM
Authorized User
 
Join Date: May 2003
Location: New Delhi, Delhi, India.
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi
To draw a graph in an Applet u need to use the Graphics class present in the AWT package. Graphics class drawRect(),drawString(),drawLine() methods can be used to draw a Graph in an applet. Reading a text file directly from an applet can't be done because Applet run in a sandbox and for security reasons Applet is not allowed to access the System resources.I guess if u are using Applets you must be creating a web based application which will run on Internt or a local intranet and this must involve a web server also if iam right.If this is the case i suggest you to write a JSP or a Servlet for this and let the applet communicate with the Server application and get the data u need.

hope this helps

Regards

Yashraj Chauhan
Java\J2EE Specialist
Wiley Support Team
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java Applet - Search with Slider options itHighway Classic ASP Basics 0 June 10th, 2006 02:49 AM
close java applet causes browser to crash Thomanji Ajax 0 February 24th, 2006 10:25 AM
Plotting graph using Infragistics NetAdvantage 5 dotnetprogrammer VS.NET 2002/2003 0 June 1st, 2005 07:11 AM
java applet trick convet to c# chall3ng3r General .NET 0 February 8th, 2005 11:22 PM
display element (layer) over java applet mateenmohd Java GUI 0 January 6th, 2004 12:39 AM



All times are GMT -4. The time now is 11:01 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.