1) Write a program to demonstrate key listener.
import java.awt.*;
import java.awt.event.*;
public class keyListenerExample extends Frame implements KeyListener
{
Label l=new Label("enter text");
TextField t1=new TextField();
keyListenerExample()
{
setSize(400,400);
setLayout(null);
setVisible(true);
l.setBounds(20,20,100,20);
t1.setBounds(50,50,100,100);
add(l);
add(t1);
t1.addKeyListener(this);
}
public void keyPressed(KeyEvent e)
{
l.setText("key pressed");
}
public void keyReleased(KeyEvent e)
{
l.setText("key released");
}
public void keyTyped(KeyEvent e)
{
l.setText("key typed");
}
public static void main(String args[])
{
keyListenerExample w=new keyListenerExample();
}
}
2) Write a css program to demonstrate box model.
<!DOCTYPE html>
<head>
<title> css Box Model </title>
<style>
.main
{
font-size: 30px;
font-width: bold;
text-align: center;
}
.gfg
{
margin-left: 50px;
border: 50px; solid purple;
width: 300px;
height: 200px;
text-align: center;
padding: 50px"
}
.gfg1
{
font size: 40px;
font-weight: :bold; Color: black;
margin-top:50 px;
background-color: purple;
}
.gfg 2
{
font size: 20px;
font-weight :bold;
background-color: yellow;
}
</style>
</head>
<body>
<div class="main"> css Box- Model property </div>
<div class = "gfg" >
<div class="gfg1"> CSS DESIGN </div>
<div class="gfg2"> it is used to design
html document </div>
</body>
</html>
3) Develope And Demonstrate A XHTML File That Includes JAVA Script For Fibonacci Series.
<!DOCTYPE HTML>
<?xml version="1.0" encoding"UTF-8"?>
<html>
<head>
<title> Fibonacci Series </title>
<Script>
function fibo()
{
var n= prompt ("enter the limit 'n' to generate");
var n1 = 0, n2= 1, n3;
document. write (n1);
document. write ("<br />");
document. write (n2);
document.write("<br/>");
for (var x=3; x <=n; x++)
{
n3= n1+n2:
n1 = =n2
n2=n3
document.write (n3);
document.write("<br />");
}
}
fibo();
</script>
</head>
</html>
4) Develope And Demonstrate A XHTML File That Includes JAVA Script To Display Numbers In Reverse Order.
<!DOCTYPE HTML>
<?xml version="1.0" encoding: "UTF-8"?>
<html>
<head>
<title> Reversing number < </title>
<script>
function reversel ()
{
var n= prompt ("Enter the number");
var rem, rev=0';
while (n!=0)
{
rem = (n% 10);
rev = (rev *10)+rem;
n= Math.floor (n/10);
}
alert (reu);
}
reverse();
</script>
</head>
</html>
5) Text with Background Colour.
import java.applet. Applet;
import java.awt.*;
public class backcolor extends Applet {
public void init ()
{
set Background (color.green);
}
public void paint (Graphics g)
{
g.drawstring("Welcome" 50,50);
}
}
/* applet code = "backcolor" height = 300 width=300> </applet> */
6) Window Listener Event.
import java.awt. *;
import java.awt event. Window Event; import java.awt.event. WindowListener;
public class WindowExample extends Frame implements WindowListener
{
WindowExamples()
{
set Size (400, 400);
setLayout (null);
setVisible (true);
addWindowListener(this);
}
public void window Activated (Window Event e)
{
System.out.println ("Window is Activated");
}
public void window Closed (Window Event e)
{
System.out.println ("Window is closed");
}
public void window Closing (Window Event e)
{
System out println(" Window to Closing");
}
public void window Deactivated (Window Event e)
{
System.out.println(" Window is Deactivated");
}
public void window Deiconifred (Window Event e)
{
System out. printIn ("Window is Deconified ");
}
public void window Iconified (Window Event e)
{
System out println("Window is Icanified");
}
public void window Opened (Window Event e)
{
System.out.println("Window is Opened");
}
public static void main (string[] args)
Window Example w=new Window Example();
}
}
7) Square Of n Numbers.
<!DOCTYPE HTML>
<?xml version="1.0" encoding="utf-8"?>
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<title> Square.html</title>
<script type type="text/javascript">
function square ( )
{
var n= prompt ("Enter the limit 'n' to generate the table of numbers from 1 to n:"," ");
var msg=" ";
var res= " ";
for (var x = 1; x <= n; x++)
{
res = x*x;
msg = = msg + " "+x + " * " + x+" = " + res + "\n";
}
alert (msg);
}
Square ();
</script>
</head>
</html>
8) vowels left most
<!DOCTYPE HTML>
<?xml version="1.0" encoding="UTF-8"?>
<html>
<head>
<script type="text/ javascript">
function str - vowel()
{
var str = prompt ("Enter the string \n"," "); for (var i = 0; i < str. length; i++)
if (str. char At (i) == 'a' || str. charAt (i) == 'e'||str. charAt =='i'
|| str. charAt(i) == '0'|| str. charAt(i) == 'u'||
str. char At== 'A' || str. char At (i) == 'E' || str. char At (i) == 'I'||
str. charAt (i) == 'o'|| str.charAt(i) == 'u')
{
document.write("the left most vowel is: "+str.charAt(i)
+ "<br />");
exit;
}
}
document. write(" the entered string is: " + str+"<br />");
document.writel" the entered string has no vowels");
}
str-vowel ();
</script>
</head>
</html>
9) Mouse Listener
impot java.awt.*;
import java.awt.event. *;
public class MouseListener Example extends frame Implements MouseListener
{
Label l = new Label ();
MouseListener Example ();
{
setSize(300, 300);
sel Layout (null);
setVisible (true);
l.set Bounds( 20, 20, 100, 20);
add(l);
add MouseListener (this);
}
public void mouse Clicked (MouseEvent e)
{
l.setText("Mouse is clicked");
}
public void mouse Entered (MouseEvent e)
{
l.setText ("Mouse is Entered ");
}
public void mouse Exited (MouseEvent e)
{
l.setText(" Mouse is Exited");
}
public void mouse Pressed (Mouse Event e)
{
l.setText("Mouse Is Pressed");
}
public void mouse Released (Mouse Event e)
{
l.setText("Mouse Is Released");
}
public static void main (String []args)
{
MouseListener Example w= new MouseListener Example();
}
}
10) Use of Different Tags in HTML.
<!DOCTYPE html>
<html>
<head>
<title> First Journal program.</title>
</head>
<body>
<h1> My city</h1>
<q>Belgaum</q>
<p><h2> Belgaum is a city in the Indian state of Karnataka located in its northern part along the western ghats</h2></br>
<h4> It is the administrative headquarters of the eponymous Belgaum division and Belgaum district</h4> The government of Karnataka has proposed making Belgaum the second capital of Karnataka</p>
<strong> Belgaum has been selected in first. phase out of 20 crties </strong>
<small> as one of the hundred Indian cities</small> <mark> to be developed as a smart city under PM Narendra Modi's flagship Smart Cities Mission </mark>
<p> Hello <sup> students </sup>
<p> Hello <sub> students </sub>
</body> </html>
11) Css program to demonstrate types of CSS.
<!DOCTYPE html PUBLIC " - || W3C || DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml-transitional.dtd">
<head>
<style>
{
background color : red;
height : 200 px;
}
h1
{
color: red;
margin- left :80px;
}
</style>
<link rel="stylesheet" type="text/css" href="types.css"
</head>
<body>
<h2 style="color: red; margin-left: 40px;">
Welcome to college </h2>
<div>
<p> This B.Sc 3 year class. </p>
<h2> We are Computer Science students </h2>
</div>
<h1> We can choose subjects from phy cs, maths. </h1>
</body>
Type.CSS
body
{
background-color: light blue;
}
h1
{
Color:navy;
margin-left:20px;
}
12)CSS program to display list and table.
<html>
<head>
<title> Table AND List </title>
<style>
table, th, td
{
border: 1px solid black;
}
th, td
{
padding : 10 px;
}
# alter tx :nth child (even)
{
background-color:#aaa;
}
#alter tr: nth-child (odd)
{
background -color - # 854;
}
#alter th
{
color: red;
background -color: gray;
}
.num{
list- style- type: decimal;
list-style- position: Inside;
}
.alpha {
list-style -type: lower- alpha;
lisr- style- position: outside;
}
.roman
{
list- style- type: lower-roman ;
background : pink;
padding: 20px;
}
.circle{
list-style-type: circle;
font-size: 20px;
margin:50px;
}
.square {
list-style-type: square;
}
.disc
{
list-style
}
</style>
</head>
<body>
<table id="alter">
<tr> <th> First name </th> <th> Last name </th><th>Marks</th> </tr>
<tr><td> Sanjana </td> <td> Joshi</td> <td> 60</td></tr>
<tr> <td> Radhika </td> <td> Pawashee </td> <td> 80</td> </tr>
<tr><td> Swati</td> <td> Sonic</td> <td> 82</td></tr>
<tr><td> Chelace </td> <td> stogh</td> <td> 72</td></tr>
</table>
<h2>
Ordered lists
</h2>
<ol class= num">
<li>one </li>
<li> two </li>
<li> three </li>
</ol>
<ol class= "alpha">
<li>one </li>
<li>two </li>
<li>three</li>
</ol>
<ol class="roman">
<li>one </li>
<li>two </li>
<li>three</li>
</ol>
<h2>
unordered list
</h2>
<ul class="disc">
<li>one </li>
<li>two </li>
<li>three</li>
</ul>
<ul class="circle">
<li>one </li>
<li>two </li>
<li>three</li>
</ul>
</body>
</html>
This comment has been removed by a blog administrator.
ReplyDelete_ProductTypeName,
ReplyDelete_ProductRetail,
_ProductProcurement,
_ProductSales,
_MDProductHierarchyNode,
_ChemicalComplianceRlvtText,
_ChemicalComplianceRelevant,
_ItemCategoryGroupText,
_ItemCategoryGroup,
_BrandText,
_ProdUnivHierarchyNode,
//Start of ESH related associations---------------------------
_ESHProductSalesDelivery,
_ESHSourceOfSupply,
_ESHSupplier,
_ESHTextObjectPlainLongText,
_ESHDocInfoRecordObjectLink,
_ESHPurOrderQuantityUnitText,
_ESHProductPlant,
_ESHCharValueAssignment,
_ESHClassAssignment,
//End of ESH related associations------------------------------
_MaterialRevisionLevel,
_AssortmentListType,
_AssortmentListTypeText,
_BR_ANPCode,
_BR_ANPCodeText,
_HandlingIndicator,
_HandlingIndicatorText,
_WarehouseProductGroup,
_WarehouseProductGroupText,
_WarehouseStorageCondition,
_WarehouseStorageConditionText,
_StandardHandlingUnitType,
_StandardHandlingUnitTypeText,
_SerialNumberProfile,
_SerialNumberProfileText,
ReplyDelete@VDM.lifecycle: {
status: #DEPRECATED,
successor: '_AdjustmentProfile_2'
}
_AdjustmentProfile,
@VDM.lifecycle: {
status: #DEPRECATED,
successor: '_AdjustmentProfileText_2'
}
_AdjustmentProfileText,
_AdjustmentProfile_2,
_AdjustmentProfileText_2,
_QualityInspectionGroup,
_QualityInspectionGroupText,
_HandlingUnitType,
_HandlingUnitTypeText,
_ProductESPP