display.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<jsp:plugin align="middle" height="500" width="500" type="applet"
code="MouseDrag.java" name="Sample Plugin"
codebase="/jspuseBean1/" />
<br />
<jsp>
<jsp:text> Hi This is Enclosed in JSP Text Tag!!</jsp:text>
<br />
<jsp:useBean id="d" class="web.demo">
<jsp:setProperty name="d" property="nm" value="This Data is from a Bean!!"/>
<jsp:getProperty name="d" property="nm"/>
</jsp:useBean>
</body>
</html>
MouseDrag.java
package web;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class MouseDrag extends Applet implements MouseMotionListener{
public void init(){
addMouseMotionListener(this);
setBackground(Color.red);
}
public void mouseDragged(MouseEvent me){
Graphics g=getGraphics();
g.setColor(Color.white);
g.fillOval(me.getX(),me.getY(),20,20);
}
public void mouseMoved(MouseEvent me){}
}
0 comments:
Post a Comment