A More Fully Scripted Clock : Applet Jar « Development « JavaScript DHTML

JavaScript DHTML
1. Ajax Layer
2. Data Type
3. Date Time
4. Development
5. Document
6. Dojo toolkit
7. Event
8. Event onMethod
9. Ext JS
10. Form Control
11. GUI Components
12. HTML
13. Javascript Collections
14. Javascript Objects
15. Javascript Properties
16. jQuery
17. Language Basics
18. Mochkit
19. Mootools
20. Node Operation
21. Object Oriented
22. Page Components
23. Rico
24. Scriptaculous
25. Security
26. SmartClient
27. Style Layout
28. Table
29. Utilities
30. Window Browser
31. YUI Library
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
JavaScript DHTML » Development » Applet Jar 
A More Fully Scripted Clock

/*
JavaScript Bible, Fourth Edition
by Danny Goodman 

John Wiley & Sons CopyRight 2001
*/

<HTML>
<HEAD>
<TITLE>Clock with Lots o' Widgets</TITLE>
<SCRIPT LANGUAGE="JavaScript1.1">

function setTimeZone(popup) {
    var choice = popup.options[popup.selectedIndex].value
    document.clock2.setTimeZone(choice)
}

function setColor(form) {
    var bg = form.backgroundColor.options[form.backgroundColor.selectedIndex].value
    var fg = form.foregroundColor.options[form.foregroundColor.selectedIndex].value
    document.clock2.setColor(bg, fg)
}

function setFont(form) {
    var fontName = form.theFont.options[form.theFont.selectedIndex].value
    var fontStyle = form.theStyle.options[form.theStyle.selectedIndex].value
    var fontSize = form.theSize.options[form.theSize.selectedIndex].value
    document.clock2.setFont(fontName, fontStyle, fontSize)
}
function getAppletInfo(form) {
    form.details.value = document.clock2.getInfo()
}

function showSource() {
    var newWindow = window.open("ScriptableClock.java",""
    "WIDTH=450,HEIGHT=300,RESIZABLE,SCROLLBARS")
}

</SCRIPT>
</HEAD>
<BODY>
<APPLET CODE="ScriptableClock.class" NAME="clock2" WIDTH=500 HEIGHT=45>
<PARAM NAME=bgColor VALUE="Black">
<PARAM NAME=fgColor VALUE="Red">
</APPLET>

<P>
<FORM NAME="widgets2">
Select Time Zone:
<SELECT NAME="zone" onChange="setTimeZone(this)">
    <OPTION SELECTED VALUE="Locale">Local Time
    <OPTION VALUE="GMT">Greenwich Mean Time
</SELECT><P>
Select Background Color:
<SELECT NAME="backgroundColor" onChange="setColor(this.form)">
    <OPTION VALUE="White">White
    <OPTION SELECTED VALUE="Black">Black
    <OPTION VALUE="Red">Red
    <OPTION VALUE="Green">Green
    <OPTION VALUE="Blue">Blue
    <OPTION VALUE="Yellow">Yellow
</SELECT>
Select Color Text Color:
<SELECT NAME="foregroundColor" onChange="setColor(this.form)">
    <OPTION VALUE="White">White
    <OPTION VALUE="Black">Black
    <OPTION SELECTED VALUE="Red">Red
    <OPTION VALUE="Green">Green
    <OPTION VALUE="Blue">Blue
    <OPTION VALUE="Yellow">Yellow
</SELECT><P>
Select Font:
<SELECT NAME="theFont" onChange="setFont(this.form)">
    <OPTION SELECTED VALUE="TimesRoman">Times Roman
    <OPTION VALUE="Helvetica">Helvetica
    <OPTION VALUE="Courier">Courier
    <OPTION VALUE="Arial">Arial
</SELECT><BR>
Select Font Style:
<SELECT NAME="theStyle" onChange="setFont(this.form)">
    <OPTION SELECTED VALUE="Plain">Plain
    <OPTION VALUE="Bold">Bold
    <OPTION VALUE="Italic">Italic
</SELECT><BR>
Select Font Size:
<SELECT NAME="theSize" onChange="setFont(this.form)">
    <OPTION VALUE="12">12
    <OPTION VALUE="18">18
    <OPTION SELECTED VALUE="24">24
    <OPTION VALUE="30">30
</SELECT><P>
<HR>
<INPUT TYPE="button" NAME="getInfo" VALUE="Applet Info..." onClick="getAppletInfo(this.form)">
<P>
<TEXTAREA NAME="details" ROWS=11 COLS=70></TEXTAREA>
</FORM>
<HR>
</BODY>
</HTML>


           
       
Related examples in the same category
1. Calling Java Methods
2. Accessing Applets from within JavaScript
3. Using JavaScript in an Applet
4.  Stopping and Starting an Applet
5. Basic Signed Script Structure
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.