[4009] in java-interest

home help back first fref pref prev next nref lref last post

Can someone please help me on 3 java things.

daemon@ATHENA.MIT.EDU (Jonathan_Mark_Smith@CCMAIL.PRUSEC.)
Thu Dec 7 11:22:16 1995

From: Jonathan_Mark_Smith@CCMAIL.PRUSEC.COM
Date: Thu, 07 Dec 95 08:40:59 EST
To: java-announce@java.sun.com, java-interest@java.sun.com, smithj@walrus.com

     I AM SORRY FOR SEND THIS AGIN BUT THE FIRST TIME I FORGOT THE SOURCE CODE 
     AT THE END OF THE EMAIL
     
     
     
     
     Here is the list good luck.
     
     
     1) I need to save information from my java applet to a flat file on my 
        site.
     
        I need to find out how to read the file and write to the file on my 
        web site from a applet.
     
     2) Can someone show me a sample on how to use java as a cgi program.
        How can a form pass it data?
        How can a java applet pass it data?
        How can the java cgi program read the data in?
     
     
     3) In following source code I have a listbox I let the user pick a 
        item from.  Can someone please show me how to turn my listbox into 
        option buttons.  Also How did I tell which button is selected?
     
     
     I am new to java as you can see.  But I did read about 3 books on java 
     none of the books got me to the point of writing a applet to let the 
     user read and writer information from my site and about AWT.
     
     Can this be done????
     
     
     I need to get something up by the end of the week so any help will be 
     alot of help.  So please send me any sample you how??
     
     
     Once again thanks to all you great java programmers on the net.
     
     
     Johnathan Mark Smith

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(2,2));
                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);

                
                List l = new List();
                l.setMultipleSelections(false);
                l.addItem("Java is Cool");
                l.addItem("This applet is cool");
                l.addItem("I want more");
                l.addItem("John is greats");
                
                add("West", l);


                add("Center", mainbar);
 
                infobar = new Panel();
                infobar.add(new Button("Send data to Site"));
                infobar.add(new Button("Clear all Fields"));
                infobar.add(new Button("Reset all Fields"));
                infobar.setBackground(Color.red);
                add("South", infobar);
        }

        public boolean action(Event evt, Object arg)
        {
                if("Send data to Site".equals(arg))
                {
                        
                        showStatus("If this worked... the data would be 
submitting");
                        return true;
                }
                else if("Clear all Fields".equals(arg))
                {
                        name.setText("");
                        email.setText("");
                        usrl.setText("");
                        return true;
                }
                else if("Reset all Fields".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 List)
                {
                        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

home help back first fref pref prev next nref lref last post