josephine chen

Ranch Hand
+ Follow
since Oct 29, 2002
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by josephine chen

I am new to servlet and HTML and I am trying to learn them on my own . So my Ques may sound silly!!!
What is header info for a particular page? Can u give me a small

24 years ago

import javax.servlet.*;
import javax.servlet.http.*;
public class Hello extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException {
// Set the Content-Type header
// Return early if this is a HEAD
if (req.getMethod().equals("HEAD")) return;
// Proceed otherwise
PrintWriter out = res.getWriter();
String name = req.getParameter("name");
out.println("<HEAD><TITLE>Hello, " + name + "</TITLE></HEAD>");
out.println("Hello, " + name);
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
doGet(req, res);
what does this st do??
if (req.getMethod().equals("HEAD")) return
24 years ago
I think
Runnable r = A.handOff();
should be
Runnable r = PublicClass.handOff();
Jim am i correct or missing some thing.....
I am getting the applet but the problem is i am not able to close it.
What should I do to close it?
24 years ago

import java.awt.*;
import java.awt.event.*;
class TextBox extends Frame implements KeyListener{
TextField t1;
void createtext(){
System.out.println("create text");
t1 = new TextField();
setLayout(new FlowLayout());
public void keyPressed(KeyEvent e){
if (e.getKeyCode() == 10){
public void keyReleased(KeyEvent e){ }
public void keyTyped(KeyEvent e){ }

class box extends java.applet.Applet{
public void init(){
TextBox t = new TextBox();


I am getting message saying applet started but my textbox doresnot appear why???
24 years ago
How will I validate the date enterd by the user???
ie he must enter only in mm/dd/yyyy format How should i do this
How to display dates ???
How to check for the date formats???
24 years ago
I have two text boxes in my Awt program.
For each text box the code inside keypress is different.
For the first text box it has to check the user entered values
which must be only digits and for the second i have to check
that the user enters only characters.
If this is the situation how can I handle events ??
I am able to do creating anonymous classes.
but in this case i have to craete the interface twice
using new KeyListener().If i have say, some 10 text boxes
I think this is tedious ??? There must be some other way which i am not able to figure out ???
I tried implemnting the inteface but iam not knowing
how to say for which textbox the following code must fire
on it's keypress event???
Is there a way to do this???

24 years ago
I have created a very small piece of Awt program which i need to place on the web so that all have access to it .How should i do this???
I liked Tony 's Site ... I think u can help me.....
24 years ago
These are the outputs ..
I am not sure why called is repeated twice
here?? Expalin please...
with comments
static block of test called called called
If the comment is removed??
static block of test called called
static block of sub called called
What does this weightx and weighty do?? I tried but i could'nt make out any visible diff ???
Similarly I could'nt find out any visible change when
I tried to work with insets

Am I correct???
Insets-- The space between the components
ipadx and ipady--- It is the space between the cell and the component area

How will I know which component has the focus or the cursor ???
How to print an output with single quotes
like this.
Button b = new Button("ok");
b.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){
What exactly is this doing???
How is this equivalent to the normal way of coding we do
by implementing the interface and implemnting the method???

I feel c is also wrong for the same reason mentioned by Anna