All source code in Java/ Javascript Ask a Java/ Javascript Pro Discussion Forum Categories All jobs in Java/ Javascript
spice,your,page,Comments,FrenchWritten
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Java/ Javascript Stats

 Code: 477,530. lines
 Jobs: 189. postings

 How to support the site

 
Sponsored by:
Quick Search for:  in language:    
You are in:
 
Login





Latest postings for Java/ Javascript.
Click here to see a screenshot of this code!A dou browser proccessor created by rod lewis 2009 copyright :google vs Bing
By ROD LEWIS on 11/17

(Screen Shot)

Click here to see a screenshot of this code!Glossary to pdf Beta 2009 by rod lewis
By ROD LEWIS on 11/16

(Screen Shot)

SimpleDateForma t
By Jerome Scott II on 11/15


Regular Expression example
By Jerome Scott II on 11/13


Click here to see a screenshot of this code!Graffiti Tag Generator
By LazyEye on 11/10

(Screen Shot)

Eratosthenes Sieve
By Aaron Welch on 11/10


Click here to see a screenshot of this code!ANY .JSPLAYER FOR WORD OR OFFICE TYPE EDITORS AND SNOW WORD BETA
By ROD LEWIS on 11/9

(Screen Shot)

CronJob
By Ogbole A. Israel on 11/9


How to create movie from images in java.
By Amit Kumar Gaur on 11/6


Click here to see a screenshot of this code!Sorting Array
By Bersales Japheth Cojena on 11/4

(Screen Shot)

Click here to see a screenshot of this code!Skinnable Frame
By Bersales Japheth Cojena on 11/4

(Screen Shot)

Click here to see a screenshot of this code!Window Border
By Bersales Japheth Cojena on 11/4

(Screen Shot)

Click here to see a screenshot of this code!Custom Cell Renderer
By Bersales Japheth Cojena on 11/4

(Screen Shot)

Click here to see a screenshot of this code!Link List
By Bersales Japheth Cojena on 11/4

(Screen Shot)

Click here to see a screenshot of this code!Heap Sort
By Bersales Japheth Cojena on 11/4

(Screen Shot)

Click here to see a screenshot of this code!Hash Table
By Bersales Japheth Cojena on 11/4

(Screen Shot)

Click here to see a screenshot of this code!Red Balck Tree
By Bersales Japheth Cojena on 11/4

(Screen Shot)

Click here to see a screenshot of this code!Binary
By Bersales Japheth Cojena on 11/4

(Screen Shot)

Click here to see a screenshot of this code!Linked List
By Bersales Japheth Cojena on 11/4

(Screen Shot)

Click here to see a screenshot of this code!Queue
By Bersales Japheth Cojena on 11/4

(Screen Shot)

Click here to see a screenshot of this code!Stack
By Bersales Japheth Cojena on 11/4

(Screen Shot)

Click here to see a screenshot of this code!Minesweeper
By Michael A. Delfino on 11/4

(Screen Shot)

Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!



 
 
   

Funky animated Java Banner

Print
Email
 
VB icon
Submitted on: 1/9/1999
By: Found on the Web 
Level: Not Given
User Rating: By 102 Users
Compatibility:Java (JDK 1.1)

Users have accessed this code 19867 times.
 
 
     To spice up your web page. Comments are in French Written by:http://www.nctech.fr/Zimmermann/public-html/Applets/Animation/AnimCercles.html
 

HTML:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!

//**************************************
//     
//HTML for :Funky animated Java Banner
//**************************************
//     
<APPLET CODE="AnimCercles.class" 
WIDTH="350" HEIGHT="180" ALIGN="BOTTOM">
<PARAM NAME="bgColor" VALUE="blue">
<PARAM NAME="fgColor" VALUE="green">
<PARAM NAME="bgType" VALUE="Oval">
<PARAM NAME="text" VALUE="Java !!!">
<PARAM NAME="url" VALUE="http://www.nctech.fr/">
<PARAM NAME="font" VALUE="TimesRoman">
<PARAM NAME="style" VALUE="BOLDITALIC">
<PARAM NAME="textColor" VALUE="red">
<PARAM NAME="size" VALUE="95">
<PARAM NAME="playBack" VALUE="0">
<PARAM NAME="step" VALUE="12">
<PARAM NAME="timeSleep" VALUE="30">
</APPLET>
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!

//**************************************
//     
// Name: Funky animated Java Banner
// Description:To spice up your web page
//     . Comments are in French
Written by:http://www.nctech.fr/Zimmermann/public-html/Applets/Animation/AnimCercles.html
// By: Found on the Web
//**************************************
//     

import java.awt.*;
import java.util.StringTokenizer;
/** Affiche un message sur un fond de cercles concentriques animes.
*	Vos remarques a vincent.zimmermann@nctech.fr
*	Utilisable librement.
*
*	Exemple d'utilisation dans une page HTML :
*	<APPLET CODE="AnimCercles.class" WIDTH=350 HEIGHT=200>
*	<PARAM NAME="bgColor" VALUE="blue">
*	<PARAM NAME="fgColor" VALUE="green">
*	<PARAM NAME="bgType" VALUE="RoundRect">
*	<PARAM NAME="cornerX" VALUE="35">
*	<PARAM NAME="cornerY" VALUE="25">
*	<PARAM NAME="text" VALUE="Java !!!">
*	<PARAM NAME="font" VALUE="TimesRoman">
*	<PARAM NAME="style" VALUE="BOLD">
*	<PARAM NAME="textColor" VALUE="red">
*	<PARAM NAME="size" VALUE="90">
*	<PARAM NAME="playBack" VALUE="0">
*	<PARAM NAME="step" VALUE="10">
*	<PARAM NAME="timeSleep" VALUE="15">
*	Il aurait du y avoir une applet ici si votre Browser avait supporte Java...
*	</APPLET>
*
*	Explications :
*	 font : Helvetica, TimesRoman, Courier, Dialog
*	 style : PLAIN, BOLD, ITALIC, BOLDITALIC
*	 bgColor & fgColor : white, black, lightGray, gray, darkGray, red, green, 
*& textColor blue, yellow, magenta, cyan, pink, orange
*	 (RGB): 255:255:255
*	 (RGB): 255,255,255
*	 (RGB): 255.255.255
*	playBack : 0 ou 1
*	bgType : Oval, Rect, RoundRect
*	et pour le RoundRect, specifier le format du coin arrondis (cornerX, cornerY)
*
*/
public class AnimCercles extends java.applet.Applet implements Runnable


    {
    	// On cree un Thread pour l'applet
    	Thread runner;
    	// Le message
    	String text;
    	
    	// La police du message
    	Font f;
    	String fontString;
    	int style;
    	int size;
    	Color textColor;
    	
    	// Position du message
    	int x;
    	int y;
    	// Taille de l'ecran
    	int width;
    	int height;
    	
    	// Le max entre width et height.
    	int max;
    	// Pour le double buffering (eviter les scintillements)
    	Image offscreenImg;
    	Graphics offscreenG;
    	
    	// Les fonds de l'ecran (pour gagner en rapidite dans l'anim)
    	Image[] fondEcran = new Image[6];
    	Graphics[] fondEcranG = new Graphics[6];
    	// Couleur du fond
    	Color bgColor;
    	Color fgColor;
    	
    	// Le type de motif du fond (Oval, Rect, RoundRect)
    	String bgType;
    	
    	// Dans le cas d'un RoundRect, la taille de l'arrondis
    	int cornerX;
    	int cornerY;
    	
    	// Decalage entre 2 cerles
    	int step;
    	
    	// Temps d'attente entre chaque plans de l'animation
    	int timeSleep;
    	
    	// L'animation fait un aller retour si playBack = 1
    	int playBack;
    	// Pour la gestion des couleurs RGB
    String rgbDelimiter = ":,.";
    StringTokenizer st;
    	public void init()


        	{
        		// Recuperation des parametres de l'Applet
        		String s;
        		Integer intObj;
        		
        		// Pour obtenir la taille de l'Applet en pixels.
        try


            {
            intObj = new Integer(getParameter("width"));
            width = intObj.intValue();
        } 

catch (Exception e) { width = 300; }
try { intObj = new Integer(getParameter("height")); height = intObj.intValue(); }
catch (Exception e) { height = 100; }
s = getParameter("bgType"); if (s == null) bgType = "Oval"; else if (s.equalsIgnoreCase("Rect")) bgType = "Rect"; else if (s.equalsIgnoreCase("RoundRect")) bgType = "RoundRect"; else bgType = "Oval"; try { intObj = new Integer(getParameter("cornerX")); cornerX = intObj.intValue(); }
catch (Exception e) { cornerX = 25; }
try { intObj = new Integer(getParameter("cornerY")); cornerY = intObj.intValue(); }
catch (Exception e) { cornerY = 25; }
text = getParameter("text"); if (text == null) text = "NCTech !"; s = getParameter("font"); if (s == null) fontString = "TimesRoman"; else if (s.equalsIgnoreCase("TimesRoman")) fontString = "TimesRoman"; else if (s.equalsIgnoreCase("Courier")) fontString = "Courier"; else if (s.equalsIgnoreCase("Helvetica")) fontString = "Helvetica"; else if (s.equalsIgnoreCase("Dialog")) fontString = "Dialog"; else fontString = "TimesRoman"; s = getParameter("style"); if (s == null) style = Font.PLAIN; else if (s.equalsIgnoreCase("PLAIN")) style = Font.PLAIN; else if (s.equalsIgnoreCase("BOLD")) style = Font.BOLD; else if (s.equalsIgnoreCase("ITALIC")) style = Font.ITALIC; else if (s.equalsIgnoreCase("BOLDITALIC") || s.equalsIgnoreCase("ITALICBOLD")) style = Font.BOLD + Font.ITALIC; else style = Font.PLAIN; try { intObj = new Integer(getParameter("size")); size = intObj.intValue(); }
catch (Exception e) { size = 20; }
s = getParameter("textColor"); if (s != null) st = new StringTokenizer(s, rgbDelimiter); if (s == null) textColor = Color.lightGray; else if (s.equalsIgnoreCase("white")) textColor = Color.white; else if (s.equalsIgnoreCase("black")) textColor = Color.black; else if (s.equalsIgnoreCase("lightGray")) textColor = Color.lightGray; else if (s.equalsIgnoreCase("gray")) textColor = Color.gray; else if (s.equalsIgnoreCase("darkGray")) textColor = Color.darkGray; else if (s.equalsIgnoreCase("red")) textColor = Color.red; else if (s.equalsIgnoreCase("green")) textColor = Color.green; else if (s.equalsIgnoreCase("blue")) textColor = Color.blue; else if (s.equalsIgnoreCase("magenta")) textColor = Color.magenta; else if (s.equalsIgnoreCase("cyan")) textColor = Color.cyan; else if (s.equalsIgnoreCase("pink")) textColor = Color.pink; else if (s.equalsIgnoreCase("orange")) textColor = Color.orange; else if (st.countTokens() == 3) { Integer r = new Integer(st.nextToken()); Integer g = new Integer(st.nextToken()); Integer b = new Integer(st.nextToken()); textColor = new Color(r.intValue(), g.intValue(), b.intValue()); } else
textColor = Color.yellow; try { intObj = new Integer(getParameter("step")); step = intObj.intValue(); }
catch (Exception e) { step = 5; }
try { intObj = new Integer(getParameter("timeSleep")); timeSleep = intObj.intValue(); }
catch (Exception e) { timeSleep = 10; }
try { intObj = new Integer(getParameter("playBack")); playBack = intObj.intValue(); }
catch (Exception e) { playBack = 1; }
s = getParameter("bgColor"); if (s != null) st = new StringTokenizer(s, rgbDelimiter); if (s == null) bgColor = Color.lightGray; else if (s.equalsIgnoreCase("white")) bgColor = Color.white; else if (s.equalsIgnoreCase("black")) bgColor = Color.black; else if (s.equalsIgnoreCase("gray")) bgColor = Color.gray; else if (s.equalsIgnoreCase("darkGray")) bgColor = Color.darkGray; else if (s.equalsIgnoreCase("red")) bgColor = Color.red; else if (s.equalsIgnoreCase("green")) bgColor = Color.green; else if (s.equalsIgnoreCase("blue")) bgColor = Color.blue; else if (s.equalsIgnoreCase("yellow")) bgColor = Color.yellow; else if (s.equalsIgnoreCase("magenta")) bgColor = Color.magenta; else if (s.equalsIgnoreCase("cyan")) bgColor = Color.cyan; else if (s.equalsIgnoreCase("pink")) bgColor = Color.pink; else if (s.equalsIgnoreCase("orange")) bgColor = Color.orange; else if (st.countTokens() == 3) { Integer r = new Integer(st.nextToken()); Integer g = new Integer(st.nextToken()); Integer b = new Integer(st.nextToken()); bgColor = new Color(r.intValue(), g.intValue(), b.intValue()); } else
bgColor = Color.lightGray; s = getParameter("fgColor"); if (s != null) st = new StringTokenizer(s, rgbDelimiter); if (s == null) fgColor = Color.lightGray; else if (s.equalsIgnoreCase("white")) fgColor = Color.white; else if (s.equalsIgnoreCase("black")) fgColor = Color.black; else if (s.equalsIgnoreCase("lightGray")) fgColor = Color.lightGray; else if (s.equalsIgnoreCase("gray")) fgColor = Color.gray; else if (s.equalsIgnoreCase("darkGray")) fgColor = Color.darkGray; else if (s.equalsIgnoreCase("red")) fgColor = Color.red; else if (s.equalsIgnoreCase("green")) fgColor = Color.green; else if (s.equalsIgnoreCase("blue")) fgColor = Color.blue; else if (s.equalsIgnoreCase("magenta")) fgColor = Color.magenta; else if (s.equalsIgnoreCase("cyan")) fgColor = Color.cyan; else if (s.equalsIgnoreCase("pink")) fgColor = Color.pink; else if (s.equalsIgnoreCase("orange")) fgColor = Color.orange; else if (st.countTokens() == 3) { Integer r = new Integer(st.nextToken()); Integer g = new Integer(st.nextToken()); Integer b = new Integer(st.nextToken()); fgColor = new Color(r.intValue(), g.intValue(), b.intValue()); } else
fgColor = Color.yellow; setBackground(bgColor); f = new Font(fontString, style, size); // Pour un placement correct du message dans la zone d'affichage FontMetrics fm = getFontMetrics(f); int textWidth = fm.stringWidth(text); x = (width - textWidth) / 2; int textHeight = fm.getAscent() + fm.getDescent(); y = (height - textHeight) / 2 + fm.getAscent(); offscreenImg = createImage(width, height); offscreenG = offscreenImg.getGraphics(); offscreenG.setColor(bgColor); offscreenG.fillRect(0, 0, width, height); repaint(); } public void start() { if (runner == null); { runner = new Thread(this); runner.start(); } } public void stop() { if (runner != null) { runner.stop(); runner = null; } } public void createBackground() { boolean switchColor; for (int i=0; i <= 5; i++) { fondEcran[i] = createImage(width, height); fondEcranG[i] = fondEcran[i].getGraphics(); fondEcranG[i].setColor(bgColor); fondEcranG[i].fillRect(0, 0, width, height); switchColor = true; for (int j= max + ((i + 1) * (step / 3)); j >= 0; j -= step) { if (switchColor) { fondEcranG[i].setColor(bgColor); if (bgType.equals("Oval")) fondEcranG[i].fillOval((width - j) / 2, (height - j) / 2, j, j); if (bgType.equals("Rect")) fondEcranG[i].fillRect((width - j) / 2, (height - j) / 2, j, j); if (bgType.equals("RoundRect")) fondEcranG[i].fillRoundRect((width - j) / 2, (height - j) / 2, j, j, cornerX, cornerY); switchColor = false; } else { fondEcranG[i].setColor(fgColor); if (bgType.equals("Oval")) fondEcranG[i].fillOval((width - j) / 2, (height - j) / 2, j, j); if (bgType.equals("Rect")) fondEcranG[i].fillRect((width - j) / 2, (height - j) / 2, j, j); if (bgType.equals("RoundRect")) fondEcranG[i].fillRoundRect((width - j) / 2, (height - j) / 2, j, j, cornerX, cornerY); switchColor = true; } } } } public void run() { if (width > height) max = width; else max = height; max *= Math.sqrt(2); createBackground(); repaint(); offscreenG.setFont(f); offscreenG.setColor(textColor); while (true) { for (int i=0; i <= 5; i++) { offscreenG.drawImage(fondEcran[i], 0, 0, this); offscreenG.drawString(text, x, y); repaint(); try { Thread.sleep(timeSleep); } catch (InterruptedException e) { } } if (playBack == 1) { for (int i=5; i >= 0; i--) { offscreenG.drawImage(fondEcran[i], 0, 0, this); offscreenG.drawString(text, x, y); try { Thread.sleep(timeSleep); } catch (InterruptedException e) { } repaint(); } } } } public void update(Graphics g) { paint(g); } public void paint(Graphics g) { g.drawImage(offscreenImg, 0, 0, this); } public String getAppletInfo() { return "AnimCercles, april 1997, Vincent Zimmermann at NCTech, France"; } }


Other 225 submission(s) by this author

 

 
 Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:
 
Your Vote!

What do you think of this code(in the Not Given category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
9/23/2004 2:06:03 PM

hi~im a newbie for applet java,im going to do my school project,n i have no ideas,i would like to ask u,izzit we can play a flash animation file,in side applet?if can ,could u please teach me?~thanks
(If this comment was disrespectful, please report it.)

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author from the email account you registered on the site, so you can correspond directly.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
To post feedback, first please login.


 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Games | Feedback | Customize | Java/ Javascript Home | Site Home | Other Sites | Open Letter from Moderators | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997-2009 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.   Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. Exhedra solutions has no affiliation with Sun Microsystems, Inc.. Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.