I am working with jFlashPlayer (currently discontinued by VersaEdge Software).
I am displaying the FlashPanel in a jWindow and would like to put a glassPane over it to draw on top of the flash images, but the glassPane does NOT work when the FlashPanel is visible. The glassPane works fine when the FlashPanel is not visible/not initiated.
The pertinent parts of the code are as following:
public displayWindow() throws AWTException{
showOnScreen(1, this);
createFlashPanel();
glass = new JPanel()
{
public void paintComponent(Graphics g)
{
g.setColor(Color.RED);
g.fillOval(point.x, point.y, 10, 10);
}
};
glass.setOpaque(true);
this.setGlassPane(glass);
glass.setVisible(true);
}
where
void createFlashPanel() {
com.jpackages.jflashplayer.FlashPanel.installFlash("6");
String flashVersionRequired = "9";
try {
String flashFilePath = "FarmacistDispensaryWS.swf";
if (!com.jpackages.jflashplayer.FlashPanel.hasFlashVersion("9")) {
flashFilePath = "FarmacistDispensaryWS.swf";
flashVersionRequired = "6";
}
com.jpackages.jflashplayer.FlashPanel.setRequiredFlashVersion(flashVersionRequired);
FlashPanel = new FlashPanel(new File(flashFilePath));
} catch (JFlashLibraryLoadFailedException e) {
exitErrorr("A required library (DLL) is missing or damaged.");
} catch (FileNotFoundException e) {
exitErrorr("Failed to find SWF file specified.");
} catch (JFlashInvalidFlashException e) {
exitErrorr("Required version " + flashVersionRequired + " of Flash is not installed.");
}
this.getContentPane().add(FlashPanel, BorderLayout.CENTER);
FlashPanel.setFlashCallObject(this);
FlashPanel.addFlashPanelListener(this);
FlashPanel.setVariables("myGreeting=hi&myNumber=1&myVar=good%20job");
}
(which is taken directly from their provided example) and
public static void showOnScreenn( int screen, displayWindow displayWindow )
{
GraphicsEnvironment ge = GraphicsEnvironment
.getLocalGraphicsEnvironment();
GraphicsDevice[] gs = ge.getScreenDevices();
if( screen > -1 && screen < gs.length )
{
gs[screen].setFullScreenWindow(displayWindow);
}
else if( gs.length > 0 )
{
gs[0].setFullScreenWindow( displayWindow );
}
else
{
throw new RuntimeException( "No Screens Found" );
}
}
This code runs on two monitors. One monitor for controlling the flash file (code not shown), and the other (this one) for displaying it. The glassPane works on the other monitor fine, and works on this monitor IFF the FlashPanel is not initiated / not visible.
The flash file runs fine and works as expected with the provided code - that is not my issue here.
A copy of all the supporting files for jFlashPlayer (libraries, etc) can be found at http://java-flash-player-jflashplayer.soft32.com
Thanks in advance!