Results 1 to 2 of 2
  1. #1
    christina is offline Member
    Join Date
    Jul 2007
    Posts
    39
    Rep Power
    0

    Default problems when I try to send parameters

    HTML Parameters returned as null

    Can anyone tell me what I've done wrong?
    Java Code:
    <HTML>
    <HEAD>
    <TITLE>pairs</TITLE>
    </HEAD><BODY>
    <APPLET CODE="GridExample" WIDTH=1000 HEIGHT=540>
    <PARAM NAME="w" VALUE="ok">
    </APPLET>
    </BODY>
    </HTML>
    this is the code:
    Java Code:
    
    import java.awt.*;
    import java.applet.*;
    public class GridExample extends Applet
    {
    public Graphics g;
    Image pic1, pic2, pic3;
    String CardText;
    
    public void init()
    {
    pic1=getImage(getCodeBase(),"fishes.jpg");
    pic2=getImage(getCodeBase(),"haben.jpg");
    pic3=getImage(getCodeBase(),"avoir.jpg");
    CardText=getParameter("word1");
    
    }
    
    public GridExample()
    {
    this.setLayout(new GridLayout(5,9, 0, 0));
    for (int counter=0; counter<45; counter++)
    {
    this.add(new Button (CardText + counter));
    }
    
    }
    
    public Insets getInsets()
    {
    return new Insets(0, 0, 25, 0);
    
    }
    
    public void paint (Graphics gr)
    {
    g=gr;
    
    
    g.drawImage(pic1,0,0,this);
    
    
    
    }
    }

  2. #2
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    8

    Default

    Java Code:
    CardText=getParameter("word1");
    Will be looking for a param tag like this in the applet tag
    Java Code:
    <PARAM NAME="word1" VALUE="card text in here">

Similar Threads

  1. Hiding parameters from URL
    By Saurabh321 in forum New To Java
    Replies: 0
    Last Post: 02-05-2008, 12:43 PM
  2. Replies: 0
    Last Post: 01-27-2008, 08:17 PM
  3. send parameters from jsp to action
    By Jack in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 01-07-2008, 11:52 AM
  4. get parameters in jsp
    By cecily in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 08-05-2007, 04:29 AM
  5. parameters=null
    By mary in forum Java Servlet
    Replies: 1
    Last Post: 07-13-2007, 04:29 PM

Posting Permissions

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