launching applet

please ignore the previous posting. I have an HTML form that has a textarea. I would like to send the contents in a text area to a signed applet.

In the first HTML form gets the contents of the text area and calls another html form, The second HTML page(cryptojni.html) calls the signed applet. But wheni try to display the text in the signed applet i get a error " java.awt.TextField[textfield0,0,0,0x0,invalid,text=,editable,selection=0-0]" The HTML page is able to pop up the signed applet but there is nothing in the "text" string!!

<html>

<SCRIPT>function toApplet() {

var f = document.forms[0];

var a = document.applets[0];

a.setFieldText(f.inputarea.value);

return false;

}

</SCRIPT>

<body>

<form name="input" action="cryptoJNI.html" method="post">

<TEXTAREA NAME="inputarea" ROWS="30", COLS="60"></TEXTAREA>


<INPUT TYPE=SUBMIT NAME='click' ONCLICK="return toApplet();"></FORM>

</form>

</body>

</html>

CRYPTOJNI.html

<html>

<title> CRYPTO JNI</title>

<h1> Calling the keystore </h1>

<hr>

<APPLET CODE = Testapp.class archive="scryptoJNI.jar" WIDTH=500 HEIGHT=500>

</APPLET>

<hr>

</html>

Testapp.java

public class Testapp extends Applet {

private TextField field;

public void init(){

field=new TextField(100);

add(field);

System.out.println(field);

public void setFieldText(String text) {

field.setText(text);

}

}

[1687 byte] By [viveksrinivasansa] at [2007-9-29 23:15:58]
# 1

hai

ur textfield must be added to contentpane try like this getCotentPane().add(field)

rajesh

Testapp.java

public class Testapp extends Applet {

private TextField field;

public void init(){

field=new TextField(100);

add(field);

System.out.println(field);

public void setFieldText(String text) {

field.setText(text);

}

}

rajeshnarasimhaa at 2007-7-16 3:40:43 > top of Java-index,Security,Signed Applets...
# 2

Hi,

If I am not mistaken you need to do getContentPane().add(...) only when you are using Swing applet.

Well, here what I see as the potential problem is, the fact that when you are submitting the first HTML and calling the next one, nowhere you are collecting the value of Textarea and setting it into the applet of next HTML page. And even you cant do that with plain HTML.

If you want your application to share data among requests you need to use some technology like CGI, JSP, ASP, PHP etc.......

Bakul.

Simple@javaa at 2007-7-16 3:40:43 > top of Java-index,Security,Signed Applets...