Java vlcj EmbeddedMediaPlayerComponent未调整为原始大小

Java vlcj EmbeddedMediaPlayerComponent未调整为原始大小,java,swing,vlcj,Java,Swing,Vlcj,请看附件中的图片。当窗口在最大化后调整为原始尺寸时,vlcj媒体组件隐藏控制按钮 public class PlayerVLCPanel extends JPanel { private EmbeddedMediaPlayerComponent playerComponent; public PlayerVLCPanel() { this.playerComponent = ComponentStore.getCameraStreamer();

请看附件中的图片。当窗口在最大化后调整为原始尺寸时,vlcj媒体组件隐藏控制按钮

public class PlayerVLCPanel extends JPanel {
    private EmbeddedMediaPlayerComponent playerComponent;

    public PlayerVLCPanel() {
        this.playerComponent = ComponentStore.getCameraStreamer();

        setLayout(new BorderLayout());
        add(this.playerComponent.getVideoSurface(), BorderLayout.CENTER);
    }
}

public class CameraJobControlPanel extends JPanel {
public CameraJobControlPanel() {
DesignGridLayout layout = new DesignGridLayout(this);

    layout.row().grid(expertDnLabel).add(expertDnField);
    layout.row().right().add(startCamButton, stopCamButton, startLazerButton, stopLazerButton).fill();
}
}

public class MainPlayerContainer extends JPanel {
public MainPlayerContainer() {
    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    setBorder(new EmptyBorder(3, 3, 3, 3));

    add(topRegion()); // contains PlayerVLCPanel
    add(bottomRegion()); // contains the Control buttons    
}
}
最后,

JFrame frame = new JFrame("vlcj Testing");
frame.add(new MainPlayerContainer());

frame.setLocation(100, 100);
frame.setSize(1050, 600);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);

我如何防止这种行为?提前感谢。

1要更快获得更好的帮助,请发布一个最简单、完整、可读的示例。最好使用无VLCJ的JSE组件。2始终在setVisibletrue之前立即调用pack,该值应为最后一个。顺便问一下,什么是DesignGridLayout?@andreThompson offtopic,但是否有必要使用“a”?麦克特听起来更好xD@nachokk只要行得通就行。我更喜欢“麦克塔尔”,因为我想到它并在脑海中把它称为麦克塔尔。好吧,要么就是一个没有内容的麦当劳汉堡,也就是一个麦面包。但如果我在脑海中勾选要点,我会像“M-C-T-R-E”一样去做。@AndrewThompson当然,让我创建一个,工作时间一结束就发布。DesignGridLayout是一个布局管理器。