Splash
{
int XMAX = 112;
float[] m_Height = new float[XMAX] ; //current height
float[] m_G = new float[XMAX] ; //move value before
float b = 1.01f ; //load factor
float fWeight = 3 ; //wave speed
public void paint(Graphics g)
{
int i ;
float a, w3, w3_2 ;
float fWk ;
g.setColor( Color.blue ) ;
w3 = 3 * fWeight ;
w3_2 = w3 - 2 ;
m_Height[0] = m_Height[1] ;
m_Height[(XMAX-1)] = m_Height[(XMAX-2)] ;
a = m_Height[0] ;
for ( i = 1 ; i < (XMAX-1) ; i++ ) {
fWk = ((a + w3_2 * m_Height[i] + m_Height[i+1]) / w3 + m_G[i]) / b ;
a = m_Height[i] ;
m_G[i] = fWk - a ;
m_Height[i] = fWk ;
g.clearRect( (i-1)*4, (int)fWk-30, 4, 60 ) ;
g.fillRect( (i-1)*4, (int)fWk+30, 4, 60 ) ;
}
}
public void update(Graphics g)
{
paint(g);
}
}
Back to the Splash applet page
|
New on the Java Boutique:
New Article:
Servlets and JSP
In addition to applets, applications, servlets, and articles, we are now accepting submissions of JSP snippets! If you have a piece of JSP code that you think would be useful to others, then send it in!
... [Submissions]
New Tutorial:
Introduction to Java Part 6:
Building Your First Application
Selena Sol goes through all the Java code and HTML necessary to create a java application.
... [more Tutorials]
Year in Review:
The Best of 1999
Y2K has come and gone and now we have a chance to look back over the past year.
In 1999 we posted over 250 applets, servlets, applications, and tools.
In this list are the 24 most popular apps from 1999.
... [popular applets]
Elsewhere on internet.com:
WebDeveloper Java
Lots of Java information on webdeveloper.com
WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.
ScriptSearch Java
100s of free Java code files to download.
Copyright 1999-2000 internet.com Corp.
All Rights Reserved. Legal Notices.
|