Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with graphing program

 
Bill Cappoli
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a program that requests a series of numbers from the user. Once everything is inputted the frequency of each number within a range is supposed to be graphed in a JFrame. The graph basically would show on the y-axis the ranges, ie 10-19, 0-9, and the x-axis would show the number falling into each range using a rectangle coming out of the location of the range on the y-axis. I have been able to program everything from the input to the actual bar graph. My problem is I have been unable to put the finishing touches on the graph which are the title, the axis labels, and the labels for the data. I have tried some things with Swing and AWT but with my newbie understanding of Java the results were not good. Here is the code I already have:





 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"SilentCodingOne,"

Welcome to JavaRanch! Please check your private messages by clicking on My Private Messages. Thanks!
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bill Cappoli:
... My problem is I have been unable to put the finishing touches on the graph which are the title, the axis labels, and the labels for the data...

Currently, your JFrame contains only a JPanel. It sounds like you want to add some JLabels alongside your JPanel. In doing this, you might want to look at Laying Out Components Within a Container from the Swing Tutorial.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic