On Oct 15, 2005, at 3:01 PM, Bhaskar, KS wrote: On my win xp machine, the splash screen goes to the background. Under wine, it stays on top, so yes, it is a wine issue. /** Splash.java * Show splash screen * @author Greg Woodhouse */ //package triton; import java.awt.*; import javax.swing.*; public class SplashScreen extends JWindow { public SplashScreen() { JPanel content = (JPanel)getContentPane(); //Center the window int width = 400; int height = 350; Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); int x = (screen.width - width)/2; int y = (screen.height - height)/2; setBounds(x, y, width, height); //Build the splash screen content.setLayout(new BorderLayout()); JLabel logo = new JLabel(new ImageIcon("Triton.png")); JPanel logoPane = new JPanel(); logoPane.setLayout(new BorderLayout()); logoPane.add(logo, BorderLayout.CENTER); //Use separate panels to simplify layout JPanel infoPane = new JPanel(); JTextArea info = new JTextArea("Triton\n" + "version 0.1\n\n" + "This version is a prototype only."); info.setEditable(false); //Use the same background as the container info.setBackground(content.getBackground()); infoPane.add(info); content.add(logoPane, BorderLayout.CENTER); content.add(infoPane, BorderLayout.SOUTH); } public void showSplash() { setVisible(true); } public void hideSplash() { setVisible(false); } } and here is code from the main class that displays the splash screen public static void main(String argv[]) { SplashScreen splash = new SplashScreen(); splash.showSplash(); //Do setup work here Triton frame = new Triton(); //wait 2 seconds try { Thread.sleep(2000); } catch (Exception ex) { } splash.hideSplash(); splash = null; //no longer needed //use EXIT_ON_CLOSE to allow user to quit application by closing window frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); frame.setSize(760,500); frame.setVisible(true); } === Gregory Woodhouse "Nothing is as powerful than an idea whose time has come." -- Victor Hugo |
- Re: [Hardhats-members] Turning off CPRS splash screen Gregory Woodhouse
- RE: [Hardhats-members] Turning off CPRS splash sc... Bhaskar, KS
- Re: [Hardhats-members] Turning off CPRS splas... Gregory Woodhouse
- Re: [Hardhats-members] Turning off CPRS s... Gregory Woodhouse
- Re: [Hardhats-members] Turning off CPRS s... Kevin Toppenberg
- Re: [Hardhats-members] Turning off CP... Gregory Woodhouse
- [Hardhats-members] Turning off CPRS s... John Leo Zimmer
- Re: [Hardhats-members] Turning o... Kevin Toppenberg
- Re: [Hardhats-members] Turning off CP... Nancy Anthracite
- Re: [Hardhats-members] Turning o... Kevin Toppenberg
- Re: [Hardhats-members] Turni... Stephen K. Miyasato