• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 262
  • Last Modified:

Applet Problems

Hi,

I have just finished creating my webpage and want to insert a page with an applet.  

I want an applet to appear with the word "Welcome" moving (scrolling)on the top.  Underneath, I'd like the textareas - "Enter the name: " and "Enter the password".  Then under this, there will be radio buttons of "Gender: Male or Female."  Under this, there will be checkboxes of "quiz1, quiz2,quiz3,quiz4".  Then finally a choicelist (with items to be selected) and a list (with items to be selected).

What I'm having great problems with is that I want all the user information from the applet: such as Name, Password, Gender, the item selected in the choicelist and the item selected from the list - that once this information is entered in the applet it should then  be displayed underneath the applet (in the browser).  

Can this be done and please advise me on how I should go about this. I'd be grateful for all the help given.
Thanks,
From A worried Bita
 
0
bita
Asked:
bita
1 Solution
 
jorjCommented:
The first chioces I have in mind for you are:
1. use another applet in which you will display the user info and use applet-to-applet communication to set the content to whatever you want.

2. When the user submit the info this information is sent back to your server and the html page is reloaded. A jsp/php/asp/cgi-bin program on your server will generate the specific html page which will be loaded by the client with all his info inside.

3. You can use javascript-to-applet communication so you can pass whatever parameter you want from the applet to the html page.
0
 
bitaAuthor Commented:
jorj,
Thank you for your prompt reply and your helpful advice.  After careful decision, I think I will make things easier if I just display the user information inside the applet.  But again, thanks for your advice.

Just one more problem I'm facing right now.  How do I incorporate all the components such as: textfields, CheckboxGroup, choice list and a list - all into one applet?  

I have written the first part of the program which is the textfields for "Name and Password.  

Can you please tell me how and where I should go about including the CheckboxGroup (ie. male or female); a choicelist (ie.quiz1 or quiz2); and a list (ie.webrings or cliques) all into one applet.

Thanks, Bita ---(The program is below):

import java.awt.*;
import java.awt.event.*;
import java.applet.*;


public class TextField extends Applet implements ActionListener
{
TextField name,pass;

public void init()
{
Label namep=new Label("Name: ", Label.RIGHT);
Label passp=new Label("Password: ", Label.RIGHT);
name=new TextField(12);
pass=new TextField(8);
pass.setEchoChar('*');

add(namep);
add(name);
add(passp);
add(pass);

name.addActionListener(this);
pass.addActionListener(this);
}

public void actionPerformed(ActionEvent ae)
{
repaint();
}
public void paint(Graphics g)
{
g.drawString("Name: "+ name.getText(), 6,60);
g.drawString("Password: "+ pass.getText(),6,100);
}
}

0
 
jorjCommented:
Choose a suitable  layout for your applet and create the checkbox groups you want (1 for sex, 1 for quis and so on). Then add to those checkbox groups their corresponding checkbox items. Create a list or whatever components you want, populate them then add all this aprent components to your frame and that's all.
0
 
vemulCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
- To be PAQ'ed and points refunded
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

vemul
Cleanup Volunteer
0
 
moduloCommented:
Finalized as proposed

modulo

Community Support Moderator
Experts Exchange
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now