I have the following form that works: http://craigcoleman.com/java/julia/

I'm trying to do the same thing with this form and I can not get the parameters to work with the form. I am using java script to get the parameter values.

Please throw me a bone.

<html><head><title> Test New </title> 
 </head>
<body>
 <center>
<form name="tn" method="post" onSubmit="return false;"  >
COLOR START (0 TO 255)<br />
red start:<input type="text" size="4" name="red" value="8"><br />
green start:<input type="text" size="4" name="green" value="88"><br />
blue start:<input type="text" size="4" name="blue" value="-88"><br />
<br />
COLOR END (0 TO 255)<br />
red end:<input type="text" size="4" name="redAjust" value="9"><br />
green end:<input type="text" size="4" name="greenAjust" value="99"><br />
blue end:<input type="text" size="4" name="blueAjust" value="-99"><br />
<br />
SCALE AND LIMIT<br />
limit:<input type="text" size="4" name="limit" value="10"><br />
lcale:<input type="text" size="4" name="scale" value="15"><br />

<input type="button" value="Test"  
onClick="document.testnew.setRED(this.form.red.value);
document.testnew.setGREEN(this.form.green.value);
document.testnew.setBLUE(this.form.blue.value);
document.testnew.setRADJ(this.form.redAjust.value);
document.testnew.setGADJ(this.form.greenAjust.value);
document.testnew.setBADJ(this.form.redAdjust.value);
document.testnew.setLIMIT(this.form.limit.value);
document.testnew.setSCALE(this.form.scale.value);">
</form>
<br />Newsflash (This input form does not work yet.)


<applet name=testnew  code=TestNew.class width=1000 height=900>
<param name=red value=1>
<param name=green value=2>
<param name=blue value=3>

<param name=redA value=4>
<param name=greenA value=5>
<param name=blueA value=6>

<param name=limit value=7>
<param name=scale value=8>
</applet>

</center>

</body>
</html>

// start lo java code
import java.awt.*;
import java.applet.*;
import java.lang.*;


/* 
<applet name="testnew" code="TestNew" width=900 height=900>
<param name=red value=0>
<param name=green value=255>
<param name=blue value=255>

<param name=redA value=255>
<param name=greenA value=193>
<param name=blueA value=0>

<param name=limit value=10>
<param name=scale value=100>
</applet>
*/


public class TestNew extends Applet {
// applet variables

  int ired, igreen, iblue,iradj,igadj,ibadj,ilimit,iscale;
    // newtons method variables
    int red ,green,blue;

  public void init() {
    setBackground(Color.white);
       setForeground(Color.white);
    String temp; 

    temp = getParameter("red"); 
    try { if(temp != null) ired = Integer.parseInt(temp); 
      else  ired = 0; } catch(NumberFormatException exc) {  ired = -1;  } 

       temp = getParameter("green"); 
    try { if(temp != null) igreen = Integer.parseInt(temp); 
      else  igreen = 0; } catch(NumberFormatException exc) {  igreen = -1;  } 

       temp = getParameter("blue"); 
    try { if(temp != null) iblue = Integer.parseInt(temp);
      else  iblue = 0; } catch(NumberFormatException exc) {  iblue = -1;  }

      temp = getParameter("redA"); 
          try { if(temp != null) iradj = Integer.parseInt(temp); 
      else  iradj = 0; } catch(NumberFormatException exc) {  iradj = -1;  } 

       temp = getParameter("greenA"); 
    try { if(temp != null) igadj = Integer.parseInt(temp); 
      else  igadj = 0; } catch(NumberFormatException exc) {  igadj = -1;  } 

       temp = getParameter("blueA"); 
    try { if(temp != null) ibadj = Integer.parseInt(temp); 
      else  ibadj = 0; } catch(NumberFormatException exc) {  ibadj = -1;  } 

       temp = getParameter("limit"); 
    try { if(temp != null) ilimit = Integer.parseInt(temp); 
      else  ilimit = 0; } catch(NumberFormatException exc) {  ilimit = -1;  } 

      temp = getParameter("scale"); 
    try { if(temp != null) iscale = Integer.parseInt(temp); 
      else  iscale = 0; } catch(NumberFormatException exc) {  iscale = -1;  } 
  }


  public void paint(Graphics g) {

     int h,k,c,red,green,blue;
     double x,y;

        g.setColor(new Color(0,0,255));
        g.drawString(" r 1 : "+ired, 410,100);
        g.drawString(" g 1 : "+igreen, 410,120);
        g.drawString(" b 1 : "+iblue, 410,140);
        g.drawString(" r 2 : "+iradj, 410,160);
        g.drawString(" g 2 : "+ibadj, 410,180);
        g.drawString(" b 2 : "+igadj, 410,200);
        g.drawString(" steps : "+ilimit, 410,220);
        g.drawString(" scale : "+iscale, 410,240);


}// end paint


   public void setRED(String temp) {
        ired = Integer.parseInt(temp); 
    //repaint();
   }              

    public void setGREEN(String temp) {
    igreen = Integer.parseInt(temp); 
    //repaint();
    }

   public void setBLUE(String temp) {
    iblue = Integer.parseInt(temp); 
    //repaint(); 
   }            


 public void setRADJ(String temp) {
    iradj = Integer.parseInt(temp);   
    //repaint(); 
 }              

    public void setGADJ(String temp) {
    igadj = Integer.parseInt(temp); 
    //repaint();
    }

   public void setBADJ(String temp) {
    ibadj = Integer.parseInt(temp); 
    //repaint(); 
   }              

 public void setLIMIT(String temp) {
    ilimit = Integer.parseInt(temp); 
    //repaint(); 
 }   

 public void setSCALE(String temp) {
    iscale = Integer.parseInt(temp); 
    //repaint(); 
 }   
Member Avatar for iamthwee

Do people still use java applets these days? Gasp! I certainly wouldn't want to install java to view a page.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.