On Mon, 20 Jun 2005 13:24:01 GMT, Dimitris (GIS) wrote:
> I have a frame with a awt.List and a awt.Canvas
I have rarely found uses for the Canvas class.
Even image rendering is generally simpler to do on a Component.
> I want by selecting diferent elements from the list to change my canvas
> picture.
> How can I do it?
- Use a number of Canvas's in a CardLayout, and flip
between them.
- Alternately, you might try refreshing the current Canvas
by either it's own methods (I am not that familiar with
them - check the API docs) or by instantiating a fresh
Canvas and refreshing the GUI.
> I try this but it gives me NullPointerException:
> if(simList.getSelectedIndex()==0){
> ImageCanvas ic=new ImageCanvas("image.jpg");
> simPicture.update(ic);
> }
It sounds as though you are trying the second method
mentioned above, but (shrug) I cannot do much with
code snippets[1] and vague descriptions of errors[2].
[1] <http://www.physci.org/codes/sscce.jsp>
[2] <http://www.physci.org/codes/javafaq.jsp#exact>

Signature
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
Dimitris \(GIS\) - 21 Jun 2005 20:55 GMT
Thank you Andrew
> On Mon, 20 Jun 2005 13:24:01 GMT, Dimitris (GIS) wrote:
>
[quoted text clipped - 27 lines]
> [1] <http://www.physci.org/codes/sscce.jsp>
> [2] <http://www.physci.org/codes/javafaq.jsp#exact>
Andrew Thompson - 22 Jun 2005 05:42 GMT
On Tue, 21 Jun 2005 19:55:43 GMT, Dimitris (GIS) wrote:
> Thank you Andrew
You're welcome.. By the way - did you solve the problem?

Signature
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane