Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



-----

The Splash class:

public class SplashWindow extends Window {
   BorderLayout borderLayout1;

   public SplashWindow() {
      super (new Frame());
      try  {
         jbInit();
      }
      catch (Exception e) {
         e.printStackTrace();
      }

      /*
       * Center splash window on screen
       */

      Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
      Dimension splashWindowSize = getSize();
      if (splashWindowSize.height > screenSize.height) {
         splashWindowSize.height = screenSize.height;
      }

      if (splashWindowSize.width > screenSize.width) {
         splashWindowSize.width = screenSize.width;
      }

      setLocation((screenSize.width  - splashWindowSize.width)  / 2,
                  (screenSize.height - splashWindowSize.height) / 2);
      }

   private void jbInit() throws Exception {
      ImageControl imageControl = new ImageControl();
      imageControl.setImageName("images/splash.gif");

      borderLayout1 = (BorderLayout)
Beans.instantiate(getClass().getClassLoader(),
                                     BorderLayout.class.getName());

      this.setSize(new Dimension(298, 198));
      this.setLayout(borderLayout1);
      this.add(imageControl);
   }
}

  -----Original Message-----
  From: Gagan_bhatia [mailto:Gagan_bhatia@xxxxxxxxxxxxxx]
  Sent: Saturday, October 30, 1999 5:10 AM
  To: advanced-java@xxxxxxxxxxxxxxxx
  Subject: Splash Screen in Java


  Hi friends,
      I have one Ques. How to draw Splash Screen in java?
  Gagan



------=_NextPart_000_0013_01BF22C8.FCC33B80
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Splash Screen in Java</TITLE>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D115521918-30101999>A=20
splash screen is just a window, so just draw a window on the =
screen.&nbsp;=20
Here's a partial sample:</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D115521918-30101999></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D115521918-30101999>From=20
the main program:</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; // =
Start Splash=20
window<BR>&nbsp;&nbsp;&nbsp; splash =3D new =
SplashWindow();<BR>&nbsp;&nbsp;&nbsp;=20
splash.pack();<BR>&nbsp;&nbsp;&nbsp; splash.setVisible =
(true);<BR></DIV></FONT>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D115521918-30101999>-----</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D115521918-30101999></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D115521918-30101999>The=20
Splash class:</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D115521918-30101999></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D115521918-30101999>public=20
class SplashWindow extends Window {<BR>&nbsp;&nbsp; BorderLayout=20
borderLayout1;</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D115521918-30101999>&nbsp;&nbsp; public SplashWindow()=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; super (new=20
Frame());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
jbInit();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
catch (Exception e) =
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
e.printStackTrace();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
}</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D115521918-30101999>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
/*<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * Center splash window on=20
screen<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D115521918-30101999>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dimension =
screenSize =3D=20
Toolkit.getDefaultToolkit().getScreenSize();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;=20
Dimension splashWindowSize =3D =
getSize();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if=20
(splashWindowSize.height &gt; screenSize.height)=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
splashWindowSize.height =3D=20
screenSize.height;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
}</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D115521918-30101999>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if=20
(splashWindowSize.width &gt; screenSize.width)=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
splashWindowSize.width =3D=20
screenSize.width;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
}</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D115521918-30101999>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
setLocation((screenSize.width&nbsp; - splashWindowSize.width)&nbsp; /=20
2,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
(screenSize.height - splashWindowSize.height) /=20
2);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D115521918-30101999>&nbsp;&nbsp; private void jbInit() throws =
Exception=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ImageControl imageControl =3D new=20
ImageControl();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
imageControl.setImageName("images/splash.gif");</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D115521918-30101999>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; borderLayout1 =
=3D=20
(BorderLayout)=20
Beans.instantiate(getClass().getClassLoader(),<BR>&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
BorderLayout.class.getName());</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D115521918-30101999>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
this.setSize(new=20
Dimension(298, 198));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
this.setLayout(borderLayout1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
this.add(imageControl);<BR>&nbsp;&nbsp; }<BR>}<BR></SPAN></FONT></DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: =
0px; PADDING-LEFT: 5px">
  <DIV align=3Dleft class=3DOutlookMessageHeader dir=3Dltr><FONT =
face=3DTahoma=20
  size=3D2>-----Original Message-----<BR><B>From:</B> Gagan_bhatia=20
  [mailto:Gagan_bhatia@xxxxxxxxxxxxxx]<BR><B>Sent:</B> Saturday, October =
30,=20
  1999 5:10 AM<BR><B>To:</B> =
advanced-java@xxxxxxxxxxxxxxxx<BR><B>Subject:</B>=20
  Splash Screen in Java<BR><BR></DIV></FONT>
  <P><FONT face=3DArial size=3D2>Hi friends, </FONT><BR><FONT =
face=3DArial=20
  size=3D2>&nbsp;&nbsp;&nbsp; I have one Ques. How to draw Splash Screen =
in=20
  java?</FONT> <BR><FONT face=3DArial size=3D2>Gagan</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>&nbsp;</FONT> </P></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0013_01BF22C8.FCC33B80--


---
To unsubscribe, mail advanced-java-unsubscribe@xxxxxxxxxxxxxxxx
To get help, mail advanced-java-help@xxxxxxxxxxxxxxxx