Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Applets
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Applets
how i change browser status text from applet
Dorj Galaa
Ranch Hand
Posts: 113
posted 22 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
how i change browser status text from
applet
?
please send me example
Senior software engineer
Nathan Pruett
Bartender
Posts: 4121
I like...
posted 22 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You use the
showStatus(
String
s )
method of Applet to put the text in String s into the status bar of the browser...
Here's a
example...
import java.awt.*; import java.applet.*; public class StatusBarScroller extends Applet implements Runnable { Thread runner = null; boolean running = false; int subSize = 0; String text = ""; public void init() { for( int i = 0; i < 200; i++ ) { text += " "; } text += getParameter( "text" ); } public void start() { if( !running ) { running = true; runner = new Thread( this ); runner.start(); } } public void stop() { running = false; } public void run() { long time = System.currentTimeMillis(); long delay = 80; while( running ) { try { time += delay; Thread.sleep( Math.max( 0, time - System.currentTimeMillis() ) ); } catch( InterruptedException x ) { } showStatus( text.substring( subSize ) ); subSize++; if( subSize > text.length() ) { subSize = 0; } } } }
Enjoy!
-Nate
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
uncatchable exceptions when loading images
how to write something in the status bar
Display a modal dialog window in an applet
setting status in browser's status bar
APPLET PROBLEM
More...