Solved

Applet Problems

Posted on 2001-06-27
5
242 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Finalized as proposed

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
This video teaches viewers about errors in exception handling.
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.

771 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

10 Experts available now in Live!

Get 1:1 Help Now