I'm trying to create a Line Graph, I've tried using a JPanel within a JFrame and the basic graph is ok, however I cannot display information at the side of the graph, such as x and y axis, as well as numbers 0, 1, 2 etc...
How can this be solved??
The simplest way to use this is to use a Java library built for creating these types of graphs such as JFreeChart (I think is the name). If this option isn't viable, for instance if this is for a school project and you will have to write the code yourself, then you're going to have to do just that: write code that displays such text on the sides of the Graph often using the methods that are available to you in the Graphics and Graphics2D libraries.
A Graphics object can draw entire Strings (see the API documentation for that class). You can draw the appropriate Strings at the appropriate location.
Originally Posted by larry_d1990