Solved

Applet Problems

Posted on 2001-06-27
5
244 Views
Last Modified: 2010-03-31
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
Comment
Question by:bita
5 Comments
 
LVL 2

Expert Comment

by:jorj
ID: 6230745
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
 

Author Comment

by:bita
ID: 6231233
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
 
LVL 2

Expert Comment

by:jorj
ID: 6231443
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
 
LVL 5

Expert Comment

by:vemul
ID: 7616534
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
 

Accepted Solution

by:
modulo earned 0 total points
ID: 7639835
Finalized as proposed

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Application launch issue with Apache Tomcat 5 19
Systems talking to each other 5 123
Java Loop 6 48
split string containing \r\n in Java 46 38
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now