文本/图标/ JLabel消失在Gif背景上

时间:2015-07-08 22:32:10

标签: java swing user-interface gif

Java表格加载了gif背景播放但是任何覆盖它的图像和文本只会显示几秒钟才能永久消失。该表单是使用Netbeans表单构建器在null布局中构建的,其底部是gif作为JLabel,上面有许多文本和图像。

gif相当大,大约350mb

 BPanel = new javax.swing.JPanel();
        Board = new javax.swing.JLabel();
BPanel.setPreferredSize(new java.awt.Dimension(1156, 786));
        Board.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Resources/Game_2.gif"))); // NOI18N
        Board.setToolTipText("");
        Board.setAlignmentY(0.0F);

        javax.swing.GroupLayout BPanelLayout = new javax.swing.GroupLayout(BPanel);
        BPanel.setLayout(BPanelLayout);
        BPanelLayout.setHorizontalGroup(
            BPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(BPanelLayout.createSequentialGroup()
                .addComponent(Board)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        BPanelLayout.setVerticalGroup(
            BPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(Board, javax.swing.GroupLayout.DEFAULT_SIZE, 910, Short.MAX_VALUE)
        );

        getContentPane().add(BPanel);
        BPanel.setBounds(0, 0, 1600, 910);

        setSize(new java.awt.Dimension(1616, 944));
        setLocationRelativeTo(null);

0 个答案:

没有答案