Hi I need help on URL Connection Class

Hi
I have read the documentation but cant get it . I have to Use the getContent(); method so can any one make a program for me in which all of the methods of this class have been used?
I Also Need help on Content Handler Class Please give me one example on it but separate from the above one
Thanx alot

Hi
Man Some Times We need help and as of google, Google is My Best Friend. and as of forums search i know that but some time we have less time and much to work. The Time Doesnt wait us. we have to save our time. thanx for ur help and ur comments i like it.

Similar Messages

  • Hi! I need help, today I connected my mac Book Air to a tv for a presentation and as soon as I conected it the image on my screen went bigger. And I cant find the way to put it back as it was before. The Images are too big! heelp

    Hi! I need help, today I connected my mac Book Air to a tv for a presentation and as soon as I conected it the image on my screen went bigger. And I cant find the way to put it back as it was before. The Images are too big! heelp

    Morning DeeHutton,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at this article:
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/ts2802
    Best of luck,
    Mario

  • URGENT: Need help reading URL of current page

    Hello kind people!
    I need help, and its very simple:
    How do i read the URL of a web page?
    For example, the URL of this page is:
    http://forums.sun.com/thread.jspa?threadID=5327796
    So how can i be able to read in this URL in my java program?
    thanks SO MUCH
    P.S. I HAVE searched the java docs and everything, the closest thing i found was request.getRequestURL().? but i have no idea how to use it. you have NO IDEA how appreciative i would be if you could simply show me exactly how to read in the URL of a given page.
    thanks SO MUCH
    Edited by: homegrownpeas on Aug 31, 2008 5:19 PM

    Going by what I understand here is a simple version of how you can read data from over HTTP.
    This expects the "page" to be text (hence an InputStreamReader instead of an InputStream.)
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import java.net.URLConnection;
    import java.util.HashMap;
    * GPLv2.
    * @author karlm816
    public class HomeGrownPeas {
          * @param args
         public static void main(String[] args) {
              HashMap<String, String> params = new HashMap<String, String>();
              params.put("threadID", "5327796");
              System.out.println(loadHttpPage("http://forums.sun.com/thread.jspa", params));     
         public static String loadHttpPage(String sUrl, HashMap<String, String> params) {
              // Build the HTTP request string
              StringBuilder sb = new StringBuilder();
              if (params != null) {
                   for (String key : params.keySet()) {
                        if (sb.length() > 0) {
                             sb.append("&");
                        sb.append(key);
                        sb.append("=");
                        sb.append(params.get(key));
              System.out.println("params: " + sb.toString());
              try {
                   URL url = new URL(sUrl);
                   URLConnection connection = url.openConnection();
                   connection.setDoOutput(true);
                   connection.setRequestProperty("Content-Length", "" + sb.length());
                   connection.setUseCaches(false);
                   if (connection instanceof HttpURLConnection) {
                        HttpURLConnection conn = (HttpURLConnection) connection;
                        conn.setRequestMethod("POST");
                   OutputStreamWriter osw = new OutputStreamWriter(connection.getOutputStream());
                   osw.write(sb.toString());
                   osw.close();
                   // Now use sb to hold the resutls from the request
                   sb = new StringBuilder();
                   BufferedReader in = new BufferedReader(
                         new InputStreamReader(
                         connection.getInputStream()));
                   String s;
                   while ((s = in.readLine()) != null) {
                        sb.append(s);
                        // To make it more "human readable"
                        sb.append("\n");
                   in.close();
             } catch (IOException e) {
                  e.printStackTrace();
                  return null;
            return sb.toString();
    }

  • Need help w corba/jdbc class

    hi
    i'm trying to get this class to work right, i don't think i'm coding it the right way, especially the getAllAccounts() and selectAccounts() methods. this code compiles cleanly, but i get runtime exceptions when i try to run my app. my runtime exceptions look like
    ############################ StackTrace ############################
    java.lang.NullPointerException
    at com.kafein.accountServices.AccountServiceImpl.getAllAccounts(AccountS
    erviceImpl.java:218)
    at com.kafein.idl.accountServices.AccountServicePOA._invoke(AccountServi
    cePOA.java:74)
    at org.jacorb.poa.RequestProcessor.invokeOperation(RequestProcessor.java
    :247)
    at org.jacorb.poa.RequestProcessor.process(RequestProcessor.java:477)
    at org.jacorb.poa.RequestProcessor.run(RequestProcessor.java:604)
    and
    Creating 100 Accounts
    org.omg.CORBA.UNKNOWN: This exception was reported by the server, it is only re-
    thrown here. vmcid: 0x0 minor code: 0 completed: No
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.jacorb.orb.SystemExceptionHelper.read(SystemExceptionHelper.java:
    157)
    at org.jacorb.orb.connection.ReplyInputStream.checkExceptions(ReplyInput
    Stream.java:117)
    at org.jacorb.orb.Delegate.invoke(Delegate.java:942)
    at org.omg.CORBA.portable.ObjectImpl._invoke(Unknown Source)
    at com.kafein.idl.accountServices._AccountServiceStub.getAllAccounts(_Ac
    countServiceStub.java:134)
    at com.kafein.client.AccountClient.main(AccountClient.java:111)
    org.omg.CORBA.UNKNOWN: This exception was reported by the server, it is only re-
    thrown here. vmcid: 0x0 minor code: 0 completed: No
    ORB shutting down...
    code for this class is below...
    // AccountServiceImpl.java: The AccountService Implementation
    package com.kafein.accountServices;
    import java.util.Hashtable;
    import java.util.Calendar;
    import java.util.GregorianCalendar;
    import junit.framework.TestCase;
    import junit.framework.Test;
    import junit.framework.TestSuite;
    import org.omg.PortableServer.*;
    import com.kafein.idl.accountServices.AccountServicePOA;
    import com.kafein.idl.accountServices.AccountEntryStruct;
    import com.kafein.idl.accountServices.AccountStruct;
    import com.kafein.idl.utilities.DateTimeStruct;
    import com.kafein.idl.exceptions.NotFoundException;
    import com.kafein.idl.exceptions.DataValidationException;
    import com.kafein.idl.errorCodes.DataValidationErrorCodes;
    import com.kafein.utils.ServiceHandler;
    import com.kafein.utils.Log;
    import java.net.URL;
    import java.sql.*;
    import java.util.*;
    * AccountServiceImpl is an implementation of the
    * idl.accountServices.AccountService interface.
    public class AccountServiceImpl extends AccountServicePOA {
      POA poa;
      private Hashtable accounts = new Hashtable(); // collection of Accounts
      private static int nextAccountID = 1; // global account ID
      Connection connection;
      Vector connections;
      Statement statement;
      PreparedStatement preparedStatement;
       * Construct an instance.
      public AccountServiceImpl(POA aPOA, String driver, String url, String user, String password) {
        super();
        poa = aPOA;
        driver = driver;
        url = url;
        user = user;
        password = password;
        connections = new Vector();
        // Connect to Database
        try {
            connect(driver,url,user,password);
        catch(Exception e) {
               e.printStackTrace();       
        // Simple Database Select
        try {
            testSimpleSelect();
        catch(Exception e) {
               e.printStackTrace();       
        // Database Select
        try {
            testSelect();
        catch(Exception e) {
               e.printStackTrace();       
       * Overloaded constructor for unit tests.
      protected AccountServiceImpl() {
        poa = null;
       * createAccount is used by administrator to add a new Account
       * in the system.
       * @param newAccount AccountEntryStruct containing data for new account
       * @return int the new unique Account ID
       * @exception com.kafein.idl.exceptions.DataValidationException
      public int createAccount(AccountEntryStruct newAccount) throws
        DataValidationException {
        validateData (newAccount); // throws DataValidationException;
        int accountID = getNextID();     
        // Create new Account.
        Account anAccount = new Account(accountID,
                            newAccount.userName,
                            newAccount.userEmail,
                            newAccount.creditCardType,
                            newAccount.creditCardNumber,
                            newAccount.creditCardExpirationDate.year,
                            newAccount.creditCardExpirationDate.month,
                            newAccount.userPassword,
                            newAccount.initialBalance);
    // Insert here / call method insertAccount() pass it in an account object
    // or call manager object - accountmanager.put()
        // Insert Account into Database
        try {
            insertAccount(anAccount);
        catch(Exception e) {
               e.printStackTrace();       
        accounts.put(accountID,anAccount);
        return accountID;
       * isAccountValid is used to validate a user logon.
       * @param accountID AccountID
       * @param userPassword String
       * @return boolean true to indicate an existing Account
      public boolean isValidAccount (int accountID, String userPassword) {
        // Get account with key equal to accountID.
        AccountStruct anAccount;
        try {
          anAccount = (AccountStruct) getAccount (accountID);
        catch (NotFoundException e) {
          return false;
        // Verify password.
        return (anAccount.userPassword.equals(userPassword) ? true : false);
       * getAccount is used to retrieve an existing Account in the system
       * @param int AccountID
       * @return AccountStruct containing data for the existing Account
       * @exception com.kafein.idl.exceptions.NotFoundException
      public AccountStruct getAccount(int accountID)throws
        NotFoundException {
        // Verify that accountID is within an appropriate interval.
        if (accountID < 1 || accountID > accounts.size()) {
          throw new NotFoundException(DataValidationErrorCodes.INVALID_ACCOUNT_ID,
                          "Account ID not found");
        // Get Account and convert to AccountStruct (which is returned).
        Account anAccount = (Account) accounts.get(accountID);
        return anAccount.getAccountStruct();
       * getAllAccounts is used to retrieve all existing Accounts in the system
       * @return AccountStruct[] containing all existing Accounts.
       * @fyi returns an empty sequence if no Accounts exist
      // GetAllAcounts method v. 2 - rather than enumerating through the vector
      // call a method that returns a collection of objs in that method where
      // you do select stmts
      public AccountStruct[] getAllAccounts() {
        // Allocate the array of AccountStructs.
        Vector results = new Vector();
        try {
                results = selectAccounts();
        catch(Exception e) {
               e.printStackTrace();       
        //Vector results = selectAccounts();
        int lastKey = results.size();
        //int lastKey = accounts.size();
        AccountStruct[] accountSequence = new AccountStruct[lastKey];
        if (lastKey==0) {
          return accountSequence;
        // Create AccountStructs from Accounts.
        for (int i = 1; i <= lastKey; i++) {
          Account anAccount = (Account) accounts.get(i);
          accountSequence[i-1] = anAccount.getAccountStruct();
        return accountSequence;
       * validateData is used to check new account data.
       * @param newAccount AccountEntryStruct containing data for new account
       * @exception com.kafein.idl.exceptions.DataValidationException
      protected void validateData(AccountEntryStruct newAccount) throws
        DataValidationException {
        // Check all of the member data in newAccount.
        if (newAccount.userName.equals("")) {
          throw new DataValidationException(
              DataValidationErrorCodes.INVALID_USER_NAME,
              "User Name must not be empty");
        if (newAccount.userEmail.equals("")) {
          throw new DataValidationException(
              DataValidationErrorCodes.INVALID_USER_EMAIL,
              "User Email must not be empty");
        if (newAccount.creditCardType.equals("")) {
          throw new DataValidationException(
              DataValidationErrorCodes.INVALID_CREDIT_CARD_TYPE,
              "Credit card type must not be empty");
        if (newAccount.creditCardNumber.equals("")) {
          throw new DataValidationException(
              DataValidationErrorCodes.INVALID_CREDIT_CARD_NUMBER,
              "Credit card number must not be empty");
        // Compare creditCardExpirationDate to current date
        // (we only consider year and month).
        GregorianCalendar now = new GregorianCalendar();
        DateTimeStruct proposed = newAccount.creditCardExpirationDate;
        if (proposed.year < now.get (Calendar.YEAR) ||
         (proposed.year == now.get (Calendar.YEAR) &&
          proposed.month < now.get (Calendar.MONTH) + 1)) {
          throw new DataValidationException(
              DataValidationErrorCodes.INVALID_CREDIT_CARD_EXPIRATION_DATE,
              "Credit card has expired");
        if (newAccount.userPassword.equals("")) {
          throw new DataValidationException(
              DataValidationErrorCodes.INVALID_USER_PASSWORD,
              "Password must not be empty");
        else if (!newAccount.userPassword.equals(newAccount.userPasswordVerification)) {
          throw new DataValidationException(
              DataValidationErrorCodes.INVALID_USER_PASSWORD,
              "Password verification failure");
        if (newAccount.initialBalance < 0.0F) {
          throw new DataValidationException(
              DataValidationErrorCodes.INVALID_BALANCE,
              "Account Balance cannot have a negative balance");
       * getNextID is used to generate a unique ID.
       * Needs a much better implementation that generates a globally unique ID!
       * @return int an Account ID
      protected synchronized int getNextID() {
        nextAccountID++;
        return nextAccountID - 1;
       * override _default_POA to return this servant's POA, not Root POA
      public POA _default_POA() {
        return poa;
       * jdbc related methods
      public void connect(String driver, String url, String user, String password)
                    throws Exception {
            try {
                // Load JDBC driver
                Class.forName(driver);
                System.out.println("Connecting to " + url);
                connection = DriverManager.getConnection(url, user, password);
                connections.add(connection);
                connection.setAutoCommit(false);
            } catch(Exception e) {
                System.err.println("System Exception in connect");
                System.err.println(e);
                throw e;
      public void closeConnection() throws Exception {
            try {
                Enumeration myEnum = connections.elements();
                while ( myEnum.hasMoreElements() ) {
                    System.out.println("Closing connection");
                    ((Connection) myEnum.nextElement()).close();
            } catch (Exception e) {
                System.err.println("System Exception in closeConnection");
                System.err.println(e);
                throw e;
      private void testSimpleSelect() throws Exception {
            try {
                Statement statement = connection.createStatement();
                ResultSet rs = statement.executeQuery("Select 1 from ACCOUNT");
                if (rs != null && rs.next()) {
                   int value = rs.getInt(1);
                   System.out.println("Fetched value " + value);
                connection.commit();
                statement.close();
            } catch(Exception e) {
                System.err.println("System Exception in testSimpleSelect");
                System.err.println(e);
                throw e;
      private void testSelect() throws Exception {
            try {
                Statement statement = connection.createStatement();
                ResultSet rs = statement.executeQuery(
                    "Select ACCT_ID, ACCT_USERNAME, ACCT_USEREMAIL, ACCT_CC_TYPE, ACCT_CC_NUMBER, ACCT_CC_EXPYR, ACCT_CC_EXPMO, ACCT_USERPASSWORD, ACCT_USERBALANCE from ACCOUNT LIMIT 1");
                System.out.println("Account ID   User Name     User Email     CC Type     CC Number     CC Expyr CC Expmo User Password     User Balance");
                while (rs != null && rs.next()) {
                    int acct_id = rs.getInt(1);
                    String acct_username = rs.getString(2);
                    String acct_useremail = rs.getString(3);
                    String acct_cc_type = rs.getString(4);
                    String acct_cc_number = rs.getString(5);
                    int acct_cc_expyr = rs.getInt(6);
                    int acct_cc_expmo = rs.getInt(7);
                    String acct_userpassword = rs.getString(8);
                    float acct_userbalance = rs.getFloat(9);
                    System.out.println(acct_id + "         " +
                                       acct_username + "   " +
                                       acct_useremail + "   " +
                                       acct_cc_type + "   " +
                                       acct_cc_number + "   " +
                                       acct_cc_expyr + "   " +
                                       acct_cc_expmo + "   " +
                                       acct_userpassword + "   " +
                                       acct_userbalance);
                connection.commit();
                statement.close();
            } catch(Exception e) {
                System.err.println("System Exception in testSelect");
                System.err.println(e);
                throw e;
      private void testLoadData() throws Exception {
            int numberOfAccounts = 5;
            String  acct_username    = "<--20 BYTE STRING-->";
            String  acct_useremail = "<--20 BYTE STRING-->";
         String  acct_cc_type = "TEST ";
            String  acct_cc_number = "<--20 BYTE STRING-->";
            int  acct_cc_expyr = 2000;
            int  acct_cc_expmo = 1;
            String  acct_userpassword = "<--20 BYTE STRING-->";
            float     acct_userbalance = 0.0F;
            int     acct_id = 0;
         try {
                System.out.println("Inserting data...");
                connection.setAutoCommit(false);
                // Calculate Start time
                System.out.println("Starting data insertion (" + numberOfAccounts +
                    " rows) into ACCOUNT table..");
                long startTime = System.currentTimeMillis();
                preparedStatement = connection.prepareStatement(
                    "INSERT INTO ACCOUNT (ACCT_ID, ACCT_USERNAME, ACCT_USEREMAIL, ACCT_CC_TYPE, ACCT_CC_NUMBER, " +
                    "ACCT_CC_EXPYR, ACCT_CC_EXPMO, ACCT_USERPASSWORD, ACCT_USERBALANCE) VALUES ( ?, ?, ?, ?, ?, ? , ?, ?, ?)");
                // Insert accounts in ACCOUNT table
                for (int i = 1; i <= numberOfAccounts; i++) {
                    acct_id  = i * 1000;
                    preparedStatement.setInt(1, acct_id);
                    preparedStatement.setString(2, acct_username);
                    preparedStatement.setString(3, acct_useremail);
                    preparedStatement.setString(4, acct_cc_type);
                    preparedStatement.setString(5, acct_cc_number);
                    preparedStatement.setInt(6, acct_cc_expyr);
                    preparedStatement.setInt(7, acct_cc_expmo);
                    preparedStatement.setString(8, acct_userpassword);
                    preparedStatement.setFloat(9, acct_userbalance);
              preparedStatement.executeUpdate();
                    connection.commit();
                System.out.println(numberOfAccounts + " accounts created.");
                preparedStatement.close();
                long stopTime = System.currentTimeMillis();
                System.out.println("Account table load complete.");
                System.out.println("Load time = " +
                                   ((stopTime - startTime)/(1000f)) + " seconds");
                System.out.println("Data insertion complete");
            } catch(Exception e) {
                System.err.println("System Exception in loadData");
                System.err.println(e);
                throw e;
       * insertAccount is used to insert a new Account in the Database
       * @param int AccountID
       * @return AccountStruct containing data for the existing Account
      private void insertAccount(Account anAccount) throws Exception {
              AccountStruct anAccountStruct = anAccount.getAccountStruct();  
         int numberOfAccounts = 1;
         String  acct_username    = anAccountStruct.userName;
            String  acct_useremail = anAccountStruct.userEmail;
         String  acct_cc_type = anAccountStruct.creditCardType;
            String  acct_cc_number = anAccountStruct.creditCardNumber;
         int acct_cc_expyr = anAccountStruct.creditCardExpirationDate.year;
            int acct_cc_expmo = anAccountStruct.creditCardExpirationDate.month;
            String  acct_userpassword = anAccountStruct.userPassword;
            float     acct_userbalance = anAccountStruct.accountBalance;
            int     acct_id = anAccountStruct.accountID;
         try {
                System.out.println("Inserting data...");
                connection.setAutoCommit(false);
    //instead of system.out just log
                // Calculate Start time
                System.out.println("Starting data insertion ( 1" +
                    " row) into ACCOUNT table..");
                long startTime = System.currentTimeMillis();
                preparedStatement = connection.prepareStatement(
                    "INSERT INTO ACCOUNT (ACCT_ID, ACCT_USERNAME, ACCT_USEREMAIL, ACCT_CC_TYPE, ACCT_CC_NUMBER, " +
                    "ACCT_CC_EXPYR, ACCT_CC_EXPMO, ACCT_USERPASSWORD, ACCT_USERBALANCE) VALUES ( ?, ?, ?, ?, ?, ? , ?, ?, ?)");
                    acct_id  = 1000;
                    preparedStatement.setInt(1, acct_id);
                    preparedStatement.setString(2, acct_username);
                    preparedStatement.setString(3, acct_useremail);
                    preparedStatement.setString(4, acct_cc_type);
                    preparedStatement.setString(5, acct_cc_number);
                    preparedStatement.setInt(6, acct_cc_expyr);
                    preparedStatement.setInt(7, acct_cc_expmo);
                    preparedStatement.setString(8, acct_userpassword);
                    preparedStatement.setFloat(9, acct_userbalance);
              preparedStatement.executeUpdate();
                    connection.commit();
                System.out.println("1 account created.");
                preparedStatement.close();
                long stopTime = System.currentTimeMillis();
                System.out.println("Account table load complete.");
                System.out.println("Load time = " +
                                   ((stopTime - startTime)/(1000f)) + " seconds");
                System.out.println("Data insertion complete");
            } catch(Exception e) {
                System.err.println("System Exception in loadData");
                System.err.println(e);
                throw e;
      private Vector selectAccounts() throws Exception {
            try {
                // Create Vector to hold individual Account values
             Vector mainvector = new Vector();
             Vector values = new Vector();
             Statement statement = connection.createStatement();
                ResultSet rs = statement.executeQuery(
                    "Select ACCT_ID, ACCT_USERNAME, ACCT_USEREMAIL, ACCT_CC_TYPE, ACCT_CC_NUMBER, ACCT_CC_EXPYR, ACCT_CC_EXPMO, ACCT_USERPASSWORD, ACCT_USERBALANCE from ACCOUNT");
                System.out.println("Account ID   User Name     User Email     CC Type     CC Number     CC Expyr CC Expmo User Password     User Balance");
             // Iterate through result set
             while (rs != null && rs.next()) {
              // Make sure values is empty
              values.clear();
              int acct_id = rs.getInt(1);
                    String acct_username = rs.getString(2);
                    String acct_useremail = rs.getString(3);
                    String acct_cc_type = rs.getString(4);
                    String acct_cc_number = rs.getString(5);
                    int acct_cc_expyr = rs.getInt(6);
                    int acct_cc_expmo = rs.getInt(7);
                    String acct_userpassword = rs.getString(8);
                    float acct_userbalance = rs.getFloat(9);
              // Populate Vector values
              values.addElement(rs.getObject(1));
              values.addElement(rs.getObject(2));
              values.addElement(rs.getObject(3));
              values.addElement(rs.getObject(4));
              values.addElement(rs.getObject(5));
              values.addElement(rs.getObject(6));
              values.addElement(rs.getObject(7));
              values.addElement(rs.getObject(8));
              values.addElement(rs.getObject(9));
              mainvector.addElement(values);
                    System.out.println(acct_id + "         " +
                                       acct_username + "   " +
                                       acct_useremail + "   " +
                                       acct_cc_type + "   " +
                                       acct_cc_number + "   " +
                                       acct_cc_expyr + "   " +
                                       acct_cc_expmo + "   " +
                                       acct_userpassword + "   " +
                                       acct_userbalance);
                connection.commit();
                statement.close();
             return mainvector;
            } catch(Exception e) {
                System.err.println("System Exception in selectAccounts");
                System.err.println(e);
                throw e;
        }

    line 217 and 218 is
    Account anAccount = (Account) accounts.get(i);
    accountSequence[i-1] = anAccount.getAccountStruct();
    i realized that
    Account anAccount = (Account) accounts.get(i);
    was a typo. what it should have been was
    Account anAccount = (Account) results.get(i);
    so my getAllAccounts() method now looks like
       * getAllAccounts is used to retrieve all existing Accounts in the system
       * @return AccountStruct[] containing all existing Accounts.
       * @fyi returns an empty sequence if no Accounts exist
      // GetAllAcounts method v. 2 - rather than enumerating through the vector
      // call a method that returns a collection of objs in that method where
      // you do select stmts
      public AccountStruct[] getAllAccounts() {
        // Allocate the array of AccountStructs.
        Vector results = new Vector();
        try {
                results = selectAccounts();
        catch(Exception e) {
               e.printStackTrace();       
        //Vector results = selectAccounts();
        int lastKey = results.size();
        //int lastKey = accounts.size();
        AccountStruct[] accountSequence = new AccountStruct[lastKey];
        if (lastKey==0) {
          return accountSequence;
        // Create AccountStructs from Accounts.
        for (int i = 1; i <= lastKey; i++) {
          Account anAccount = (Account) results.get(i);
          accountSequence[i-1] = anAccount.however, i still get the same runtime errors.
    is my selectAccounts() method returning a null?

  • Need help creating URL for getImage

    In the following code example, I get an error when javac compiling. I need help, because I cannot determine what is wrong. "....." denotes extraneous code removed for readability.
    import java.awt.*;
    import java.io.*;
    import java.applet.*;
    import java.net.*;
    public class testapp extends java.applet.Applet implements java.lang.Runnable
    public static void main(String[] argv)
    ����.
    public void init()
    Toolkit toolkit = Toolkit.getDefaultToolkit();
    Image image1 = toolkit.getImage("imageFile.gif");
    Image image2 = toolkit.getImage( new URL("http://java.sun.com/graphics/people.gif"));
    ��
    javac reports:
    unreported exception java.net.MalformedURLException; must be caught or declared to be thrown
    Image image2 = toolkit.getImage( new URL ("http://java.sun.com/graphics/people.gif"));
    ................................................^

    With this recommended code:
    ===================
    try {  Image image2 = toolkit.getImage( new URL  ("http://java.sun.com/graphics/people.gif"));}catch(MalformURLExceptione){System.out.println("Error"); }
    ======================
    it now compiles ok, but when I access the page through the browser, I get "applet not initialized" and the page times out.
    With the lines commented out, the page loads.
    What does this tell us:
    - all we have done is mask a problem that the compiler previously highlighted.
    But what is the problem?
    As far as I can tell, the code is exact copies from the examples posted online.
    Where should System.out.println("Error"); be displayed? I can't find it. There might be a clue in the error message.

  • Need Help In "Custom" TopBar Class

    New to Plumtree and need help to get rolling. Req's is simple thus far: To supress render of "Login" link in TopBarView for Guests if certain URL is captured at Request.
    There were some topics here that suggests extending from the Class PlumtreeTopBarView.CS, I just need to identify which UI part that renders the "Login" html link to supress this. I got the function to use to capture the URL string -> GetRequestURL(), I am fishing info on where or what function in PlumtreeTopBarView I need to override to plugin a condition that if this URL string == <something> then suppress "Login" link, or the Search, or whatever elements in the TopBar I need to suppress if need be??
    Is there some Help file in PT that I can reference that will enable me to find what namespace does GetRequestURL() belongs to? Please bear with me I am very new to PT code infrastructure, still trying to find stuff with strict deadlines. Much Obliged in advance...

    You just need to create your own version of PlumtreeTopBarView (original in com.plumtree.common.uiparts), and use CustomActivitySpace.xml to override that view with your own view. Your version would use some kidn fo logic to determine whether or not to display certain elements. TheUI Customization Guide should help quite a bit, and we have several quickstarts for overriding views you can start from.
    Is there some Help file in PT that I can reference that will enable me to find what namespace does GetRequestURL() belongs to?I would simply do a string compare. Tokenize the URL into the base address / control arguments, perhaps splitting on the "?" symbol; then tokenize the base address on the ".". You'll end up with three strings. For portal.plumtree.com, the three strings would portal, plumtree, and com. You can then use those string in the logig you add to PlumtreeTopBarView.
    David Phipps
    Plumtree Software

  • Need help with assignment for class. its for my high school project :(

    i really need help, my problem is that with my code i cannot get the "previous", "done" and "next" buttons to work.they cannot seem to find the items from each other. so could someone look at those buttons in the code and tell me how to fix please? the code is as follows:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class GradeCalculator extends JFrame {
         private JTextField gradeA = new JTextField(3);
         private JTextField gradeB = new JTextField(3);
         private JTextField gradeC = new JTextField(3);
         private JTextField gradeD = new JTextField(3);
         private JTextField gradeE = new JTextField(3);
         private JTextField studentsName = new JTextField(15);
         private JTextField assignmentOne = new JTextField(5);
         private JTextField assignmentTwo = new JTextField(5);
         private JTextField assignmentThree = new JTextField(5);
         private JTextField examOne = new JTextField(5);
         private JTextField examTwo = new JTextField(5);
         private JTextArea textOutput;
         private JPanel buttonJPanel;
         public GradeCalculator(){
              JMenu fileMenu = new JMenu("File");
              JMenuItem aboutItem = new JMenuItem( "About" );
    fileMenu.add( aboutItem );
    aboutItem.addActionListener(
    new ActionListener()
    public void actionPerformed( ActionEvent event )
    JOptionPane.showMessageDialog( GradeCalculator.this,
    "Grade Calculator Version 1.00. \nMade by Carlson Smith.\nSchool: Pre-University\nSubject: Cape Computer Science.",
    "About", JOptionPane.PLAIN_MESSAGE );
              JMenuItem exitItem = new JMenuItem( "Exit" );
    fileMenu.add( exitItem );
    exitItem.addActionListener(
    new ActionListener()
    public void actionPerformed( ActionEvent event )
    System.exit( 0 );
              JMenuBar bar = new JMenuBar();
              setJMenuBar(bar);
              bar.add(fileMenu);     
              JTabbedPane tabbedPane = new JTabbedPane();
              buttonJPanel = new JPanel();
              buttonJPanel.setLayout(new GridLayout(1,2));
              JButton ok = new JButton("OK");
              ok.addActionListener(new OkBtnListener());
              JButton edit = new JButton("EDIT");
              edit.addActionListener(new EditBtnListener());
              /**JButton previous = new JButton("PREVIOUS");
              previous.addActionListener(new PreviousBtnListener());
              JButton done = new JButton("DONE");
              done.addActionListener(new DoneBtnListener());
              JButton next = new JButton("NEXT");
              next.addActionListener(new NextBtnListener());
              JPanel contentPane = new JPanel();
              contentPane.setLayout(new FlowLayout());
              contentPane.add(new JLabel("Grade A")/**,BorderLayout.NORTH*/);
              contentPane.add(gradeA/**,BorderLayout.NORTH*/);
              contentPane.add(new JLabel("Grade B")/**,BorderLayout.WEST*/);
              contentPane.add(gradeB/**,BorderLayout.WEST*/);
              contentPane.add(new JLabel("Grade C")/**,BorderLayout.WEST*/);
              contentPane.add(gradeC/**,BorderLayout.WEST*/);
              contentPane.add(new JLabel("Grade D")/**,BorderLayout.WEST*/);
              contentPane.add(gradeD/**,BorderLayout.WEST*/);
              contentPane.add(new JLabel("Grade E")/**,BorderLayout.WEST*/);
              contentPane.add(gradeE/**,BorderLayout.WEST*/);
              tabbedPane.addTab("Grade Entry Tab", null, contentPane, "Grade Tab");
              //contentPane.add(ok,BorderLayout.WEST);
              //contentPane.add(edit,BorderLayout.WEST);
              buttonJPanel.add(ok);
              buttonJPanel.add(edit);
              contentPane.add(buttonJPanel, BorderLayout.WEST);
              JPanel content = new JPanel();
              content.setLayout(new FlowLayout());
              content.add(new JLabel("Student's Name")/**,BorderLayout.EAST*/);
              content.add(studentsName/**,BorderLayout.EAST*/);
              content.add(new JLabel("Assignment 1 score:")/**,BorderLayout.EAST*/);
              content.add(assignmentOne/**,BorderLayout.EAST*/);
              content.add(new JLabel("Assignment 2 score:")/**,BorderLayout.EAST*/);
              content.add(assignmentTwo/**,BorderLayout.EAST*/);
              content.add(new JLabel("Assignment 3 score:")/**,BorderLayout.EAST*/);
              content.add(assignmentThree/**,BorderLayout.EAST*/);
              content.add(new JLabel("Exam 1 score:")/**,BorderLayout.EAST*/);
              content.add(examOne/**,BorderLayout.EAST*/);
              content.add(new JLabel("Exam 2 score:")/**,BorderLayout.EAST*/);
              content.add(examTwo/**,BorderLayout.EAST*/);
              //content.add(previous,BorderLayout.EAST);
              //content.add(done,BorderLayout.EAST);
              //content.add(next,BorderLayout.EAST);
              Box box = Box.createVerticalBox();
              String output = "test";
              String outputTwo = output;
              textOutput = new JTextArea(outputTwo,10,30);
              box.add(new JScrollPane(textOutput));
              textOutput.setEditable(false);
              content.add(box,BorderLayout.SOUTH);
              tabbedPane.addTab("Calculator Tab", null, content, "Calculation & Output Tab");
              setContentPane(tabbedPane);
              pack();
              setTitle("Grade Calculator");
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              setLocationRelativeTo(null);
              class OkBtnListener implements ActionListener{
                   public void actionPerformed(ActionEvent e){
                        String gradeAA = gradeA.getText();
                        double gradA = Double.parseDouble(gradeAA);
                        gradeA.setText(" "+gradA);
                        String gradeBB = gradeB.getText();
                        double gradB = Double.parseDouble(gradeBB);
                        gradeB.setText(" "+gradB);
                        String gradeCC = gradeC.getText();
                        double gradC = Double.parseDouble(gradeCC);
                        gradeC.setText(" "+gradC);
                        String gradeDD = gradeD.getText();
                        double gradD = Double.parseDouble(gradeDD);
                        gradeD.setText(" "+gradD);
                        String gradeEE = gradeE.getText();
                        double gradE = Double.parseDouble(gradeEE);
                        gradeE.setText(" "+gradE);
                        gradeA.setEditable(false);
                        gradeB.setEditable(false);
                        gradeC.setEditable(false);
                        gradeD.setEditable(false);
                        gradeE.setEditable(false);
              class EditBtnListener implements ActionListener{
                   public void actionPerformed(ActionEvent e){
                        gradeA.setEditable(true);
                        gradeB.setEditable(true);
                        gradeC.setEditable(true);
                        gradeD.setEditable(true);
                        gradeE.setEditable(true);
              /**class PreviousBtnListener implements ActionListener{
                   public void actionPerformed(ActionEvent e){
                        if (i <= 0){
                             i = 0;
                        }else if(i > 0){
                             i = i-1;
              class DoneBtnListener implements ActionListener{
                   public void actionPerformed(ActionEvent e){
                        output = "Results \n";
                        output+= studentName[i]+" Assignment Average = "+averageO[i]+" Exam Average = "+averageT[i]+" Overall average = ";
                        output+= tAverage[i]+" Letter Grade = "+letterGrade;
              class NextBtnListener implements ActionListener{
                   public void actionPerformed(ActionEvent e){
                        String [] studentName = new String [40];
                        double [] assignOne = new double [40];
                        double [] assignTwo = new double [40];
                        double [] assignThree = new double [40];
                        double [] gradeOne = new double [40];
                        double [] gradeTwo = new double [40];
                        double [] averageO = new double [40];
                        double [] averageT = new double [40];
                        double [] tAverage = new double [40];
                        char [] letterGrade = new char [40];
                        double max = 0;
                        double min = 100;
                        int i = 0;
                        while(i < studentName.length){
                             studentName[i] = studentsName.getText();
                             studentsName.setText(studentName[i]);
                             String aOne = assignmentOne.getText();
                             assignOne[i] = Double.parseDouble(aOne);
                             assignmentOne.setText(assignOne[i]);
                             String aTwo = assignmentTwo.getText();
                             assignTwo[i] = Double.parseDouble(aTwo);
                             assignmentTwo.setText(assignTwo[i]);
                             String aThree = assignmentThree.getText();
                             assignThree[i] = Double.parseDouble(aThree);
                             assignmentThree.setText(assignThree[i]);
                             String gOne = examOne.getText();
                             gradeOne[i] = Double.parseDouble(gOne);
                             examOne.setText(gradeOne[i]);
                             String gTwo = examTwo.getText();
                             gradeTwo = Double.parseDouble(gTwo);
                             examTwo.setText(gradeTwo[i]);
                             averageO[i] = (assignOne[i]+assignTwo[i]+assignThree[i])/3;
                             averageT[i] = (gradeOne[i]+gradeTwo[i])/2;
                             tAverage[i] = (averageO[i]+averageT[i])/2;
                             if (tAverage[i] >= gradeA){
                                  letterGrade[i] = 'A';
                             }else if(tAverage[i] >= gradeB){
                                  letterGrade[i] = 'B';
                             }else if(tAverage[i] >= gradeC){
                                  letterGrade[i] = 'C';
                             }else if(tAverage[i] >= gradeD){
                                  letterGrade[i] = 'D';
                             }else if(tAverage[i] <= gradeE){
                                  letterGrade[i] = 'E';
              public static void main(String[]args){
                   GradeCalculator calWindow = new GradeCalculator();
                   calWindow.setVisible(true);

    i have to apologize to jittei for the misunderstand i do not know which defination of terms is for which line of code but i know what they do, to solve the problem i have actually made another class in the workspace file called students and now all the bottons work, all i have to do now is properly arrange and put in some additional lines of code and it will be completed. teacher gave me the idea of putting in a new class to help in calling codes from other subclasses in the main program. ah well guess non of you could think of that thanks for the help-ish and hope yall will atleast try to be nice to new people that come in the room. the new coding is:
    of course all the commented out lines are not being used in the program anymore but just there till i have the program working with everything in it runs and performs the actions required now though ^_^
    *Group CAPE Computer Science 2007/8
    *GradeCalculator.java
    *@author Carlson Smith
    *@version 3.01          07/02/2008
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class GradeCalculator extends JFrame {
         private JTextField gradeA = new JTextField(3);
         private JTextField gradeB = new JTextField(3);
         private JTextField gradeC = new JTextField(3);
         private JTextField gradeD = new JTextField(3);
         private JTextField gradeE = new JTextField(3);
         private JTextField studentsName = new JTextField(15);
         private JTextField assignmentOne = new JTextField(5);
         private JTextField assignmentTwo = new JTextField(5);
         private JTextField assignmentThree = new JTextField(5);
         private JTextField examOne = new JTextField(5);
         private JTextField examTwo = new JTextField(5);
         private JTextArea  textOutput;
         private JPanel buttonJPanel;
         private JPanel buttonJPanelTwo;
         private Student [] students = new Student[40];
         private int current = 0;
         private String output;
         public GradeCalculator(){
              JMenu fileMenu = new JMenu("File");
              JMenuItem aboutItem = new JMenuItem( "About" );
              for (int i=0;i<40;i++){
                   students[i] = new Student("");
            fileMenu.add( aboutItem );
            aboutItem.addActionListener(
               new ActionListener()
                  public void actionPerformed( ActionEvent event )
                     JOptionPane.showMessageDialog( GradeCalculator.this,
                        "Grade Calculator Version 1.00. \nMade by Carlson Smith.\nSchool: Pre-University\nSubject: Cape Computer Science.",
                        "About", JOptionPane.PLAIN_MESSAGE );
              JMenuItem exitItem = new JMenuItem( "Exit" ); 
            fileMenu.add( exitItem );
            exitItem.addActionListener(
               new ActionListener()
                  public void actionPerformed( ActionEvent event )
                     System.exit( 0 );
              JMenuBar bar = new JMenuBar();
              setJMenuBar(bar);
              bar.add(fileMenu);     
              JTabbedPane tabbedPane = new JTabbedPane();
              buttonJPanel = new JPanel();
              buttonJPanel.setLayout(new GridLayout(1,2));
              JButton ok = new JButton("OK");
              ok.addActionListener(new OkBtnListener());
              JButton edit = new JButton("EDIT");
              edit.addActionListener(new EditBtnListener());
              buttonJPanelTwo = new JPanel();
              buttonJPanelTwo.setLayout(new GridLayout(1,3));
              JButton previous = new JButton("PREVIOUS");
              previous.addActionListener(new PreviousBtnListener());
              JButton done = new JButton("DONE");
              done.addActionListener(new DoneBtnListener());
              JButton next = new JButton("NEXT");
              next.addActionListener(new NextBtnListener());
              JPanel contentPane = new JPanel();
              contentPane.setLayout(new FlowLayout());
              contentPane.add(new JLabel("Grade A")/**,BorderLayout.NORTH*/);
              contentPane.add(gradeA/**,BorderLayout.NORTH*/);
              contentPane.add(new JLabel("Grade B")/**,BorderLayout.WEST*/);
              contentPane.add(gradeB/**,BorderLayout.WEST*/);
              contentPane.add(new JLabel("Grade C")/**,BorderLayout.WEST*/);
              contentPane.add(gradeC/**,BorderLayout.WEST*/);
              contentPane.add(new JLabel("Grade D")/**,BorderLayout.WEST*/);
              contentPane.add(gradeD/**,BorderLayout.WEST*/);
              contentPane.add(new JLabel("Grade E")/**,BorderLayout.WEST*/);
              contentPane.add(gradeE/**,BorderLayout.WEST*/);
              tabbedPane.addTab("Grade Entry Tab", null, contentPane, "Grade Tab");
              //contentPane.add(ok,BorderLayout.WEST);
              //contentPane.add(edit,BorderLayout.WEST);
              buttonJPanel.add(ok);
              buttonJPanel.add(edit);
              contentPane.add(buttonJPanel, BorderLayout.WEST);
              JPanel content = new JPanel();
              content.setLayout(new FlowLayout());
              content.add(new JLabel("Student's Name")/**,BorderLayout.EAST*/);
              content.add(studentsName/**,BorderLayout.EAST*/);
              content.add(new JLabel("Assignment 1 score:")/**,BorderLayout.EAST*/);
              content.add(assignmentOne/**,BorderLayout.EAST*/);
              content.add(new JLabel("Assignment 2 score:")/**,BorderLayout.EAST*/);
              content.add(assignmentTwo/**,BorderLayout.EAST*/);
              content.add(new JLabel("Assignment 3 score:")/**,BorderLayout.EAST*/);
              content.add(assignmentThree/**,BorderLayout.EAST*/);
              content.add(new JLabel("Exam 1 score:")/**,BorderLayout.EAST*/);
              content.add(examOne/**,BorderLayout.EAST*/);
              content.add(new JLabel("Exam 2 score:")/**,BorderLayout.EAST*/);
              content.add(examTwo/**,BorderLayout.EAST*/);
              //content.add(previous,BorderLayout.EAST);
              //content.add(done,BorderLayout.EAST);
              //content.add(next,BorderLayout.EAST);
              buttonJPanelTwo.add(previous);
              buttonJPanelTwo.add(done);
              buttonJPanelTwo.add(next);
              content.add(buttonJPanelTwo, BorderLayout.EAST);
              Box box = Box.createVerticalBox();
              //String outputTwo = output;
              //textOutput.setText(output);
              textOutput = new JTextArea(output,10,30);
              box.add(new JScrollPane(textOutput));
              //textOutput.setEditable(true);
              content.add(box,BorderLayout.SOUTH);
              tabbedPane.addTab("Calculator Tab", null, content, "Calculation & Output Tab");
              setContentPane(tabbedPane);
              pack();
              setTitle("Grade Calculator");
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              setLocationRelativeTo(null);
              class OkBtnListener implements ActionListener{
                   public void actionPerformed(ActionEvent e){
                        String gradeAA = gradeA.getText();
                        double gradA = Double.parseDouble(gradeAA);
                        gradeA.setText(" "+gradA);
                        String gradeBB = gradeB.getText();
                        double gradB = Double.parseDouble(gradeBB);
                        gradeB.setText(" "+gradB);
                        String gradeCC = gradeC.getText();
                        double gradC = Double.parseDouble(gradeCC);
                        gradeC.setText(" "+gradC);
                        String gradeDD = gradeD.getText();
                        double gradD = Double.parseDouble(gradeDD);
                        gradeD.setText(" "+gradD);
                        String gradeEE = gradeE.getText();
                        double gradE = Double.parseDouble(gradeEE);
                        gradeE.setText(" "+gradE);
                        gradeA.setEditable(false);
                        gradeB.setEditable(false);
                        gradeC.setEditable(false);
                        gradeD.setEditable(false);
                        gradeE.setEditable(false);
              class EditBtnListener implements ActionListener{
                   public void actionPerformed(ActionEvent e){
                        gradeA.setEditable(true);
                        gradeB.setEditable(true);
                        gradeC.setEditable(true);
                        gradeD.setEditable(true);
                        gradeE.setEditable(true);
              class PreviousBtnListener implements ActionListener{
                   public void actionPerformed(ActionEvent e){
                        Student currentStudent = students[current];
                        currentStudent.setStudentName(studentsName.getText());          
                        currentStudent.setAssignOne(Double.parseDouble(assignmentOne.getText()));
                        currentStudent.setAssignTwo(Double.parseDouble(assignmentTwo.getText()));
                        currentStudent.setAssignThree(Double.parseDouble(assignmentThree.getText()));
                        currentStudent.setExamOneGrade(Double.parseDouble(examOne.getText()));
                        currentStudent.setExamTwoGrade(Double.parseDouble(examTwo.getText()));
                        currentStudent = students[current];
                        if (current <= 0){
                             current = 0;
                        }else if(current > 0){
                             current = current-1;
                        refresh();               
                        System.out.println(current);
              class DoneBtnListener implements ActionListener{
                   public void actionPerformed(ActionEvent e){
                        Student currentStudent = students[current];
                        //output = "Result \n";
                        output = currentStudent.getStudentName()+". Assignment Average = "+currentStudent.getAverage()+". Exam Average = "+currentStudent.getExamAverage()+". Overall average = ";
                        output+= currentStudent.getTotalAverage()/**+" Letter Grade = "+letterGrade[current]*/;
                        textOutput.setText(output);
                        System.out.println(output);
                        currentStudent = students[current];
              class NextBtnListener implements ActionListener{
                   public void actionPerformed(ActionEvent e){
    //                    String [] studentName = new String [40];
    //                    double [] assignOne = new double [40];
    //                    double [] assignTwo = new double [40];
    //                    double [] assignThree = new double [40];
    //                    double [] gradeOne = new double [40];
    //                    double [] gradeTwo = new double [40];
    //                    double [] averageO = new double [40];
    //                    double [] averageT = new double [40];
    //                    double [] tAverage = new double [40];
    //                    char [] letterGrade = new char [40];
                        //double max = 0;
                        //double min = 100;
                        Student currentStudent = students[current];
                        currentStudent.setStudentName(studentsName.getText());
                        currentStudent.setAssignOne(Double.parseDouble(assignmentOne.getText()));
                        currentStudent.setAssignTwo(Double.parseDouble(assignmentTwo.getText()));
                        currentStudent.setAssignThree(Double.parseDouble(assignmentThree.getText()));
                        currentStudent.setExamOneGrade(Double.parseDouble(examOne.getText()));
                        currentStudent.setExamTwoGrade(Double.parseDouble(examTwo.getText()));
    //                    currentStudent = students[current];
                        current++;
                        refresh();
    /**                    while(i < studentName.length){
                             String aOne = assignmentOne.getText();
                             assignOne[i] = Double.parseDouble(aOne);
                             assignmentOne.setText(" "+assignOne);
                             String aTwo = assignmentTwo.getText();
                             assignTwo[i] = Double.parseDouble(aTwo);
                             assignmentTwo.setText(" "+assignTwo[i]);
                             String aThree = assignmentThree.getText();
                             assignThree[i] = Double.parseDouble(aThree);
                             assignmentThree.setText(" "+assignThree[i]);
                             String gOne = examOne.getText();
                             gradeOne[i] = Double.parseDouble(gOne);
                             examOne.setText(" "+gradeOne[i]);
                             String gTwo = examTwo.getText();
                             gradeTwo[i] = Double.parseDouble(gTwo);
                             examTwo.setText(" "+gradeTwo[i]);
                             averageO[i] = (assignOne[i]+assignTwo[i]+assignThree[i])/3;
                             averageT[i] = (gradeOne[i]+gradeTwo[i])/2;
                             tAverage[i] = (averageO[i]+averageT[i])/2;
                             if (tAverage[i] >= Double.parseDouble(gradeA.getText())){
                                  letterGrade[i] = 'A';
                             }else if(tAverage[i] >= Double.parseDouble(gradeB.getText())){
                                  letterGrade[i] = 'B';
                             }else if(tAverage[i] >= Double.parseDouble(gradeC.getText())){
                                  letterGrade[i] = 'C';
                             }else if(tAverage[i] >= Double.parseDouble(gradeD.getText())){
                                  letterGrade[i] = 'D';
                             }else if(tAverage[i] <= Double.parseDouble(gradeE.getText())){
                                  letterGrade[i] = 'E';
              public void refresh(){
                   Student currentStudent = students[current];
                   studentsName.setText(currentStudent.getStudentName());
                   assignmentOne.setText(currentStudent.getAssignOne()+"");
                   assignmentTwo.setText(currentStudent.getAssignTwo()+"");
                   assignmentThree.setText(currentStudent.getAssignThree()+"");
                   examOne.setText(currentStudent.getExamOneGrade()+"");
                   examTwo.setText(currentStudent.getExamTwoGrade()+"");
              public static void main(String[]args){
                   GradeCalculator calWindow = new GradeCalculator();
                   calWindow.setVisible(true);
    Second class implemented./**
    *Group CAPE Computer Science 2007/8
    *Student.java
    *@author Carlson Smith
    *@version 3.01          07/02/2008
    public class Student {
         private String studentName;
         private double assignOne;
         private double assignTwo;
         private double assignThree;
         private double examOneGrade;
         private double examTwoGrade;
         public Student(String sName){
              studentName = sName;     
         public String getStudentName(){
              return studentName;
         public double getAssignOne(){
              return assignOne;
         public double getAssignTwo(){
              return assignTwo;
         public double getAssignThree(){
              return assignThree;
         public double getExamOneGrade(){
              return examOneGrade;
         public double getExamTwoGrade(){
              return examTwoGrade;
         public void setStudentName(String sName){
              studentName = sName;
         public void setAssignOne(double assignOne){
              this.assignOne = assignOne;
         public void setAssignTwo(double assignTwo){
              this.assignTwo = assignTwo;
         public void setAssignThree(double assignThree){
              this.assignThree = assignThree;
         public void setExamOneGrade(double examOneGrade){
              this.examOneGrade = examOneGrade;
         public void setExamTwoGrade(double examTwoGrade){
              this.examTwoGrade = examTwoGrade;
         public double getAverage(){
              return (assignOne + assignTwo + assignThree)/3;
         public double getExamAverage(){
              return (examOneGrade + examTwoGrade)/2;
         public double getTotalAverage(){
              return (getAverage() + getExamAverage())/2;
    this thread can be closed now. l8rz :P
    Edited by: Jacal on Feb 10, 2008 7:28 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         

  • I need help configuring a connection with asdm 5.2 for asa

    Hi All
    I am very much a novice with asdm 5.2 for asa and I urgently need to configure a connection but don’t know how to. I have 2 domains at work and someone is trying to connect their sql client from their pc in one domain to the sql server in the other domain (DMZ).
    When he tries to connect he gets the error
    Cant connect to MySql Server at "IP Address" (10060)
    He is trying to connect on port 3306. Could anyone please give me any tips on how i can resolve this quickly? I know i am
    trying a shortcut on this one but I recently started a new job and thrown in the deep end here and need to learn this asdm 5.2 for asa product from scratch with nothing more than the manual that come with the cd . My Cisco knowledge is from 2001 when i did half of a ccna course.
    Any help would be greatly appreciated

    Hi,
    I'm not a security specialist but here is how I had it set up at home:
    Essentially a NAT and a rule forwarding the port are needed. In this particular case I had an Oracle server running and a person requested remote access. So, for example, the source address was his external IP and the destination was the Oracle's external IP. For the NAT the source was the internal IP of the Oracle server and the interface was Outside.
    Hope this points you in the right direction.

  • I need help I cant connect on wifi just "unable to join the network"

    I have problem to my WiFi connection
    I cant connect on WiFi home
    and i have MSG unable to join the network
    but my Iphone this is old iPhone 3
    I need help how can I fix it and i don't know if my phone or the router the problem.
    Pls help give me a easy answer and how i solve it.

    Hello, thanks for your answer, I try that reset, nothing change but my WiFi router when I off it my WiFi it is back after a minute my WiFi it doesn't  work again. I think my router WiFi is the problem because I try everything apple community they suggestion still not working.

  • I need help I can connect my printer to my router to use my printers with my mini I pad

    I need help I have been trying for hours to connect my new e printer to my router ,to use with my ipad mini

    Hi,
    The simplest way to print wirelessly from your ipad is to download the HP eprint app and ensure that both your printer and device are connected to the same wifi network - once this is complete, you'll be bale to print wirelessly from within the eprint app.
    Alternatively, you can use the wireless direct funtion of your printer by turining on the wireless button on the front of the printer. This allows the printer generate it's own wifi singal that you can connect to through any wireless device. To find the wireless password, simply hold down the wireless direct button for more than 3 secs and it will print the password on plain paper (make sure paper is loaded).
    "Although I work for HP, I'm speaking for myself and not on behalf of HP"
    "Say "Thanks" by clicking the Kudos Star in the post that helped you.
    --Please mark the post that solves your problem as "Accepted Solution"

  • ComboBox (dropdown) Need Help Adding URL links!!!

    I am somewhat of a newbie....Anybody know how to use URL
    links in a ComboBox dropdown menu? NEED HELP!!!!!!! I'm trying to
    make it so that after selecting an option, the user is directed to
    another URL within the same browser window. Using flash 8!
    Thanks,

    Im a bit a newbie myslef but i think you make flash
    commuincate to javascript wich will make the browser goto the URL.
    do a search on getURL and javascript together and i am sure
    you will find something.
    And when slecting to redirct i think its on?(onPress)
    something so maybe look throught the help section in flash 8 and
    look at componets. I think there is some actionscript help there.
    Sorry i could not be more helpful.

  • Need help with User defined class

    I need to create two Java classes. The first class will be used as a template for objects which represent students, the second will be a program which creates two student object and calls some of their methods.
    Create a file called "Student.java" and in it definr a class called Student which has the following Attributes:
    * a String variable which can hold the student's name
    * a double variable which can hold the studnet's exam mark.
    In the student class, define public methods as follows:
    1 a constructor method which accepts no arguments. This method should initialise the student's name to "unknown" and set the examination mark to zero
    2 A constructor method which accepts 2 arguments- the first being a string representing the student's name and the other being a double which represents their exam mark. These arguments should be used to initialise the state variables with one proviso- the exam mark must not be set to a number outside the range 0...100. If the double argument is outside this range,set the exam mark attribute to 0.
    3 A reader method which returns the students name
    4 A reader method which returns the students exam mark.
    5 A writer method which sets the student's name
    6 A writer method which sets the student's eeam mark. If the exam mark argument is outside the the 0...100 range,the exam mark attibute should not be modified.
    7 A method which returns the studnet's grade. The grade is a string such as "HD" or "FL" which can be determined from the following table.
    Grade Exam Mark
    HD 85..100
    DI 75..84
    CR 65..74
    PS 50..64
    FL 0..49
    Part2 Client Code
    Write a program in a file called "TestStudent.java"
    Make sure the file is in the same directory as tne "Student.java" file
    In the main method of "TestStudent.java" write code to do each of the following tasks
    1 Create a student object using the no argument constructor.
    2 Print this student's name and their exam mark
    3 Create another student object using the other constructor-supply your own name as the string argument and whatever exam mark you like as the double argument
    4 Print this studnet's name and their exam mark
    5 Change the exam mark of this student to 50 and print their exam mark and grade.
    6 Change the examination mark of this studnet to 256 and print their exam mark and grade.
    Can someone please help
    goober

    Sorry, I have sent you the wrong version. Try this,
    public class Student {
         private String name;
         private double examMark;
         public Student() {
              name = "unknown";
              examMark = 0.0;
         public Student(String n, double em) {
              name = n;
              if(em >0 && em < 100) {
                   examMark = em;
              } else {
                   examMark = 0.0;
         public String getName() {
              return name;
         public void setName(String n) {
              name = n;
         public double getExamMark() {
              return examMark;
         public void setExamMark(double em) {
              if(em >0 && em < 100) {
                   examMark = em;
              } else {
                   examMark = 0.0;
         public String getGrade() {
              if ( examMark > 84) return "HD";
              else if(examMark > 74) return "DI";
              else if(examMark > 64) return "CR";
              else if(examMark > 49) return "PS";
              else return "FL";
    } and
    class TestStudent {
         public static void main(String a[]) {
              Student st = new Student();
              System.out.println("Student Name is : "+st.getName());
              System.out.println("Student Marks is : "+st.getExamMark());
              Student st1 = new Student("XXXX",78);
              System.out.println("Student Name is : "+st1.getName());
              System.out.println("Student Marks is : "+st1.getExamMark());
              st1.setExamMark(67);
              System.out.println("Student Marks is : "+st1.getExamMark());
              System.out.println("Student Grade is : "+st1.getGrade());
              st1.setExamMark(256);
              System.out.println("Student Marks is : "+st1.getExamMark());
              System.out.println("Student Grade is : "+st1.getGrade());
    }Hope this helps.
    Sudha

  • Need help with iphone4 connecting to computer

    On the weekend my friend had put her iphone4 on my computer and now wen i connect my iphone4 to my computer it keeps saying that my iphone is her iphone but its not...
    I really need help coz its doin my head in, i have uninstalled the driver and itunes and reinstalled both and it still does the same thing

    try changing the following wireless settings
    radio band - wide
    wide channel - 9
    standard channel - 11
    if this doesn't work , ensure that the router has the latest firmware ..

  • By. i need help for photoshop connective...from 2 days ave a problem of connective.thank you

    by i need help for my photoshop connective..if you ceck problem please.

    Does your Cloud subscription properly show on your account page?
    If you have more than one email, are you sure you are using the correct Adobe ID?
    https://www.adobe.com/account.html for subscriptions on your Adobe page
    If yes
    Some general information for a Cloud subscription
    Cloud programs do not use serial numbers... you log in to your paid Cloud account to download & install & activate... you MAY need to log out of the Cloud and restart your computer and log back in to the Cloud for things to work
    Log out of your Cloud account... Restart your computer... Log in to your paid Cloud account
    -Sign in help http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html
    -http://helpx.adobe.com/creative-cloud/kb/sign-in-out-creative-cloud-desktop-app.html
    -http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html
    -http://helpx.adobe.com/creative-suite/kb/trial--1-launch.html
    -ID help https://helpx.adobe.com/contact.html?step=ZNA_id-signing_stillNeedHelp
    If no
    This is an open forum, not Adobe support... you need Adobe staff to help
    Adobe contact information - http://helpx.adobe.com/contact.html
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"

  • Need help with WRT300N connecting to a Wireless-G Adapter

    I currently purchased the WRT300N router. I have everything working and it connects to my hardwired pc and my laptop. Only problem I am running across is that I cannot get my other computer to recognise the connectino when the router is set to mixed. Now the computer will recognise the connection if I set the router to wireless - g mode only. But that defeats the purpose becaus I need the wireless-n connection for another computer that has the wireless - n adapter. Anyone know a fix for this, or maybe is havint the same problem?

    try changing the following wireless settings
    radio band - wide
    wide channel - 9
    standard channel - 11
    if this doesn't work , ensure that the router has the latest firmware ..

Maybe you are looking for

  • Dbus hanging at startup, nss_ldap and pam_ldap to blame?

    https://bbs.archlinux.org/viewtopic.php?id=104114 This post is about the same problem I'm having, but I don't really like the solution. I'm running an arch box that is authenticating users through and Windows domain using ldap and kerberos, I know I

  • Its very urgent please kindly respond

    Hi i am new to OA Framework without any knowledege of it and i have a task to do. Please help me out. I have a date field in my page and when i select a date it must be validated and check whether it is between sysdate + 30 or sysdate - 30. The page

  • How to use my own ringtones

    How to move my ringtones from pc to iphone? I have several my own created stuff that I want use in my iphone. Those are in mp3, wav, mp4 and other formats.

  • Netinet includes missing

    When I build my iPhone app using the simulator I have no errors and it works great, but when I build for the device I'm having link errors because it's not finding several of the netinet headers. The files in particular that are missing: #include <ne

  • Material to sale both in domestic and export market

    Dear Experts, If we need to sale a particular finished material in domestic and export scenario then is it necessary to maintain two material master data for one material? If not necessary then how to maintain master data? Regards Jyoti