Is there a public library for Java (free) that can be used to display graphs (I am talking about discrete graphs - not bar charts, pie charts, etc...)?
If using Google's Chart API is an option, check out Charts4J.
I use it and have had no problems.
JFreeChart is good.
And if laying out graphs is what you're after, I'd recommend AT&T's graphviz as an alternative. Give it the data and it lays out the graph for you.
JFreeChart. The code is free. You have to pay for the authors docs, but there are plenty of examples around and it's pretty easy to learn to use.
The JUNG (Java Universal Network/Graph Framework) framework allows you to sample their various graphing layouts online. Here is a screen shot of the ShowLayouts2 demo:
Sorry, I misunderstood the question. The thing you are looking for is called JUNG - the Java universal network/graph library. It can store, display and calculate various metrics on sparse or dense graphs. The official site has excellent samples.
Quote from the website above:
"The JUNG architecture is designed to support a variety of representations of entities and their relations, such as directed and undirected graphs, multi-modal graphs, graphs with parallel edges, and hypergraphs. It provides a mechanism for annotating graphs, entities, and relations with metadata. This facilitates the creation of analytic tools for complex data sets that can examine the relations between entities as well as the metadata attached to each entity and relation."
There is a Graphviz library for Java at http://www2.research.att.com/~john/Grappa/. I have used Graphviz for a project in the past to draw graphs and I found it quite easy to use. If you are just looking for a server side solution, then you could just use a standard Graphviz distribution and send it the commands with the "dot" syntax that it uses.