I've been trying to create a splash screen for my
application all day and am not having any luck with it
displaying my graphics. I've tried everything off of sun's
site, tutorials and asked friends.

Are there known problems with displaying graphics on linux
with jdk1.2prev2 glibc2.1 version?

I will attach my two classes. If anyone could take a look
that would be great.

I have tried using JLabels, Images, ImageIcons.. and nothing
seems to work.

--
[      Riyad Kalla      ]
[   [EMAIL PROTECTED]   ]
[       CS - Major      ]
[ University of Arizona ]


/******************************************************
 * @author Riyad Kalla
 * @version 1.0
 *
 * Name: Riyad Kalla
 * File: SplashPanel.java
 * created 22-Oct-99 7:51:53 PM by rsk
 * 
 * Description:
 *      This panel was created to extend JPanel and paint the initial
 *      splash screen.
 */

package WebNuts.UI;

import java.awt.image.*;
import java.awt.*;
import javax.swing.*;

public class SplashPanel extends JPanel
{
    // Private Class Variables
    private static Image splashImage = null;
    
    public SplashPanel()
    {
        splashImage = Toolkit.getDefaultToolkit().getImage( "images/Splash.gif" );
        MediaTracker imageTracker = new MediaTracker( this );
        
        imageTracker.addImage( splashImage, 0 );
        
        try
        {
            imageTracker.waitForID( 0 );
        }
        catch( Exception e )
        {
            System.out.println( "Image Loading Failed" );
            System.out.println( "Error: " + e );
        }
    }
    
    public void paintComponent( Graphics g )
    {
        super.paint( g );
        g.drawImage( splashImage, 0, 0, this );
    }
}
/******************************************************
 * @author Riyad Kalla
 * @version 1.0
 *
 * Name: Riyad Kalla
 * File: SplashScreen.java
 * created 22-Oct-99 3:28:05 PM by rsk
 * 
 * Description:
 */

package WebNuts.UI;

import javax.swing.*;
import java.awt.*;

public class SplashScreen extends JWindow
{
    // Private Class Variables
    int screenHeight = 0;
    int screenWidth = 0;
    SplashPanel splashPanel = null;
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    
    public SplashScreen()
    {
        // Instantiate GUI components
        super();
        splashPanel = new SplashPanel();
        screenHeight = (int)screenSize.getHeight();
        screenWidth = (int)screenSize.getWidth();
    
        // Configure GUI components
        setSize( new Dimension( 336, 215 ) );
        setLocation( ( screenWidth / 2 ) - 170, ( screenHeight / 2 ) - 107 );
        getContentPane().setLayout( new BorderLayout() );       
        setVisible( true );
        splashPanel.setPreferredSize( new Dimension( 336, 215 ) );
        
        // Add all GUI components to respective containers
        setContentPane( splashPanel );
        splashPanel.validate();
        show();
    }
}

Reply via email to