On Monday 10 September 2001 08:25, ���� �������� wrote:
> Hello!
> I have some problems with JSVGCanvas
> When i write:
> /-------------------------------------------------
>         JFrame f = new JFrame("MY FRAME");
>         JSVGCanvas svgCanvas = new JSVGCanvas();
>         f.getContentPane().add(svgCanvas);
>         f.setSize(400, 400);
>         f.setVisible(true);
>         f.show();
>       Graphics2D g = (Graphics2D)svgCanvas.getGraphics();
>       g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
>                            RenderingHints.VALUE_ANTIALIAS_ON);
>
> // and, for example, paint some ellipse
>
>         Ellipse2D ellipse = new Ellipse2D.Float(20, 0, 60, 60);
>         g.setPaint(new Color(176, 22, 40));
>         g.fill(ellipse);
>
>
> /-------------------------------------------------
>
> why the ellipse disappear after any manipulation with the window
> And maybe smth else i should use in the program to view
> a graphical object properly?

The paintComponnet method of the JSVGCanvas just draw a BufferedImage that 
represents your SVG drawing. The size of the image is set according to the 
size of the component. That means that each time, the paintComponent is 
called, the whole surface is covered by the image.

You could draw your stuffs *after* calling super.paintComponent. In that 
case, your drawing will be done on top of the image.

Hope that helps.

Thierry.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to