我想通过单击按钮将小程序的任何参数发送到浏览器。 (Html)
I would like to send with a click of the button an applet any parameters to the browser. (Html)
我想通过单击按钮将小程序的任何参数发送到浏览器。 (Html)。我知道按钮对象有一些方法但不知道使用哪个。
我怎样才能做到这一点?
ps .: 我正在使用 jnlp 协议。
类似于:
key_button = new Button("Click");
key_button.setBounds(150,50,100,20);
add(key_button);
我有小程序代码
以下代码:
package applet;
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
//import java.io.BufferedWriter;
//import java.io.FileWriter;
public class UserInput extends Applet implements ActionListener{
TextField key_text1;
static TextField key_text2;
TextField key_output;
Label key_label1,key_label2,key_label3;
Button key_button;
public void init(){
setLayout(null);
// Add different components to the layout.
key_label1 = new Label("Enterpassword1: ");
key_label1.setBounds(20,20,100,20);
add(key_label1);
key_text1 = new TextField(5);
key_text1.setBounds(150,20,100,20);
add(key_text1);
key_button = new Button("Click");
key_button.setBounds(150,50,100,20);
/*******************Here I need to create a method that clicking key_button sends the data entered in the TextField field to the website (html) and html would appear the argument entered the applet TextFiel.**************************/
// key_button.event();
add(key_button);
}
..send with a click of the button an applet any parameters to the browser.
String value = textField.getText();
String path = "the.html";
URL url = new URL(getDocumentBase(), path + "?param=" + value);
getAppletContext().showDocument(url);
我想通过单击按钮将小程序的任何参数发送到浏览器。 (Html)。我知道按钮对象有一些方法但不知道使用哪个。 我怎样才能做到这一点? ps .: 我正在使用 jnlp 协议。
类似于:
key_button = new Button("Click");
key_button.setBounds(150,50,100,20);
add(key_button);
我有小程序代码 以下代码:
package applet;
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
//import java.io.BufferedWriter;
//import java.io.FileWriter;
public class UserInput extends Applet implements ActionListener{
TextField key_text1;
static TextField key_text2;
TextField key_output;
Label key_label1,key_label2,key_label3;
Button key_button;
public void init(){
setLayout(null);
// Add different components to the layout.
key_label1 = new Label("Enterpassword1: ");
key_label1.setBounds(20,20,100,20);
add(key_label1);
key_text1 = new TextField(5);
key_text1.setBounds(150,20,100,20);
add(key_text1);
key_button = new Button("Click");
key_button.setBounds(150,50,100,20);
/*******************Here I need to create a method that clicking key_button sends the data entered in the TextField field to the website (html) and html would appear the argument entered the applet TextFiel.**************************/
// key_button.event();
add(key_button);
}
..send with a click of the button an applet any parameters to the browser.
String value = textField.getText();
String path = "the.html";
URL url = new URL(getDocumentBase(), path + "?param=" + value);
getAppletContext().showDocument(url);