Results 1 to 3 of 3

Thread: Grabbing Paramaters from a web page. - [SOLVED]

  1. #1

    Thread Starter
    Hyperactive Member gjon's Avatar
    Join Date
    Nov 2004
    Location
    Inescapable Void
    Posts
    442

    Grabbing Paramaters from a web page. - [SOLVED]

    I am trying to grab text from the paramaters values in an html file. Well, before I get to that point, I am getting an error in my applet during compile time. The error message reads:
    cannot find symbol - method getParamater(java.lang.String)
    at the line:
    pString = getParamater("nameofparam");
    is highlighted. This is in BlueJ.
    PHP Code:
    import java.applet.*;
    import java.awt.*;
    import javax.swing.*;

    class 
    MessagePanel2 extends JPanel {

        public 
    void paintComponent(Graphics grafObj) {
            
    super.paintComponent(grafObj);
            
    grafObj.drawString(Wel3.myText5050);
        }
    }

    public class 
    Wel3 extends JApplet
    {
        
    // instance variables - replace the example below with your own
        
    static String myText;
        
         
    /**
         * Called by the browser or applet viewer to inform this JApplet that it
         * has been loaded into the system. It is always called before the first 
         * time that the start method is called.
         */
        
    public void init()
        {
            
            
    // provide any initialisation necessary for your JApplet
            
    Container messageArea getContentPane();
            
    String pString;
            
    pString getParamater("nameofparam");
            
            if (
    pString == null)
                
    myText "html page parameter missing";
            else 
    myText pString;
            
            
    MessagePanel2 myMessagePanel = new MessagePanel2();
            
    messageArea.add(myMessagePanel);
        }
        
    public 
    void start()
        {
            
    // provide any code requred to run each time 
            // web page is visited
        
    }

        
    /** 
         * Called by the browser or applet viewer to inform this JApplet that
         * it should stop its execution. It is called when the Web page that
         * contains this JApplet has been replaced by another page, and also
         * just before the JApplet is to be destroyed. 
         */
        
    public void stop()
        {
            
    // provide any code that needs to be run when page
            // is replaced by another page or before JApplet is destroyed 
        
    }

        
        public 
    void destroy()
        {
            
    // provide code to be run when JApplet is about to be destroyed.
        
    }


    Last edited by gjon; Oct 30th, 2005 at 10:34 AM.

  2. #2
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: Grabbing Paramaters from a web page.

    Are you passing the parameter through the html page? Do you have the right name?

  3. #3

    Thread Starter
    Hyperactive Member gjon's Avatar
    Join Date
    Nov 2004
    Location
    Inescapable Void
    Posts
    442

    Re: Grabbing Paramaters from a web page.

    doh, spelled parameter wrong. THnx!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width