Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Applet Problems

Posted on 2001-06-27
5
Medium Priority
?
255 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

783 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