[3936] in java-interest
Help me with java Beta
daemon@ATHENA.MIT.EDU (Jonathan_Mark_Smith@CCMAIL.PRUSEC.)
Mon Dec 4 19:59:09 1995
From: Jonathan_Mark_Smith@CCMAIL.PRUSEC.COM
Date: Mon, 04 Dec 95 10:50:27 EST
To: java-interest@java.Eng.Sun.COM, smithj@walrus.com, dmessano@pwj.com
Can someone please tell me how to update the following source code.
So I can save what the user entered into a file on me site.
Do I have to read a CGI program?
Can you please send me a sample if you have.
import java.awt.*;
import java.applet.*;
public class Test extends Applet
{
Panel infobar;
Panel mainbar;
TextField name;
TextField email;
TextField usrl;
public void init()
{
setLayout(new BorderLayout());
setBackground(Color.gray);
setFont(new Font("Helvetica", Font.BOLD, 12));
}
public void start()
{
Panel p = new Panel();
p.setLayout(new GridLayout(3,1));
p.add(name = new TextField("Name", 30));
p.add(email = new TextField("E-mail address",30));
p.add(usrl = new TextField("URL",30));
mainbar = new Panel();
mainbar.setLayout(new BorderLayout());
mainbar.add("West", p);
Choice c = new Choice();
c.addItem("This applet sucks");
c.addItem("This applet is cool");
c.addItem("I want more");
c.addItem("This introduction sucks");
c.addItem("This introduction is cool");
add("East", c);
add("Center", mainbar);
infobar = new Panel();
infobar.add(new Button("Submit"));
infobar.add(new Button("Clear"));
infobar.add(new Button("Reset"));
add("South", infobar);
}
public boolean action(Event evt, Object arg)
{
if("Submit".equals(arg))
{
showStatus("If this worked... the data would be
submitting");
return true;
}
else if("Clear".equals(arg))
{
name.setText("");
email.setText("");
usrl.setText("");
return true;
}
else if("Reset".equals(arg))
{
name.setText("Your name here please");
email.setText("Your e-mail address here please");
usrl.setText("Your URL have please");
return true;
}
else if(evt.target instanceof Choice)
{
showStatus(arg.toString());
return true;
}
return false;
}
}
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com