Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

why i'm not getting graph (output)?

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
hi...everyone....
I created an applet which contains a manubar .In that menubar only one manuitem " load file..."(menu item) is there. Which is used to browse the a file which contains a number of values to draw the graph. By that values i want to draw a line graph .
my aim is that when ever i browse a new file , take the values form that and to draw new graph base on the old scale.(if i browsed two files ,then the graph should contain two line graphs ) ...
here is the calling one...

when we browse a file ,then it is reading the file data but,graph was displaying.......
here is the code....



a blank applet with menubar is appearing ....
could you tellme whats wrong with my code ...?
than you ....

 
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
The applet does nothing by itself - what did you expect? If you're performing any UI actions, tell us what those are, what you expected to happen in response, and what actually happened.

By the way, this:

is almost never a good idea. At least print a message somewhere that an exception occurred.
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
After you load the data, you need to tell your canvas to draw the graphs. Invoke a repaint() on it.

Canvas is an AWT component. JApplet is a swing component. You will be better off using JPanel instead of Canvas. In case of Swing components, the recommended way is to override paintComponent() instead of paint()
 
vishnu vardhan brundavanam
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
In this program my intention is to draw a graph with the help of GUI. Means when i click "load file"menuitem it should tacke a file and should draw a graph with the value which are in that file...
When i'm clicking "Load flie" menuitem,it is tacking file,but not drawing graph....that is my problem....
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

Maneesh Godbole wrote:After you load the data, you need to tell your canvas to draw the graphs. Invoke a repaint() on it.

 
What's that smell? I think this tiny ad may have stepped in something.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
    Bookmark Topic Watch Topic
  • New Topic