1

Hi have a Swing User Interface composed by 4 different plots (extensions of javax.swing.JPanel). One of these plots is built using jzy3d 1.0.0 library and returns a component of type CanvasNewtAwt (extension of java.awt.Panel). So that I have a java.awt.Panel inside my usual javax.Swing.Panel.

The problem is that when I load the glass pane, since it is an instance of javax.swing.JPanel, the AWT component remain on top of it.

Is there any way to avoid this? If I create a new glass pane which extends java.awt.Panel I'm able to cover all of the plots but not able to make the glass pane translucent. So If I fix the translucency problem (using a swing panel), I'm not able to cover the awt component, but If I use an awt panel, I have all my frame covered (very unpleasant result). Big deal :)

NOTE: I know that older versions of jzy3d allow to create Swing plots, but Swingclasses are deprecated in newer versions, since they are full of bugs, and replaced with Newt components.

Roberto
  • 243
  • 1
  • 5
  • 15
  • com.jogamp.newt.awt.NewtCanvasAWT extends java.awt.Canvas. Do you reproduce this behaviour under several operating systems? – gouessej Sep 06 '16 at 10:38
  • I have the chance to try only on Windows10. Anyway, `org.jzy3d.plot3d.rendering.canvas.CanvasNewtAwt` extends `java.awt.Panel` ([API](http://doc.jzy3d.org/javadoc/0.9.1/jzy3d-api/org/jzy3d/plot3d/rendering/canvas/CanvasNewtAwt.html)). I solved by hiding the `org.jzy3d.chart.Chart` when `Swing` glass pane is displayed and drawing a snapshot in place of it using the `paint()` method of the `javax.swing.JPanel` which contains the chart. But I was wondering if there is a better way to handle these situations. – Roberto Sep 06 '16 at 10:47
  • I don't contradict you, I know that org.jzy3d.plot3d.rendering.canvas.CanvasNewtAwt which is a java.awt.Panel wraps a com.jogamp.newt.awt.NewtCanvasAWT which is a java.awt.Canvas. I'll let you know if I find a better solution. – gouessej Sep 08 '16 at 09:57

0 Answers0