From b2444dae513e881a3323e23915f8644f10b42bc7 Mon Sep 17 00:00:00 2001 From: benfry Date: Wed, 30 Jul 2003 00:24:31 +0000 Subject: [PATCH] splash screen --- processing/app/PdeBase.java | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/processing/app/PdeBase.java b/processing/app/PdeBase.java index 8699eb699..41615d55d 100644 --- a/processing/app/PdeBase.java +++ b/processing/app/PdeBase.java @@ -865,7 +865,23 @@ public class PdeBase extends Frame // so used internally for everything else public void handleAbout() { - System.out.println("the about box will now be shown"); + //System.out.println("the about box will now be shown"); + final Image image = getImage("about.jpg", this); + int w = image.getWidth(this); + int h = image.getHeight(this); + final Window window = new Window(this) { + public void paint(Graphics g) { + g.drawImage(image, 0, 0, null); + } + }; + window.addMouseListener(new MouseAdapter() { + public void mousePressed(MouseEvent e) { + window.dispose(); + } + }); + Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); + window.setBounds((screen.width-w)/2, (screen.height-h)/2, w, h); + window.show(); } public void handlePrefs() { @@ -937,6 +953,9 @@ public class PdeBase extends Frame } else if (command.equals("Reference")) { openURL(System.getProperty("user.dir") + File.separator + "reference" + File.separator + "index.html"); + + } else if (command.equals("About Processing")) { + handleAbout(); } }