Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jFlashPlayer不适用于glassPane、Java_Java_Jpanel_Paintcomponent_Glasspane_Jwindow - Fatal编程技术网

jFlashPlayer不适用于glassPane、Java

jFlashPlayer不适用于glassPane、Java,java,jpanel,paintcomponent,glasspane,jwindow,Java,Jpanel,Paintcomponent,Glasspane,Jwindow,我与jFlashPlayer合作(目前已被VersaEdge软件终止) 我正在jWindow中显示FlashPanel,并希望在其上放置一个玻璃窗格,以便在flash图像上绘制,但当FlashPanel可见时,玻璃窗格不工作。当闪光灯面板不可见/未启动时,玻璃窗格工作正常 守则的有关部分如下: public displayWindow() throws AWTException{ showOnScreen(1, this); createFlashPanel();

我与jFlashPlayer合作(目前已被VersaEdge软件终止)

我正在jWindow中显示FlashPanel,并希望在其上放置一个玻璃窗格,以便在flash图像上绘制,但当FlashPanel可见时,玻璃窗格不工作。当闪光灯面板不可见/未启动时,玻璃窗格工作正常

守则的有关部分如下:

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);
}
在哪里

(直接取自其提供的示例)以及

publicstaticvoidshowOnScreenn(int-screen,displayWindow-displayWindow)
{
GraphicsEnvironment ge=GraphicsEnvironment
.getLocalGraphicsEnvironment();
GraphicsDevice[]gs=ge.getScreenDevices();
如果(屏幕>-1&&screen0)
{
gs[0].setFullScreenWindow(显示窗口);
}
其他的
{
抛出新的RuntimeException(“未找到屏幕”);
}
}
此代码在两个监视器上运行。一个监视器用于控制闪存文件(代码未显示),另一个监视器(此监视器)用于显示闪存文件。glassPane可以在另一个监视器上正常工作,如果FlashPanel未启动/不可见,则可以在此监视器上工作

flash文件运行良好,使用提供的代码可以正常工作-这不是我的问题

jFlashPlayer的所有支持文件(库等)的副本可在以下位置找到:


提前谢谢

很可能flash player嵌入了一个重量级组件中,这与轻量级组件的性能不太好(z-排序只是问题之一)是的,我尝试了z-排序,但因为非法定位而收到了一些错误!我的最佳解决方案是拍摄闪光灯框架的屏幕快照,隐藏闪光灯面板,然后在玻璃窗格下方显示我刚刚拍摄的图像。当我在玻璃窗格上画画时,这种方法不允许flash继续播放,但这不是当前所需的,所以可以这样做。
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");    
}
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" );
    }
}