Drawing a picture ?

Hi all,

As a beginner I want to set up (create) a Bean able to create picture (using AWT) as a Pie Chart ?

But anyway I don't know how to approach this kind of problem. I did a bean that return simple HTML bar chart (which is not using AWT classes), but it's more difficult to create oie chart.

Any kind of help will be precious

And i would be grateful

Thanks in advance

STF

[440 byte] By [stfohr] at [2007-9-26 2:44:48]
# 1

The thing you waint to do is impossible for a bean.

A bean is a java code loaded by the server, generating an info or updating something that can be returned to the clien b a servlet or a jsp.

Note that a servlet or a jsp generate html code, and then yo can't generate an image to be viewed by the client, because all work that you can do by awt, can be putted in any container to be viewed!!!!

If you want to generate an image to be viewed by html... you only have two possibilities

1-If you work by beans, load the pictures with html code (that can generate the bean BEFORE it is loaded by the client...)

2-Work with APPLETS, because this is one of his capacibilities.

I recomend you to try the java samples that go with the jdk.

And sorry for my bad english

JPons at 2007-6-29 10:25:37 > top of Java-index,Desktop,Developing for the Desktop...
# 2
Here is an article which explains how to generate images from servlets: http://www.javaworld.com/javaworld/jw-05-2000/jw-0505-servlets.htmlI believe it also contains a pie-chart example with code.
ashutosh at 2007-6-29 10:25:37 > top of Java-index,Desktop,Developing for the Desktop...
# 3

Hi ashutosh,

Sorry for the reward, but I'm not able to reward this thread. I get a error message when pressing the hyperlink reward as Unable to display the page.

By the way thanks a lot for your help.

I've found a issue on my own concisting in returning the browser's compiled plug-in tag (which load a applet) string by the bean. Thanks to this i'm able to give dynamic parameter to the applet. The only "bad point" is that the client need the JRE plug in.

I will try to reward this thread again later (problem may be fix).

stfohr at 2007-6-29 10:25:37 > top of Java-index,Desktop,Developing for the Desktop...