Need help with Java script calling an html page

Hello -
I have a bunch of web pages, that call a java script called "header.js". The "header.js" puts a header on the top of each web page. In the Java script, I have a gif (picture) that displays a logo and if you click on it, it will send to you a different website.
I'd like to replace this gif with an actual web page. So, the "header" would actually be a web page and not some gif.
Below is a snippet of the code and I'd like to replace the highlighted section with a web page called "header.html". I don't even know if this is possible.
Can anyone tell me what I need to do? I know pretty much nothing about Javascripting so please be as detailed as you can. Thanks!
/* Common header across all pages... */
document.write('            <div id="header" class="clearfix">');
document.write('                            <div id="left" class="float_left">');
document.write('                                            <div id="logo"><a href="http://www.xyz.com/" onclick="window.open(this.href);return false;" onkeypress="window.open(this.href);return false;" target=_blank><img src="/images/xyz.gif" width="105" height="75" alt="" border="0" /></a></div>');
document.write('                                            <div id="mainNav" class="clearfix"> ');
document.write('                                                             <ul>');
//document.write('                                                                         <li id="nav_controls"><a href="controls.html">Controls</a></li>');
document.write('                                                                              <li id="nav_motion"><a href="motion.html">Motion</a></li>');
document.write('                                                                              <li id="nav_sensor"><a href="sensor.html">Sensor</a></li>');
document.write('                                                                              <li id="nav_encoder"><a href="encoder.html">Encoder</a></li>');
document.write('                                                                              <li id="nav_system"><a href="system.html">System</a></li>');
//document.write('<!--                                                                  <li id="nav_logs"><a href="#">Logs</a></li> -->');
document.write('                                                             </ul>');
document.write('                                            </div>');
document.write('                            </div>');
document.write('                            <div id="right" class="float_left">');
document.write('                                            <div id="controls">');

Well, the problem with this is that I'm not an expert on SSI and I really know nothing about javascripting...so I'm afraid of breaking the whole web site and also having to modify all the web pages that call this header.
I'll have to read up on server side include...cause I don't know much about it.
If I could do what I want with this "header.js", it would be a lot easier.

Similar Messages

  • Need help with Java Script to perform a calculation in Adobe Acrobat Pro 9 form

    I have a form (test) that I am creating in Adobe Acrobat Pro 9.
    I need help creating custom Java Script so I can get the desired answer.
    1) There are several questions in each group that require a numerical answer between 0-4
    2) There is a total field set up to sum the answers from all above questions
    3) The final "score" takes the answer from Step 2 above and divides by the total possible answer
    Any help on what Java Script I need to complete this would be greatly appreciated!
    I've attached a "spreadsheet" that shows it in more detail as well as what formulas I used in Excel to get the desired end result.
    Thanks in advance.

    Have you tried the "The field is the average of:"?

  • Need help in Java Script

    i Need some help in Java Script,
    am using the following code :
    <script type="text/javascript">
    var newwindow;
    function poptastic(url)
    newwindow=window.open(url,'name','height=300,width=400,left=100, top=100,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
    if (window.focus) {newwindow.focus()}
    else {newwindow.close()}
    //     if (window.focus) {newwindow.focus()}
    </script>
    In HTML,
    thWorld Environment
    Day, June 5<sup>th</sup>,2005
    Am using onmouseover event, so that when my mouse in on the link, popup is opened....and when my mouse is out of the link, the new window should b closed....
    but according to the above code, the new window is opened but have to close it manually....
    Is there any other way to close the popup when my mouse is out of the link

    Prawn,
    This is not really a good way to make friends. With the cross posting and the posting in a wrong forum anyway thing you have going.
    Please kindly take your question to an appropriate JavaScript forum.
    Have a happy day.
    Cross post from http://forum.java.sun.com/thread.jspa?messageID=3797201

  • I need help with this script please ASAP

    So I need this to work properly, but when ran and the correct answer is chosen the app quits but when the wrong answer is chosen the app goes on to the next question. I need help with this ASAP, it is due tommorow. Thank you so much for the help if you can.
    The script (Sorry if it's a bit long):
    #------------Startup-------------
    display dialog "Social Studies Exchange Trviva Game by Justin Parzik" buttons {"Take the Quiz", "Cyaaaa"} default button 1
    set Lolz to (button returned of the result)
    if Lolz is "Cyaaaa" then
    killapp()
    else if Lolz is "Take the Quiz" then
              do shell script "say -v samantha Ok starting in 3…2…1…GO!"
    #------------Question 1-----------
              display dialog "Around age 11, many boys left their fathers to become…" buttons {"Scholars", "Warriors", "Apprentices"}
              set A1 to (button returned of the result)
              if A1 is "Apprentices" then
                        do shell script "say -v samantha Correct Answer"
              else
                        do shell script "say -v samantha Wrong Answer"
      #----------Question 2--------
                        display dialog "Most children were taught
    to read so that they could understand the…" buttons {"Music of Mozart", "Bible", "art of cooking"}
                        set A2 to (button returned of the result)
                        if A2 is "Bible" then
                                  do shell script "say -v samantha Correct Answer"
                        else
                                  do shell script "say -v samantha Wrong Answer"
      #------------Question 3---------
                                  display dialog "In the 1730s and 1740s, a religious movement called the_______swept through the colonies." buttons {"Glorius Revolution", "Great Awakening", "The Enlightenment"}
                                  set A3 to (button returned of the result)
                                  if A3 is "Great Awakening" then
                                            do shell script "say -v samantha Correct Answer"
                                  else
                                            do shell script "say -v samantha Wrong Answer"
      #-----------Question 4--------
                                            display dialog "_______ was
    a famous American Enlightenment figure." buttons {"Ben Franklin", "George Washington", "Jesus"}
                                            set A4 to (button returned of the result)
                                            if A4 is "Ben Franklin" then
                                                      do shell script "say -v samantha Correct Answer"
                                            else
                                                      do shell script "say -v samantha Wrong Answer"
      #----------Question 5-------
                                                      display dialog "______ ownership gave colonists political rights as well as prosperity." buttons {"Land", "Dog", "Slave"}
                                                      set A5 to (button returned of the result)
                                                      if A5 is "Land" then
                                                                do shell script "say -v samantha Correct Answer"
                                                      else
                                                                do shell script "say -v samantha Wrong Answer"
      #---------Question 6--------
                                                                display dialog "The first step toward guaranteeing these rights came in 1215. That
    year, a group of English noblemen forced King John to accept the…" buttons {"Declaration of Independence", "Magna Carta", "Constitution"}
                                                                set A6 to (button returned of the result)
                                                                if A6 is "Magna Carta" then
                                                                          do shell script "say -v samantha Correct Answer"
                                                                else
                                                                          do shell script "say -v samantha Wrong Answer"
      #----------Question 7--------
                                                                          display dialog "England's cheif lawmaking body was" buttons {"the Senate", "Parliament", "King George"}
                                                                          set A7 to (button returned of the result)
                                                                          if A7 is "Parliament" then
                                                                                    do shell script "say -v samantha Correct Answer"
                                                                          else
                                                                                    do shell script "say -v samantha Wrong Answer"
      #--------Question 8-----
                                                                                    display dialog "Pariliament decided to overthrow _______ for not respecting their rights" buttons {"King James II", "King George", "King Elizabeth"}
                                                                                    set A8 to (button returned of the result)
                                                                                    if A8 is "King James II" then
                                                                                              do shell script "say -v samantha Correct Answer"
                                                                                    else
                                                                                              do shell script "say -v samantha Wrong Answer"
      #--------Question 9------
                                                                                              display dialog "Parliament named ___ and ___ as England's new monarchs in something called ____." buttons {"William/Mary/Glorius Revolution", "Adam/Eve/Great Awakening", "Johhny/Mr.Laphalm/Burning of the hand ceremony"}
                                                                                              set A9 to (button returned of the result)
                                                                                              if A9 is "William/Mary/Glorius Revolution" then
                                                                                                        do shell script "say -v samantha Correct Answer"
                                                                                              else
                                                                                                        do shell script "say -v samantha Wrong Answer"
      #---------Question 10-----
                                                                                                        display dialog "After accepting the throne William and Mary agreed in 1689 to uphold the English Bill of _____." buttons {"Money", "Colonies", "Rights"}
                                                                                                        set A10 to (button returned of the result)
                                                                                                        if A10 is "Rights" then
                                                                                                                  do shell script "say -v samantha Correct Answer"
                                                                                                        else
                                                                                                                  do shell script "say -v samantha Wrong Answer"
      #---------Question 11------
                                                                                                                  display dialog "By the late 1600s French explorers had claimed the ___ River Valey" buttons {"Mississippi", "Ohio", "Hudson"}
                                                                                                                  set A11 to (button returned of the result)
                                                                                                                  if A11 is "Ohio" then
                                                                                                                            do shell script "say -v samantha Correct Answer"
                                                                                                                  else
                                                                                                                            do shell script "say -v samantha Wrong Answer"
      #------Question 12---------
                                                                                                                            display dialog "______ was sent to ask the French to leave 'English Land'." buttons {"Johhny Tremain", "George Washington", "Paul Revere"}
                                                                                                                            set A12 to (button returned of the result)
                                                                                                                            if A12 is "George Washington" then
                                                                                                                                      do shell script "say -v samantha Correct Answer"
                                                                                                                            else
                                                                                                                                      do shell script "say -v samantha Wrong Answer"
      #---------Question 13-------
                                                                                                                                      display dialog "_____ proposed the Albany Plan of Union" buttons {"George Washingon", "Ben Franklin", "John Hancock"}
                                                                                                                                      set A13 to (button returned of the result)
                                                                                                                                      if A13 is "Ben Franklin" then
                                                                                                                                                do shell script "say -v samantha Correct Answer"
                                                                                                                                      else
                                                                                                                                                do shell script "say -v samantha Wrong Answer"
      #--------Question 14------
                                                                                                                                                display dialog "The __________ declared that England owned all of North America east of the Mississippi" buttons {"Proclomation of England", "Treaty of Paris", "Pontiac Treaty"}
                                                                                                                                                set A14 to (button returned of the result)
                                                                                                                                                if A14 is "" then
                                                                                                                                                          do shell script "say -v samantha Correct Answer"
                                                                                                                                                else
                                                                                                                                                          do shell script "say -v samantha Wrong Answer"
      #-------Question 15-------
                                                                                                                                                          display dialog "Braddock was sent to New England so he could ______" buttons {"Command an attack against French", "Scalp the French", "Kill the colonists"}
                                                                                                                                                          set A15 to (button returned of the result)
                                                                                                                                                          if A15 is "Command an attack against French" then
                                                                                                                                                                    do shell script "say -v samantha Correct Answer"
                                                                                                                                                          else
                                                                                                                                                                    do shell script "say -v samantha Wrong Answer"
      #------TheLolQuestion-----
                                                                                                                                                                    display dialog "____ is the name of the teacher who runs this class." buttons {"Mr.White", "Mr.John", "Paul Revere"} default button 1
                                                                                                                                                                    set LOOL to (button returned of the result)
                                                                                                                                                                    if LOOL is "Mr.White" then
                                                                                                                                                                              do shell script "say -v samantha Congratulations…you…have…common…sense"
                                                                                                                                                                    else
                                                                                                                                                                              do shell script "say -v alex Do…you…have…eyes?"
                                                                                                                                                                              #------END------
                                                                                                                                                                              display dialog "I hope you enjoyed the quiz!" buttons {"I did!", "It was horrible"}
                                                                                                                                                                              set endmenu to (button returned of the result)
                                                                                                                                                                              if endmenu is "I did!" then
                                                                                                                                                                                        do shell script "say -v samantha Your awesome"
                                                                                                                                                                              else
                                                                                                                                                                                        do shell script "say -v alex Go outside and run a lap"
                                                                                                                                                                              end if
                                                                                                                                                                    end if
                                                                                                                                                          end if
                                                                                                                                                end if
                                                                                                                                      end if
                                                                                                                            end if
                                                                                                                  end if
                                                                                                        end if
                                                                                              end if
                                                                                    end if
                                                                          end if
                                                                end if
                                                      end if
                                            end if
                                  end if
                        end if
              end if
    end if

    Use code such as:
    display dialog "Around age 11, many boys left their fathers to become…" buttons {"Scholars", "Warriors", "Apprentices"}
    set A1 to (button returned of the result)
    if A1 is "Apprentices" then
    do shell script "say -v samantha Correct Answer"
    else
    do shell script "say -v samantha Wrong Answer"
    return
    end if
    #----------Question 2--------
    display dialog "Most children were taught to read so that they could understand the…" buttons {"Music of Mozart", "Bible", "art of cooking"}
    set A2 to (button returned of the result)
    if A2 is "Bible" then
    do shell script "say -v samantha Correct Answer"
    else
    do shell script "say -v samantha Wrong Answer"
    return
    end if
    (90444)

  • Need Help With Java Query String

    I'm new to Java and I'm passing data via a URL to another page(I'm not using a form). I have been succesfull in decoding the string to return the name value below:
    <SCRIPT LANGUAGE="JavaScript">
    function decodeSearchString() {
    var nameValue = new Array();
    var searchStr = unescape(location.search.substring(1));
    if (searchStr) {
    var formElement = searchStr.split("&");
    var tmpArray = new Array();
    for (k = 0; k < formElement.length; k++) {
    tmpArray = formElement[k].split("=");
    nameValue[tmpArray[0]] = tmpArray[1];
    return nameValue
    var srchData = decodeSearchString();
    </SCRIPT>
    However, now I need to add the value returned from the above srcipt to the Java script listed below:
    <SCRIPT Language="Javascript" SRC="#srchData.link#?open&pID=PAR"> </SCRIPT>
    This above script if working will add the HTML from the URL query to the page, but I keep getting a Java Error with this script. Please Help !

    I assume you are using a JSP page and not just solely doing Javascript. IF you are using JSP, then read on. Otherwise, I can revisit your script.
    To obtain the value of the query string, you would use a method call such as:
    String strQuery = request.getQueryString()
    Or, to get a single parameter off the query string, you can call:
    String strSearchData = request.getParameter("paramname");
    Or, if you want all the parameters and values instead of just one long string you can call:
    Enumeration enumParamNames = request.getParameterNames();
    You can use the above enumeration in combination with getParameter() to get the values.
    In order to build your script line and add the query string, you would then do something like this:
    <SCRIPT Language="Javascript" SRC="#<%=strSearchData%>.link#?open&pID=PAR"> </SCRIPT>
    Notice the <%= %> block in the above code.
    I hope that is what you were looking for. Your example is somewhat confusing so I may have answered wrong.
    Mike

  • Help with Java script

    So , I edited the ITunes.java as described in the Admin guide.Copied the .class to my cgi folder in the server.I copied the itunesu file from the shell folder of the sample code.I have modified it accordingly.But when I run it in browser(Firefox) as ..../cgi-bin/itunesu it just gives me a blank page.Nothing shows up.I ran the ITunes.java file locally and it generates an HTML output, which I copied and created a new html.After I run this HTML file, it opens my itunes, but again it says page not found and url contains https://www.xxx.edu/cgi-bin/itunesu?destination=xxx.edu where xxx is my institution name.Not sure if I am supposed to display my institution name in forum.
    The admin guide says on page 15 step 4.Copy the itunes.class file and other itunes file to your web server's cgi-bin directory.
    I am not quiet sure what does other itunes file mean??
    This is how my .java file looks.
    import java.io.*;
    import java.net.*;
    import java.security.*;
    import java.util.*;
    * The <CODE>ITunesU</CODE> class permits the secure transmission
    * of user credentials and identity between an institution's
    * authentication and authorization system and iTunes U.
    * The code in this class can be tested by
    * running it with the following commands:
    * <PRE>
    * javac ITunesU.java
    * java ITunesU</PRE>
    * Changes to values defined in this class' main() method must
    * be made before it will succesfully communicate with iTunes U.
    public class ITunesU extends Object {
    * Generate the HMAC-SHA256 signature of a message string, as defined in
    * RFC 2104.
    * @param message The string to sign.
    * @param key The bytes of the key to sign it with.
    * @return A hexadecimal representation of the signature.
    public String hmacSHA256(String message, byte[] key) {
    // Start by getting an object to generate SHA-256 hashes with.
    MessageDigest sha256 = null;
    try {
    sha256 = MessageDigest.getInstance("SHA-256");
    } catch (NoSuchAlgorithmException e) {
    throw new java.lang.AssertionError(
    this.getClass().getName()
    + ".hmacSHA256(): SHA-256 algorithm not found!");
    // Hash the key if necessary to make it fit in a block (see RFC 2104).
    if (key.length > 64) {
    sha256.update(key);
    key = sha256.digest();
    sha256.reset();
    // Pad the key bytes to a block (see RFC 2104).
    byte block[] = new byte[64];
    for (int i = 0; i < key.length; ++i) block = key;
    for (int i = key.length; i < block.length; ++i) block = 0;
    // Calculate the inner hash, defined in RFC 2104 as
    // SHA-256(KEY ^ IPAD + MESSAGE)), where IPAD is 64 bytes of 0x36.
    for (int i = 0; i < 64; ++i) block ^= 0x36;
    sha256.update(block);
    try {
    sha256.update(message.getBytes("UTF-8"));
    } catch (UnsupportedEncodingException e) {
    throw new java.lang.AssertionError(
    "ITunesU.hmacSH256(): UTF-8 encoding not supported!");
    byte[] hash = sha256.digest();
    sha256.reset();
    // Calculate the outer hash, defined in RFC 2104 as
    // SHA-256(KEY ^ OPAD + INNER_HASH), where OPAD is 64 bytes of 0x5c.
    for (int i = 0; i < 64; ++i) block ^= (0x36 ^ 0x5c);
    sha256.update(block);
    sha256.update(hash);
    hash = sha256.digest();
    // The outer hash is the message signature...
    // convert its bytes to hexadecimals.
    char[] hexadecimals = new char[hash.length * 2];
    for (int i = 0; i < hash.length; ++i) {
    for (int j = 0; j < 2; ++j) {
    int value = (hash >> (4 - 4 * j)) & 0xf;
    char base = (value < 10) ? ('0') : ('a' - 10);
    hexadecimals[i * 2 + j] = (char)(base + value);
    // Return a hexadecimal string representation of the message signature.
    return new String(hexadecimals);
    * Combine user credentials into an appropriately formatted string.
    * @param credentials An array of credential strings. Credential
    * strings may contain any character but ';'
    * (semicolon), '\\' (backslash), and control
    * characters (with ASCII codes 0-31 and 127).
    * @return <CODE>null</CODE> if and only if any of the credential strings
    * are invalid.
    public String getCredentialsString(String[] credentials) {
    // Create a buffer with which to generate the credentials string.
    StringBuffer buffer = new StringBuffer();
    // Verify and add each credential to the buffer.
    if (credentials != null) {
    for (int i = 0; i < credentials.length; ++i) {
    if (i > 0) buffer.append(';');
    for (int j = 0, n = credentials.length(); j < n; ++j) {
    char c = credentials.charAt(j);
    if (c != ';' && c != '\\' && c >= ' ' && c != 127) {
    buffer.append(c);
    } else {
    return null;
    // Return the credentials string.
    return buffer.toString();
    * Combine user identity information into an appropriately formatted string.
    * @param displayName The user's name (optional).
    * @param emailAddress The user's email address (optional).
    * @param username The user's username (optional).
    * @param userIdentifier A unique identifier for the user (optional).
    * @return A non-<CODE>null</CODE> user identity string.
    public String getIdentityString(String displayName, String emailAddress,
    String username, String userIdentifier) {
    // Create a buffer with which to generate the identity string.
    StringBuffer buffer = new StringBuffer();
    // Define the values and delimiters of each of the string's elements.
    String[] values = { displayName, emailAddress,
    username, userIdentifier };
    char[][] delimiters = { { '"', '"' }, { '<'(', ')' }, { '[', ']' } };
    // Add each element to the buffer, escaping
    // and delimiting them appropriately.
    for (int i = 0; i < values.length; ++i) {
    if (values != null) {
    if (buffer.length() > 0) buffer.append(' ');
    buffer.append(delimiters[0]);
    for (int j = 0, n = values.length(); j < n; ++j) {
    char c = values.charAt(j);
    if (c == delimiters[1] || c == '\\') buffer.append('\\');
    buffer.append(c);
    buffer.append(delimiters[1]);
    // Return the generated string.
    return buffer.toString();
    * Generate an iTunes U digital signature for a user's credentials
    * and identity. Signatures are usually sent to iTunes U along
    * with the credentials, identity, and a time stamp to warrant
    * to iTunes U that the credential and identity values are
    * officially sanctioned. For such uses, it will usually makes
    * more sense to use an authorization token obtained from the
    * {@link #getAuthorizationToken(java.lang.String, java.lang.String, java.util.Date, byte[])}
    * method than to use a signature directly: Authorization
    * tokens include the signature but also the credentials, identity,
    * and time stamp, and have those conveniently packaged in
    * a format that is easy to send to iTunes U over HTTPS.
    * @param credentials The user's credentials string, as
    * obtained from getCredentialsString().
    * @param identity The user's identity string, as
    * obtained from getIdentityString().
    * @param time Signature time stamp.
    * @param key The bytes of your institution's iTunes U shared secret key.
    * @return A hexadecimal representation of the signature.
    public String getSignature(String credentials, String identity,
    Date time, byte[] key) {
    // Create a buffer in which to format the data to sign.
    StringBuffer buffer = new StringBuffer();
    // Generate the data to sign.
    try {
    // Start with the appropriately encoded credentials.
    buffer.append("credentials=");
    buffer.append(URLEncoder.encode(credentials, "UTF-8"));
    // Add the appropriately encoded identity information.
    buffer.append("&identity=");
    buffer.append(URLEncoder.encode(identity, "UTF-8"));
    // Add the appropriately formatted time stamp. Note that
    // the time stamp is expressed in seconds, not milliseconds.
    buffer.append("&time=");
    buffer.append(time.getTime() / 1000);
    } catch (UnsupportedEncodingException e) {
    // UTF-8 encoding support is required.
    throw new java.lang.AssertionError(
    "ITunesU.getSignature(): UTF-8 encoding not supported!");
    // Generate and return the signature.
    String signature = this.hmacSHA256(buffer.toString(), key);
    return signature;
    * Generate and sign an authorization token that you can use to securely
    * communicate to iTunes U a user's credentials and identity. The token
    * includes all the data you need to communicate to iTunes U as well as
    * a creation time stamp and a digital signature for the data and time.
    * @param credentials The user's credentials string, as
    * obtained from getCredentialsString().
    * @param identity The user's identity string, as
    * obtained from getIdentityString().
    * @param time Token time stamp. The token will only be valid from
    * its time stamp time and for a short time thereafter
    * (usually 90 seconds).
    * @param key The bytes of your institution's iTunes U shared secret key.
    * @return The authorization token. The returned token will
    * be URL-encoded and can be sent to iTunes U with
    * a form
    * submission. iTunes U will typically respond with
    * HTML that should be sent to the user's browser.
    public String getAuthorizationToken(String credentials, String identity,
    Date time, byte[] key) {
    // Create a buffer with which to generate the authorization token.
    StringBuffer buffer = new StringBuffer();
    // Generate the authorization token.
    try {
    // Start with the appropriately encoded credentials.
    buffer.append("credentials=");
    buffer.append(URLEncoder.encode(credentials, "UTF-8"));
    // Add the appropriately encoded identity information.
    buffer.append("&identity=");
    buffer.append(URLEncoder.encode(identity, "UTF-8"));
    // Add the appropriately formatted time stamp. Note that
    // the time stamp is expressed in seconds, not milliseconds.
    buffer.append("&time=");
    buffer.append(time.getTime() / 1000);
    // Generate and add the token signature.
    String data = buffer.toString();
    buffer.append("&signature=");
    buffer.append(this.hmacSHA256(data, key));
    } catch (UnsupportedEncodingException e) {
    // UTF-8 encoding support is required.
    throw new java.lang.AssertionError(
    "ITunesU.getAuthorizationToken(): "
    + "UTF-8 encoding not supported!");
    // Return the signed authorization token.
    return buffer.toString();
    * Send a request for an action to iTunes U with an authorization token.
    * @param url URL defining how to communicate with iTunes U and
    * identifying which iTunes U action to invoke and which iTunes
    * U page or item to apply the action to. Such URLs have a
    * format like <CODE>[PREFIX]/[ACTION]/[DESTINATION]</CODE>,
    * where <CODE>[PREFIX]</CODE> is a value like
    * "https://deimos.apple.com/WebObjects/Core.woa" which defines
    * how to communicate with iTunes U, <CODE>[ACTION]</CODE>
    * is a value like "Browse" which identifies which iTunes U
    * action to invoke, and <CODE>[DESTINATION]</CODE> is a value
    * like "example.edu" which identifies which iTunes U page
    * or item to apply the action to. The destination string
    * "example.edu" refers to the root page of the iTunes U site
    * identified by the domain "example.edu". Destination strings
    * for other items within that site contain the site domain
    * followed by numbers separated by periods. For example:
    * "example.edu.123.456.0789". You can find these
    * strings in the items' URLs, which you can obtain from
    * iTunes. See the iTunes U documentation for details.
    * @param token Authorization token generated by getAuthorizationToken().
    * @return The iTunes U response, which may be HTML or
    * text depending on the type of action invoked.
    public String invokeAction(String url, String token) {
    // Send a request to iTunes U and record the response.
    StringBuffer response = null;
    try {
    // Verify that the communication will be over SSL.
    if (!url.startsWith("https")) {
    throw new MalformedURLException(
    "ITunesU.invokeAction(): URL \""
    + url + "\" does not use HTTPS.");
    // Create a connection to the requested iTunes U URL.
    HttpURLConnection connection =
    (HttpURLConnection)new URL(url).openConnection();
    connection.setUseCaches(false);
    connection.setDoOutput(true);
    connection.setRequestMethod("POST");
    connection.setRequestProperty(
    "Content-Type",
    "application/x-www-form-urlencoded; charset=UTF-8");
    // Send the authorization token to iTunes U.
    connection.connect();
    OutputStream output = connection.getOutputStream();
    output.write(token.getBytes("UTF-8"));
    output.flush();
    output.close();
    // Read iTunes U's response.
    response = new StringBuffer();
    InputStream input = connection.getInputStream();
    Reader reader = new InputStreamReader(input, "UTF-8");
    reader = new BufferedReader(reader);
    char[] buffer = new char[16 * 1024];
    for (int n = 0; n >= 0;) {
    n = reader.read(buffer, 0, buffer.length);
    if (n > 0) response.append(buffer, 0, n);
    // Clean up.
    input.close();
    connection.disconnect();
    } catch (UnsupportedEncodingException e) {
    // ITunes U requires UTF-8 and ASCII encoding support.
    throw new java.lang.AssertionError(
    "ITunesU.invokeAction(): UTF-8 encoding not supported!");
    } catch (IOException e) {
    // Report communication problems.
    throw new java.lang.AssertionError(
    "ITunesU.invokeAction(): I/O Exception " + e);
    // Return the response received from iTunes U.
    return response.toString();
    * iTunes U credential and identity transmission sample. When your
    * itunes U site is initially created, Apple will send your institution's
    * technical contact a welcome email with a link to an iTunes U page
    * containing the following information, which you will need to customize
    * this method's code for your site:
    <DD><DL><DT>
    * Information:<DD><CODE>
    * Site URL</CODE> - The URL to your site in iTunes U. The last
    * component of that URL, after the last slash,
    * is a domain name that uniquely identifies your
    * site within iTunes U.<DD><CODE>
    * shared secret</CODE> - A secret key known only to you and Apple that
    * allows you to control who has access to your
    * site and what access they have to it.<DD><CODE>
    * debug suffix</CODE> - A suffix you can append to your site URL
    * to obtain debugging information about the
    * transmission of credentials and identity
    * information from your institution's
    * authentication and authorization services
    * to iTunes U.<DD><CODE>
    * administrator credential</CODE> - The credential string to assign
    * to users who should have the
    * permission to administer your
    * iTunes U site.</DL></DD>
    <DD>
    * Once you have substitute the information above in this method's code
    * as indicated in the code's comments, this method will connect
    * to iTunes U and obtain from it the HTML that needs to be returned to a
    * user's web browser to have a particular page or item in your iTunes U
    * site displayed to that user in iTunes. You can modify this method to
    * instead output the URL that would need to be opened to have that page
    * or item displayed in iTunes.</DD>
    public static void main(String argv[]) {
    // Define your site's information. Replace these
    // values with ones appropriate for your site.
    String siteURL =
    "https://deimos.apple.com/WebObjects/Core.woa/Browse/xxx.edu" ;
    String debugSuffix = "/abc123";
    String sharedSecret = "some key";
    String administratorCredential =
    "Administrator@urn:mace:itunesu.com:sites:xxx.edu";
    // Define the user information. Replace the credentials with the
    // credentials you want to grant to the current user, and the
    // optional identity information with the identity of that user.
    // For initial testing and site setup, use the singe administrator
    // credential defined when your iTunes U site was created. Once
    // you have access to your iTunes U site, you will be able to define
    // additional credentials and the iTunes U access they provide.
    String[] credentialsArray = { administratorCredential };
    String displayName = "my name";
    String emailAddress = "my [email protected]";
    String username = "mylogin";
    String userIdentifier = "1243";
    // Define the iTunes U page to browse. Use the domain name that
    // uniquely identifies your site in iTunes U to browse to that site's
    // root page; use a destination string extracted from an iTunes U URL
    // to browse to another iTunes U page; or use a destination string
    // supplied as the "destination" parameter if this program is being
    // invoked as a part of the login web service for your iTunes U site.
    String siteDomain = siteURL.substring(siteURL.lastIndexOf('/') + 1);
    String destination = siteDomain;
    // Append your site's debug suffix to the destination if you want
    // to receive an HTML page providing information about the
    // transmission of credentials and identity between this program
    // and iTunes U. Uncomment the following line for testing only.
    //destination = destination + debugSuffix;
    // Use an ITunesU instance to format the credentials and identity
    // strings and to generate an authorization token for them.
    ITunesU iTunesU = new ITunesU();
    String identity = iTunesU.getIdentityString(displayName, emailAddress,
    username, userIdentifier);
    String credentials = iTunesU.getCredentialsString(credentialsArray);
    Date now = new Date();
    byte[] key = null;
    try {
    key = sharedSecret.getBytes("US-ASCII");
    } catch (UnsupportedEncodingException e) {
    throw new java.lang.AssertionError(
    "ITunesU.hmacSH256(): US-ASCII encoding not supported!");
    String token = iTunesU.getAuthorizationToken(credentials, identity,
    now, key);
    // Use the authorization token to connect to iTunes U and obtain
    // from it the HTML that needs to be returned to a user's web
    // browser to have a particular page or item in your iTunes U
    // site displayed to that user in iTunes. Replace "/Browse/" in
    // the code below with "/API/GetBrowseURL/" if you instead want
    // to return the URL that would need to be opened to have that
    // page or item displayed in iTunes.
    String prefix = siteURL.substring(0, siteURL.indexOf(".woa/") + 4);
    String url = prefix + "/Browse/" + destination;
    String results = iTunesU.invokeAction(url, token);
    System.out.println(results);
    The itunes file from Shell folder has been modified as follows
    DISPLAY_NAME= "myname"
    EMAIL_ADDRESS="[email protected]"
    USERNAME="mylogin"
    USER_IDENTIFIER="1243"
    all the other things in that file have been untouched.
    I also generated the debug which looks like this
    iTunes U Access Debugging
    Received
    Destination xxx.edu
    Identity "my name" <[email protected]> (mylogin) [1243]
    Credentials Administrator@urn:mace:itunesu.com:sites:xxx.edu
    Time 1196706873
    Signature 533870b8jshdidk333lfsf6a3143a55c132ec548a4d545bd79322402e8e2596e4
    Analysis
    The destination string is valid and the corresponding destination item was found.
    The identity string is valid and provides the following information:
    Display Name my name
    Email Address [email protected]
    Username mylogin
    User Identifier 1243
    The credential string is valid and contains the following recognized credential:
    1. Administrator@urn:mace:itunesu.com:sites:xxx.edu
    The time string is valid and corresponds to 2007-12-03 18:34:33Z.
    The signature string is valid.
    Access
    Because the received signature and time were valid, the received identity and credentials were accepted by iTunes U.
    In addition, the following 2 credentials were automatically added by iTunes U:
    1. All@urn:mace:itunesu.com:sites:xxx.edu
    2. Authenticated@urn:mace:itunesu.com:sites:xxx.edu
    With these credentials, you have browsing, downloading, uploading, and editing access to the requested destination.
    I am pretty new to this, and working on this for the first time.If someone could guide me through this would be pretty helpful.

    This is only going to work under IE !
    Go to your page template :
    Modify the definition, make sur you have this :
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>#TITLE#</title>
    #HEAD#
    <Script language = javascript>
    Browser = navigator.appName
    Net = Browser.indexOf("Netscape")
    Micro = Browser.indexOf("Microsoft")
    Netscape = false
    IE = false
    if(Net >= 0) {Netscape = true}
    if(Micro >= 0) {IE = true}
    function XYpos() {
    if (IE == true) {
    xPos = event.screenX
    yPos = event.screenY
    alert(xPos + " left " + yPos + " down")
    else if (Netscape == true) {alert("Script won't work: " + "\n" + "You're using Netscape")}
    </script>
    Modify the body definition, make sure you have this :
    <body #ONLOAD# onMouseDown = XYpos()>
    I didnt try it but it make sens to me... tell me if it works!
    Flex
    Homepage : http://www.insum.ca
    InSum Solutions' blog : http://insum-apex.blogspot.com

  • Need help with java

    ok so i have a midterm and need help this question that is gonna be on the midterm. i dont know how to do it and its worth 16 marks!!!! here it is
    the UW Orchestra wants to produce a CD containing all the pieces of music
    from its upcoming concert. In order to do that, it needs to calculate the total length of time for the
    CD. In addition, the conductor wishes to know which piece of music has the longest duration.
    Sample output for the program.
    The Swan (3.88)
    The Bee (0.98)
    Claire de Lune (6.02)
    Liebesfreund (3.38)
    Ragtime (3.48)
    The total time for the CD is 18.74 minutes.
    The longest piece is Claire de Lune.
    Do not include the HTML that is required to embed the program into a Web page (that is, show
    only what you would write between <script> and </script> tags).
    [4 marks] In the following space, define a function, Print, that takes two parameters, Title and
    Length, and outputs a line of text such that Title appears in italics, followed by Length in
    parentheses. The function also returns the value of Length.
    For example, Print("My World",30) will output the line
    My World (30)
    and return the value 30.
    Put your JavaScript program for the remainder of this question in the space provided on the next
    two pages.
    [9 marks]. For each piece of music, your program should input the title of the piece and the
    duration (in minutes) for that piece, and it should output a line showing those values using the
    Print function just defined. After all pieces have been listed, the program should output the
    total length of time for the CD, adding in 0.25 minutes between each piece of music (which is
    needed on the CD to separate the pieces).
    [3 marks] The program should also output the name of the piece that has the longest playing
    time.
    Use reasonable variable names, indentation and good programming style. Documentation and
    comments are not required, but you may add them to explain any assumptions you might want to
    make. You need not check that the input is valid, and you may assume that no two pieces have the
    same duration.
    can anyone help me out! i would be indebt of ur kindness if u can help me out!

    This forum is for Java, not JavaScript. The two have nothing to do with each other.
    And anyway, this is your studying, so you should try to do it, put forth your best effort, and ask specific questions (on the proper fourm).

  • Need help with Java always get error

    hey guys need help
    this the problem i get :
    I go to certain websites and I get this error with firefox.
    This Site requires that JavaScript be enabled.
    It is enabled.
    This is the one of the errors in java script console with firefox.
    Error: [Exception... "'Component does not have requested interface' when calling method: [nsIInterfaceRequestor::getInterface]" nsresult: "0x80004002 (NS_NOINTERFACE)" location: "<unknown>" data: no]
    I have installed the java script from there home site and did a test and says everything is fine. Any ideas?
    please help

    Hi 49ers,
    Sorry not to have any real idea of how to help you out here, but this is a Java forum, not JavaScript.
    Some Firefox expert may stumble across your post and be able to offer some advice (I hope they do) but this isn't really the best place to post such questions.
    Try here: http://www.webdeveloper.com/forum/forumdisplay.php?s=&forumid=3
    Good luck!
    Chris.

  • Sreaming at the top of my lungs for HELP with Java Script problem!

    Hello,
    I have this strange problem that no one seems to know why or how to fix it.Whenever I encounter a web site that has java scripting for anything pop ups or redirects to url's anything that says java script when I mouse over the link my browsers do nothing.That is for explorer 6.0 beta netscape 4.7 and netscape version 6.I have tried in another forum some suggestions but nothing changed even though I am told nothing is wrong with the java scripting.I used to be able to click java script's with all of these browsers but no longer.That was a few months ago.Now to try something new I tried to see if a new browser would work.I now have the latest version of Opera.It did work but using Opera on some sites limits what I can do so it doesn't solve my problem.Then I tried the Sun JavaHot browser it also worked but limits what I can do on some site's.I have Windows 98 & updated most of my dll's etc & my java is version 2 1.3.1.My java script is enabled in Explorer & netscape's & the security is at a minimum level.Please help me figure out why these other browsers work but the other's do not.I want to edit a web site of mine but I can't because of this problem.I am very frustrated by this and need as detailed help as I can get.Anything of a suggestion would be very much appreciated.But I am also not an expert on the working's of a computer so bear with me.
    Brian

    Hi,
    Well I am thinking that if anyone could know something about Java script it would be java developers.But anyways I had the previous version of explorer 5.0 & the java didn't work in it either.Now how weird is this,I opened netscape 4.7 today & the java scripts are suddenly working.This has me scratching my head wondering if my computer is possesed by some force beyond my capability to know...????Weird as it seems though the explorer still will not respond to a java script.
    Brian

  • Need help with how to call VB proceedure to open Adobe reader pdf file from differnt folders

    Using  MS access 9.0.2720  visual basic proceedure to call Adobe reader to open a specific flle from a folder on my c drive.
    useing the shell command , shellexecute is not available in the version I'm using.
    I can call the Reader with this code:   call shell "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe"  and it will open reader, but
    I can't seem to get it to open a specific PDF file, I tried
    call shell "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" & "(folderpath)\.95.pdf"
    This use to work when I was running Xp and acrobat 5.0 , I am currentlt running windows 7
    thanks in advance..

    I am getting the exact error trying to down load bank statements but when I go to 'uncheck' the "Do not save encrypted page to disk" box it is ALREADY unchecked.  Can't get my bank statements down loaded.  Any other suggestions.  Need help quick.

  • Need help with java J2Se 5.0 upgrade 2

    Having problems with Java when playing on Pogo, the Vaults of Atlantis. When loading, I am getting a message that says that I need to remove and download again, java. That it is not working correctly. I did that yesterday, 05/27/05 and am still experiencing the problem but only after signing off from Pogo and AOL and then trying to sign back on again later in the day. I have to shutdown my computer and bring it back up again and then I can load the Vaults of Atlantis. I have noticed that when I do sign-off from Pogo and AOL, that my java cup stays on in my deskbar. Is that supposed to be normal or is it supposed to disappear? If it is supposed to disappear, what can I do to fix that problem?
    Please, can anyone help?

    Go here http://www.java.com/en/ and click "Download Now".
    If that has problems, click the "Manual Download" link and download the "Windows (Offline Installation)".
    If there are problems, review the Help information to resolve.

  • Illegal character '%' at position 1 - need help with perl script!

    iTunes U Access Debugging
    Received
    Destination kean.edu
    Identity %22Jack Black%22 %3C%28jblack%29.%40kean.edu%3E %28jblack%29 %5B42%5D
    Credentials STUDENT%40urn%3Amace%3Aitunesu.com%3Asites%3Akean.edu
    Time 1178737992
    Signature 8786768fc3ebf9d3faf404a42bdb8a8d14c481e270fb75f084ebdd815553e1e4
    Analysis
    The destination string is valid and the corresponding destination item was found.
    The identity string is invalid: Illegal character '%' at position 1.
    The credential string is valid but contains no known credentials.
    The credential string contains the following credential which is not used within iTunes U:
    STUDENT%40urn%3Amace%3Aitunesu.com%3Asites%3Akean.edu
    The time string is valid and corresponds to 2007-05-09 19:13:12Z.
    The signature string is valid.
    Access
    Because the received signature and time were valid, the received identity and credentials were accepted by iTunes U.
    In addition, the following 2 credentials were automatically added by iTunes U:
    All@urn:mace:itunesu.com:sites:kean.edu
    Authenticated@urn:mace:itunesu.com:sites:kean.edu
    With these credentials, you have browsing and downloading access to the requested destination.

    Ken
    Thanks for lookiing into the issue.
    I am using the perl file downloaded from the iTunesU website.
    Here is the script:
    the only thing i replaced in this script is the shared secret, debug suffix, display name, email address and username with appropriate ones.
    use strict;
    use Digest::SHA qw(hmacsha256hex);
    use URI::Escape;
    use LWP::UserAgent;
    use Encode qw(encode);
    # to redirect errors to the browser
    use CGI::Carp qw(fatalsToBrowser);
    # to allow inputs from website using CGI scripting
    use CGI qw(:standard);
    sub main() {
    # Define your site's information. Replace these
    # values with ones appropriate for your site.
    my $siteURL = "https://deimos.apple.com/WebObjects/Core.woa/Browse/kean.edu";
    my $debugSuffix = "/abc123";
    my $sharedSecret = "YOURSHAREDSECRETKEYCODE";
    my $administratorCredential = "Administrator\@urn:mace:itunesu.com:sites:kean.edu";
    # Define the user information. Replace the credentials with the
    # credentials you want to grant to that user, and the optional
    # identity information with the identity of the current user.
    # For initial testing and site setup, use the singe administrator
    # credential defined when your iTunes U site was created. Once
    # you have access to your iTunes U site, you will be able to define
    # additional credentials and the iTunes U access they provide.
    my @credentialArray = ($administratorCredential);
    my $displayName = "Michael Searson";
    my $emailAddress = "msearson\@kean.edu";
    my $username = "msearson";
    my $userIdentifier = "42";
    # Append your site's debug suffix to the destination if you
    # want to receive an HTML page providing information about
    # the transmission of credentials and identity between this
    # program and iTunes U. Remove this code after initial
    # testing to instead receive the destination page requested.
    # uncomment the line below to access debug information from the
    # iTunes U server.
    $siteURL .= $debugSuffix;
    # Ready this data for transfer, the order must be correct!
    my $identity = getIdentityString($displayName, $emailAddress, $username, $userIdentifier);
    # turn the array of credentials into a semicolon delimited string
    my $credentials = getCredentialsString(@credentialArray);
    # time that this key is generated. The key is valid for 90 seconds.
    my $currentTime = time;
    my %token = getAuthorizationToken($identity, $credentials, $currentTime, $sharedSecret);
    invokeAction($siteURL, %token)
    sub getIdentityString()
    # Combine user identity information into an appropriately formatted string.
    # take the arguments passed into the function copy them to variables
    my ($displayName, $emailAddress, $username, $userIdentifier) = @_;
    # wrap the elements into the required delimiters.
    my $returnValue = sprintf('"%s" <%s> (%s) [%s]', $displayName,
    $emailAddress, $username, $userIdentifier);
    return $returnValue;
    sub getCredentialsString()
    # this is equivalent to join(';', @_); this function is present
    # for consistency with the Java example.
    # concatenates all the passed in credentials into a string
    # with a semicolon delimiting the credentials in the string.
    #make sure that at least one credential is passed in
    my $returnValue = "";
    my $credentialCount = @_;
    if ($credentialCount > 0) {
    for (my $i=0; $i < $credentialCount; $i++) {
    if ($i == 0) {
    $returnValue = sprintf('%s', $_[$i]);
    } else {
    $returnValue = sprintf('%s;%s', $returnValue, $_[$i]);
    } else {
    die "credentialArray must have at least one credential";
    return $returnValue;
    sub getAuthorizationToken()
    # Create a buffer with which to generate the authorization token.
    my ($identity, $credentials, $expriation, $key) = @_;
    my $signature;
    my $buffer;
    my %token_hash = ();
    my $escapedUTF8EncodedCredentials = uri_escape(encode("UTF-8", $credentials), "^A-Za-z0-9\-_.* ");
    my $escapedUTF8EncodedIdentity = uri_escape(encode("UTF-8", $identity), "^A-Za-z0-9\-_.* ");
    my $escapedUTF8EncodedExpiration = uri_escape(encode("UTF-8", $expriation), "^A-Za-z0-9\-_.* ");
    # create the POST Content and sign it
    $buffer .= "credentials=" . $escapedUTF8EncodedCredentials;
    $buffer .= "&identity=" . $escapedUTF8EncodedIdentity;
    $buffer .= "&time=" . $escapedUTF8EncodedExpiration;
    # This is necessary because uri_escape does encode spaces to pluses.
    $buffer =~ s/[ ]/+/g;
    # returns a signed message that is sent to the server
    $signature = hmacsha256hex($buffer, $key);
    $token_hash{'credentials'} = $escapedUTF8EncodedCredentials;
    $token_hash{'identity'} = $escapedUTF8EncodedIdentity;
    $token_hash{'time'} = $escapedUTF8EncodedExpiration;
    $token_hash{'signature'} = $signature;
    # append the signature to the POST content
    return %token_hash
    sub invokeAction()
    # Send a request to iTunes U and record the response.
    # Net:HTTPS is used to get better control of the encoding of the POST data
    # as HTTP::Request::Common does not encode parentheses and Java's URLEncoder
    # does.
    my ($siteURL, %token) = @_;
    #print "$token\n";
    my $ua = LWP::UserAgent->new;
    my $response = $ua->post($siteURL, \%token);
    print "Content-type: text/html\n\n";
    print $response->content;
    main();
    AND HERE IS THE OUTPUT
    Received
    Destination kean.edu
    Identity %22Michael Searson%22 %3Cmsearson%40kean.edu%3E %28msearson%29 %5B42%5D
    Credentials Administrator%40urn%3Amace%3Aitunesu.com%3Asites%3Akean.edu
    Time 1178819683
    Signature 4d012f2cb6e465dbc4ae41b4905ad3c334c695e36b06e9ae406acf02f25387d1
    Analysis
    The destination string is valid and the corresponding destination item was found.
    The identity string is invalid: Illegal character '%' at position 1.
    The credential string is valid but contains no known credentials.
    The credential string contains the following credential which is not used within iTunes U:
    Administrator%40urn%3Amace%3Aitunesu.com%3Asites%3Akean.edu
    The time string is valid and corresponds to 2007-05-10 17:54:43Z.
    The signature string is valid.
    Access
    Because the received signature and time were valid, the received identity and credentials were accepted by iTunes U.
    In addition, the following 2 credentials were automatically added by iTunes U:
    All@urn:mace:itunesu.com:sites:kean.edu
    Authenticated@urn:mace:itunesu.com:sites:kean.edu
    With these credentials, you have browsing, downloading, uploading, and editing access to the requested destination.

  • Need help with Java programming installation question

    Sorry for my lack of knowledge about Java programming, but:....
    A while back I thought I had updated my Java Runtime Environment programming. But I now apparently have two programs installed, perhaps through my not handling the installation properly. Those are:
    J2SE Runtime Environment 5.0 update 5.0 (a 118MB file)
    and:
    Java 2 Runtime Environment, SE v 1.4.2_05 (a 108MB file)
    Do I need both of these installed? If not, which should I uninstall?
    Or, should I just leave it alone, and not worry about it?
    Yeah, I don't have much in the way of technical knowledge...
    Any help or advice would be appreciated. Thank you.
    Bob VanHorst

    Thanks for the feedback. I think I'll do just that. Once in a while I have a problem with Java not bringing up a webcam shot, but when that happens, it seems to be more website based than a general condition.

  • Need help with java will even pay

    I need extreme help. I just don't have time lately to write these programs and I have fallen extremely behind. Basically all I need is to pass this class and right now until I can get some more help I just can't make the deadlines. If someone could help me I will pay you just like a tutor.
    Requirements for Lab.
    You will need to develop a variety of classes for this lab. Specifically, you need to create:
    +1. a "PersonGUI" class that displays fields for a person's: firstName, lastName, identificationNum, and sex.+
    +2. a "StudentGUI" class that provides Java components for the entry of: classification (freshman, sophomore, junior, senior, or graduate student), and Checkboxes for (a student being in the Honor's program and/or in the ROTC).+
    +3. a "FacultyGUI" class that provides Java components for the entry of: rank (instructor, assistant, associate, or full professor), years of service, and salary.+
    +4. a "Statistics" class that, when instantiated, creates an object containing an instance variable for each of the the statistical values outlined below. (Each of these instance variables should be declared to be "private".)+
    Your main Lab6 class should provide a means for the user to:
    +1. Specify the kind of personal data to be entered (Student or Faculty), and+
    +2. Then, depending on the choice made, appropriate fields should be displayed to allow the user to input appropriate information for the type of personal data being entered, and+
    +3. Controls that support the following functionality:+
    * a "CANCEL" control that will terminate any operation currently being performed and return the user to the "Startup" window.
    * a "SAVE" control that will cause the just entered data to be harvested from the graphical user interface and the appropriate statistics to be updated. Note: this function may NOT be performed if any of the student or faculty member data fields have not been filled in.
    * a "RESET" control that will erase all information recorded to date (i.e., all summary variables are reset to zero).
    * a "CLEAR" control that will erase all fields for the personal data currently being entered.
    * and a "DISPLAY TOTALS" control that will display, when pressed, the following data:
    +1. For students:+
    +1. total number of students entered so far,+
    +2. number who are male and number who are female,+
    +3. number of freshmen, sophomores, juniors, seniors, and graduate students,+
    +4. number of students who are in the Honor's program and number who are in the ROTC.+
    +2. For faculty:+
    +1. total number of faculty entered so far,+
    +2. number who are male and number who are female,+
    +3. the name and salary of the highest paid faculty member on campus.+
    Your program should validate numeric data to the extent:
    +1. no numeric field (id number, years of service, or salary) may be left blank by the user. If done so, the user should be alerted to enter a numeric value.+
    +2. when the user enters a "years of service" value for a faculty member - the value entered should be verified to be a valid integer value in the range 1 to 50. If the data entered is outside the valid range or is not a valid integer - your program should reject the value and prompt the user that invalid data has been entered and that a new value is necessary.+
    +3. when a faculty salary is entered, verify that it is a floating-point value in the range $35,000 to $200,000. Handle invalid data as described above.+
    +4. Similarly, if an invalid integer value is entered for the identification number, the value should be rejected and the user prompted to reenter.+
    +5. Information should not be saved, nor should statistical values be updated, until all numeric data has been validated.+
    Note -- You will be graded on appropriate use of instance vs. local variables, use of methods, and passing parameters and returning appropriate values.
    +1. The 'Statistics" class MUST provide "mutator" and "accessor" methods that are required to access values or to modify the values of any variable. REMEMBER ALL VARIABLES ARE DECLARED TO BE "private"!!+
    +2. You should implement methods to verify the data, as detailed above. The methods should return boolean values indicating whether the data is acceptable or not.+

    Sorry to hear about your problems - lack of time, having fallen behind, imminent failure etc - but none of these are Java problems.
    This site deals with Java problems: compiler or runtime behaviour that people can't understand. If you have problems of that sort (and especially if solving those problems would help with the problems you did describe) then post them.
    Otherwise you would seem to be in the wrong place.

  • Need Help with Java Desktop CP Icon

    I just formatted and reinstalled Windows XP Home SP2 and installed the JRE 1.5.0.02. I usually see an icon in my Control Panel but it only appears in the Administrator's CP which I can reach in Safe Mode of course, but it would be easier to deal with if it appeared somewhere on my desktop/taskbar or CP (I am also an Admin). In Safe Mode I made sure that the right settings were made for displaying, but it doesn't.
    I know precious little about Java so I need help here.

    This forum is dedicated to Sun's Java Desktop System, an alternative desktop operating environment. Try reposting here:
    http://forum.java.sun.com/forum.jspa?forumID=54

Maybe you are looking for