I think you might need to call show() on the applet in order to make it
visible.

-----Original Message-----
From: Heakyung Park [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 24, 2000 11:34 AM
To: [EMAIL PROTECTED]
Subject: Re: Displaying Java Applet


So you mean the reason I am having the problem is due to my code? No other
possible reason?

The following is the servlet code to display java applet;
import java.io.*;
import javax.servlet.*;
public class gan extends GenericServlet {
        public void service (ServletRequest request, ServletResponse
response) throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter pw = response.getWriter();
pw.println("<html><head><title>Gentt Chart</title></head><body>");
pw.println("<h1>Project Schedule in Gantt Chart</h1>");
pw.println("<applet code=\"gantt\" width=500 height=500></applet>");
pw.println("</body></html>");
pw.close();
}
}

The following is my simplified applet code;
/**************************************************************************/
/*                               Draw Gantt Chart                         */
import java.awt.*;
import java.applet.*;

public class gantt extends Applet
{
    int step_size = 0;
    String month = "";

    public void init() {
        step_size = 18;
        month = "w";
        setBackground(Color.green);
    }

    public void paint(Graphics g) {

        //g.drawRect(35, 35, 325, 325);
        g.drawRect(10, 10, 380, 380);
        for (int i = 0; i < step_size; i++) {
            g.drawString(month+i, 30+i*20, 380);
            g.drawLine(30+i*20, 10, 30+i*20, 380+3);
        }
     }
}

HeaKyung


On Tue, 24 Oct 2000 [EMAIL PROTECTED] wrote:

>
> Hi ,
>
> Regarding your problem, can you send the source of the applet and servlet,
> so that I can look into them and find the reason for the problem.
>
> Jinen.
>

Hello! Could you help me! I am having problem with displaying chart which
is an applet. I embedded applet code base in servlet and I am calling the
applet through a servlet ( does only displaying applet nothing else). But
somehow, I am getting a message that says "applet cannot be loaded". Can
anyone know how to display an applet using servlet? Thanks.

HeaKyung

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to