HTML XML Applets
HTML XML Applets
HTML XML Applets
1. Start
i.
ii.
iii.
iv.
i.
ii.
iii.
CODE:
<html>
<head>
<title>Project List</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
</head>
<body>
<h1>Computer Science Major Project Topics</h1>
<p>
<font face='garamond'>
Web based Applications for Insurance Services <br>
Cold Boot Attack<br>
Virtual Class Rooms<br>
Electronic Mail Server<br>
SUDOKU<br>
Bluetooth Hotspot<br/>
Result Alert System With E-mail and SMS<br>
Bug Tracking System<br>
Partial Face Recognition Using Core features Of The Face<br>
Face Recognition in e-attendance<br>
Online Examination System<br>
Chat Server<br>
Bluetooth Home Automation<br>
Creepy Crawler System<br>
</font>
</p>
<a href='#top'>Back to Top</a>
For more details visit
<a href=''>http://www.projecttopics.info/</a>
<a href="file:///C:\Users\ph\Pictures\0117001.jpg">Also see this!
</a>
</body>
</html>
OUTPUT:
Add a heading
Add a title
Start the <body> section
Create an unordered list; create an ordered list; use various bullet styles,
create nested lists; use the font tag in conjunction with lists; create
definition lists; use graphics as bullets.
CODE:
<html>
<head>
<title>Project List</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
</head>
<body>
<h1>LISTS IN HTML</h1>
<ul>
<li><font size=10>T</font>his is the first item in unnumbered
list.</li>
<li>This is the next</li>
<li>The third item is itself a list:
<ul>
<li style="list-style-image:
url('images/sqpurple.gif');">First item in the nested list.</li>
<li style="list-style-image:
url('images/sqpurple.gif');">Second; be sure to end both lists!</li>
</ul>
</li>
</ul>
<ol type='a'>
<li><p>The first item in numbered list</p></li>
<li><p>They are also called ordered list</p></li>
</ol>
<dl>
<dt>HTML
<dd>HyperText Markup Language is a language that defines web
pages.</dd>
<dt>SGML
<dd>
Standarised General Markup Language is a class of markup
languages like HTML
</dd>
</dl>
</body>
</html>
OUTPUT:
a. CODE:
<!DOCTYPE html>
<html>
<head>
<title>HTML Table Cellpadding</title>
</head>
<body>
<table border="10" bordercolor="green" bgcolor="yellow"
cellpadding="5" cellspacing="5">
<tr>
<th>Name</th>
<th>Salary</th>
</tr>
<tr>
<td>Priyanka Haldar</td>
<td>40000</td>
</tr>
<tr>
<td>Ankita Das</td>
<td>50000</td>
</tr>
</table>
</body>
</html>
OUTPUT:
Name
Salary
Priyanka Haldar
40000
Ankita Das
50000
b. CODE:
a <!DOCTYPE html>
<html>
<head>
<title>HTML Table Cellpadding</title>
</head>
<body>
<table border="3" bordercolor="100D96" bgcolor="B2D2DA"
cellpadding="5" cellspacing="5">
<tr>
<th>Name</th>
<th>10th %</th>
<th>12th %</th>
<th>Graduation %</th>
</tr>
<tr>
<td>Priyanka Haldar</td>
<td align="right">87.6</td>
<td align="right">70</td>
<td align="right">77</td>
</tr>
</table>
</body>
</html>
OUTPUT:
Name
Priyanka Haldar
10th %
12th %
87.6
Graduation %
70
77
CODE:
Frametest.html
<html>
<head>
<title>Frame Samples</title>
</head>
<frameset cols="12%,*,12%">
<frame name="leftframe" src="left.html">
<frameset rows="14%,*,12%">
<frame name="topframe" src="top.html">
<frame name="mainframe" src="center.html">
<frame name="bottomframe" src="bottom.html">
</frameset>
<frame name="rightframe" src="right.html">
</frameset>
</html>
left.html
<html>
<head>
<title>Frames - Left</title>
</head>
<body bgcolor="lightgreen">
<p align=center>Left Frame</p>
</body>
</html>
top.html
<html>
<head><title>Frames - Top</title>
</head>
<body bgcolor="yellow">
<p align=center>Top Frame</p>
</body>
</html>
center.html
<html>
<head><title>Frame Samples Center</title>
</head>
<body bgcolor="lightblue">
<p align=center>Center Frame</p>
</body>
</html>
bottom.html
<html>
<head><title>Frames - Bottom</title>
</head>
<body bgcolor="lightyellow">
<p align=center>Bottom Frame</p>
</body>
</html>
OUTPUT:
CODE:
<html>
<head>
<title> ADMISSION FORM </title>
</head>
<body bgcolor="pink" style="text-align: center;">
<form name="input" action="frameset.html" method="get">
<div>
<h1> ADMISSION FORM </h1>
First Name: <input type="text" name="fname"/> <br/>
Last Name: <input type="text" name="lname"/> <br/>
Username: <input type="text" name="uname"/> <br/>
Password: <input type="password" name="pwd" size="10"
maxlength="10"/> <br/>
Address: <br/><textarea rows="3" cols="20">Enter your address
here...</textarea> <br/>
Date of Birth: <input type="text" name="dob"/> <br/>
Phone no.: <input type="text" name="phone"/> <br/>
Gender: <input type="radio" name="sex" value="Male"/>Male
<input type="radio" name="sex" value="Female"/>Female
<br/>
Qualification:
<input type="checkbox" name="sub" value="10th"/>10th
<input type="checkbox" name="sub" value="12th"/>12th
<input type="checkbox" name="sub" value="BTech"/>BTech
<input type="hidden" name="Language" value="English"><br/>
<input type="submit" value="SUBMIT" />
</div>
</form>
</body>
</html>
OUTPUT:
XML
1.
Write a XML program that will create an XML document which contains
your mailing address.
CODE:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="email.css" type="text/css"?>
<!DOCTYPE EMAIL[
<!ELEMENT email (label, address)>
<!ELEMENT label (#PCDATA)>
<!ELEMENT address (#PCDATA)>
]>
<email>
<label> My mailing address:</label>
<address>[email protected]</address>
</email>
email.css
label
{
margin-top: 100px;
font-size: 36px;
font-weight: bold;
vertical-align:baseline;
color: #00beeb;
text-align: center;
display: block;
}
address
{
font-size: 28px;
font-family: Georgia;
vertical-align:baseline;
text-align: center;
display: block;
}
OUTPUT:
2.
CODE:
BookDetails.css
book
{
float: left;
width: 260px;
height: 135px;
padding: 20px;
padding-top: 20px;
padding-right: 20px;
padding-bottom: 20px;
padding-left: 20px;
margin-right: 20px;
background: url(images/templamteo_service_bg.png) right center norepeat;
color: #fff;
font-size: 16px;
text-decoration: none;
}
name
{
text-align: center;
color: #fff;
font-size: 36px;
font-weight: 700;
text-decoration: none;
}
title,author,year,price
{
display: block;
}
title
{
font-family:Book Antiqua;
font-size:20px;
font-weight: bold;
}
author
{
font-style: italic;
}
year
{
font-family: Verdana;
}
price
{
font-family:Garamaond;
}
OUTPUT:
3. Create an XML document that contains the name and price per pound of coffee beans.
i) In your XML document mention all properties of XML declaration.
ii) The root element has name <coffee_bean>
iii) Create nested elements for different types of coffee.
iv) Validate the document and if any parsing error is present, fix them.
CODE:
<?xml version="1.0"?>
<coffee_bean>
<coffee type="plant">
<name>Arbica</name>
<production>75-80%</production>
<caffeine>0.8-1.4%</caffeine>
<price>3</price>
</coffee>
<coffee type="plant">
<name> Robusta </name>
<production>20-25%</production>
<caffeine>1.7-4%</caffeine>
<price>5</price>
</coffee>
</coffee_bean>
iv) Within each <carrier> nest at least two <flight> ,each of which contains departure_city, destination_
city, fl_no, dept_time.
v) Validate the document and if any parsing error is present fix them.
CODE:
<?xml version="1.0"?>
<Airlines>
<carrier name="Airindia">
<flights>
<flight1>
<departure_city>Delhi</departure_city>
<destination_city>London</destination_city>
<fl_no>AI5788</fl_no>
<departure_time>21:55pm</departure_time>
</flight1>
<flight2>
<departure_city>Chennai</departure_city>
<destination_city>singapore</destination_city>
<fl_no>AI5725</fl_no>
<departure_time>23:15pm</departure_time>
</flight2>
</flights>
</carrier>
<carrier name="Fly Emirates">
<flights>
<flight1>
<departure_city>Dubai</departure_city>
<destination_city>Los Angeles</destination_city>
<fl_no>FE8898</fl_no>
<departure_time>01:05am</departure_time>
</flight1>
<flight2>
<departure_city>Abu dhabi</departure_city>
<destination_city>Lisbon</destination_city>
<fl_no>FE5778</fl_no>
<departure_time>20:45pm</departure_time>
</flight2>
</flights>
</carrier>
<carrier name="Delta Airways">
<flights>
<flight1>
<departure_city>Newyork</departure_city>
<destination_city>London</destination_city>
<fl_no>DA4689</fl_no>
<departure_time>02:30am</departure_time>
</flight1>
<flight2>
<departure_city>washington</departure_city>
<destination_city>Paris</destination_city>
<fl_no>DA7853</fl_no>
<departure_time>17:50pm</departure_time>
</flight2>
</flights>
</carrier>
</Airlines>
5. Create an XML version of your resume. Include elements such as your name and position desired. Nest
each of your former employers within an <employer> element. Also, nest your educational experience
within an <education> element.
Create any other nested elements that you deem appropriate, such as <references> or <spcl_skills>
elements.
CODE:
CODE:<?xml version="1.0"?>
<Resume>
<freshers>
<name><b>Priyanka Haldar</b></name>
<address>51, Station Road, Kolkata-700074</address>
<email>[email protected]</email>
<education>
<percentage_in_12th_std>70%</percentage_in_12th_std>
<percentage_in_10th_std>87.6%%</percentage_in_10th_std>
<percentage_in_BTech>77%</percentage_in_BTech>
</education>
<special_skills>
<professional_skills>
1Comprehensive problem solving abilities.
2.Self motivated, focused and dedicated .
3.Ability to deal with peoplediplomatically.
4.Willingness to learn
</professional_skills>
<Technical_skills>C,JAVA(core),PHP</Technical_skills>
</special_skills>
<Position_Desired>Software Developer</Position_Desired>
</freshers>
<employers>
<name><b>Akash Ghosh</b></name>
<address>Vill+P.O-Begri,P.S-Domjur,Dist-Howrah,state-West
Bengal</address>
<email>[email protected]</email>
<education>
<percentage_in_12th_std>82%</percentage_in_12th_std>
<percentage_in_10th_std>79%</percentage_in_10th_std>
<percentage_in_BTech>82%</percentage_in_BTech>
</education>
<special_skills>
<professional_skills>
1Comprehensive problem solving abilities.
2.Self motivated, focused and dedicated .
3.Ability to deal with peoplediplomatically.
4.Willingness to learn
</professional_skills>
<Technical_skills>C,JAVA(core),C#</Technical_skills>
</special_skills>
<previous_company_name>XYZ Technology</previous_company_name>
<projects>
<No_Of_projects_done>2</No_Of_projects_done>
<genre>software developer</genre>
</projects>
<Position_Desired>software Developer</Position_Desired>
</employers>
</Resume>
APPLETS
java.applet.*;
java.awt.*;
java.net.*;
java.awt.event.*;
java.awt.*;
java.io.File;
java.io.IOException;
javax.swing.*;
javax.imageio.ImageIO;
java.io.IOException;
{
String imgSrc"jlaw\\0.gif";
try
{
img = ImageIO.read(new File(imgSrc));
}
catch(IOException ex)
{
ex.printStackTrace();
}
}
public void paint(Graphics g)
{
g.drawImage(img,3,50,null);
}
}
import java.applet.*;
import java.awt.event.*;
import java.awt.*;
public class EventListeners extends Applet
implements ActionListener{
TextArea txtArea;
String Add, Subtract;
int i = 10, j = 20, sum =0,Sub=0;
public void init(){
txtArea = new TextArea(10,20);
txtArea.setEditable(false);
add(txtArea,"center");
Button b = new Button("Add");
Button c = new Button("Subtract");
b.addActionListener(this);
c.addActionListener(this);
add(b);
add(c);
}
public void actionPerformed(ActionEvent e){
sum = i + j;
txtArea.setText("");
txtArea.append("i = "+ i + "\t" + "j = " + j + "\n");
Button source = (Button)e.getSource();
if(source.getLabel() == "Add"){
txtArea.append("Sum : " + sum + "\n");
}
if(i >j){
Sub = i - j;
}
else{
Sub = j - i;
}
if(source.getLabel() == "Subtract"){
txtArea.append("Sub : " + Sub + "\n");
}
}
}