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. =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> </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> // =
Start Splash=20
window<BR> splash =3D new =
SplashWindow();<BR> =20
splash.pack();<BR> 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> </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> </DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D115521918-30101999>public=20
class SplashWindow extends Window {<BR> BorderLayout=20
borderLayout1;</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D115521918-30101999> public SplashWindow()=20
{<BR> super (new=20
Frame());<BR> try =20
{<BR> =20
jbInit();<BR> =
}<BR> =20
catch (Exception e) =
{<BR> =20
e.printStackTrace();<BR> =
}</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D115521918-30101999> =20
/*<BR> * Center splash window on=20
screen<BR> */</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D115521918-30101999> Dimension =
screenSize =3D=20
Toolkit.getDefaultToolkit().getScreenSize();<BR> &=
nbsp;=20
Dimension splashWindowSize =3D =
getSize();<BR> if=20
(splashWindowSize.height > screenSize.height)=20
{<BR> =
splashWindowSize.height =3D=20
screenSize.height;<BR> =
}</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D115521918-30101999> if=20
(splashWindowSize.width > screenSize.width)=20
{<BR> =
splashWindowSize.width =3D=20
screenSize.width;<BR> =
}</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D115521918-30101999> =20
setLocation((screenSize.width - splashWindowSize.width) /=20
2,<BR> &=
nbsp; =20
(screenSize.height - splashWindowSize.height) /=20
2);<BR> }</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D115521918-30101999> private void jbInit() throws =
Exception=20
{<BR> ImageControl imageControl =3D new=20
ImageControl();<BR> =20
imageControl.setImageName("images/splash.gif");</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D115521918-30101999> borderLayout1 =
=3D=20
(BorderLayout)=20
Beans.instantiate(getClass().getClassLoader(),<BR>  =
; =
&=
nbsp; =20
BorderLayout.class.getName());</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D115521918-30101999> =
this.setSize(new=20
Dimension(298, 198));<BR> =20
this.setLayout(borderLayout1);<BR> =20
this.add(imageControl);<BR> }<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> 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> </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
- Prev by Date: ResultSet.getStatement()
- Previous by thread: ResultSet.getStatement()
- Index(es):