Very,simple,java,scroller,Applet,Simply,chang
Quick Search for:  in language:    
Very,simple,java,scroller,Applet,Simply,chang
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Java/ Javascript Stats

 Code: 155,451 lines
 Jobs: 364 postings

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for Java/ Javascript.
Protect Your Source Code ??
By christopher.rav en on 10/18


format date
By Sam Collett on 10/18


Click here to see a screenshot of this code!Applicant assessment
By SP Tang on 10/18

(Screen Shot)

Emulated Typewriter
By Mike Powers on 10/17


Click here to see a screenshot of this code!Java-Asp chat
By Paul R. Richards on 10/17

(Screen Shot)

Click here to see a screenshot of this code!The Data Markup Language
By Tanwani Anyangwe on 10/16

(Screen Shot)

ordered binary tree
By Eric Repec InetSolution on 10/16


Infinite tree w/XML
By Eric Repec InetSolution on 10/16


Click here to see a screenshot of this code!Shiznit Javascript Color Picker
By Chris Towers on 10/15

(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!





Affiliate Sites



 
 
   

Easy simple scrolling banner applet

Print
Email
 
VB icon
Submitted on: 9/13/2000 4:05:33 PM
By: Jonathan Barker  
Level: Beginner
User Rating: Unrated
Compatibility:Java (JDK 1.1)

Users have accessed this code 11963 times.
 
 
     A Very simple java scroller Applet. Simply change the internals to make it do what you want!
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

//**************************************
//     
// Name: Easy simple scrolling banner ap
//     plet
// Description:A Very simple java scroll
//     er Applet. Simply change the internals t
//     o make it do what you want!
// By: Jonathan Barker
//
// Inputs:Put a param called message for
//     your message...
//
// Assumes:Compile with sun's javac 1.1 
//     compiler.
//
//This code is copyrighted and has// limited warranties.Please see http://
//     www.Planet-Source-Code.com/xq/ASP/txtCod
//     eId.1957/lngWId.2/qx/vb/scripts/ShowCode
//     .htm//for details.//**************************************
//     

// Cute little scrolling banner...
import java.applet.Applet;
import java.awt.*;
public class scroll extends Applet implements Runnable
    {
    String message;
    Image messageimage;
    Graphics messagegraphics;
    Thread me;
    int xpos;
    int ypos;
    int textwidth;
    	public void init()
        	{
        		setBackground(Color.black); // Background color of applet. try Color.white or Color.red and so on...
        		message = getParameter("message");
        		messageimage = createImage(size().width, size().height);
        		messagegraphics = messageimage.getGraphics();
        		xpos = size().width + 10;
        		ypos = 12; // position to look right
        		textwidth = 7 * message.length();
        		me = new Thread(this);
        		me.start();
        	}
        	public void run()
            	{
                		while(true) {
                			xpos--;
                			if (xpos < -textwidth)
                    			{
                    				xpos = size().width + 10;			
                    			}
                    			try
                        			{
                        			Thread.sleep(10);
                        			}
                        			catch (InterruptedException _ex) { }
                        			repaint();
                        		}
                        	}
                        	public void paint(Graphics g)
                            	{
                            		messagegraphics.setColor(Color.black); // Background colour again
                            		messagegraphics.fillRect(0,0,size().width + 1, size().height + 1);
                            		messagegraphics.setColor(Color.white); // Text colour here
                            try
                                {
                                messagegraphics.setFont(new Font("Arial",0,10)); // change font or font size (Fontname, 0, Size)
                            }

catch(NullPointerException _ex) { } messagegraphics.drawString(message, xpos, ypos); g.drawImage(messageimage, 0, 0, this); } public void update(Graphics g) { paint(g); } }

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

What do you think of this code(in the Beginner 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

 There are no comments on this submission.
 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

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.
 
Name:
Comment:

 

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 | Feedback | Customize | Java/ Javascript Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.