Skip to content

Commit eb6a2fd

Browse files
authored
Add files via upload
Signed-off-by: kalyani chaudhari <138003080+misskalyani@users.noreply.github.com>
1 parent 4ea0666 commit eb6a2fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2207
-0
lines changed

Applet/Addition.class

1.34 KB
Binary file not shown.

Applet/Addition.html

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<body>
3+
<applet code="Addition.class" width="500" height="400">
4+
</applet>
5+
</body>
6+
</html>

Applet/Addition.java

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import java.applet.*;
2+
import java.awt.*;
3+
import java.awt.event.*;
4+
5+
public class Addition extends Applet implements ActionListener
6+
{
7+
Label l1,l2,l3;
8+
TextField t1,t2,t3;
9+
Button b1;
10+
public void init()
11+
{
12+
l1=new Label("Enter First No");
13+
l2=new Label("Enter Second No");
14+
l3=new Label("Display Result");
15+
t1=new TextField(10);
16+
t2=new TextField(10);
17+
t3=new TextField(10);
18+
b1=new Button("ADD");
19+
add(l1);add(t1);add(l2);add(t2);add(l3);add(t3);add(b1);
20+
b1.addActionListener(this);
21+
}
22+
public void actionPerformed(ActionEvent ae)
23+
{
24+
if(ae.getSource()==b1)
25+
{
26+
int a=Integer.parseInt(t1.getText());
27+
int b=Integer.parseInt(t1.getText());
28+
int c=a+b;
29+
}
30+
}
31+
}

Applet/Gdemo.java

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import java.awt.*;
2+
import java.applet.*;
3+
public class Gdemo extends Applet
4+
{
5+
public void paint(Graphics g)
6+
{
7+
g.drawString("Welcome Kalyani...!",150,10);
8+
9+
10+
g.drawLine(10,20,300,500);
11+
g.drawRect(100,50,100,300);
12+
g.fillRect(250,50,100,300);
13+
g.drawRoundRect(400,50,100,300,50,50);
14+
g.drawOval(100,400,100,100);
15+
g.setColor(Color.cycan);
16+
g.fillArc(300,300,100,100,200,200);
17+
g.setColor(Color.red);
18+
int a={100,550,300,600,50};
19+
int b={100,150,200,300,500};
20+
g.drawPolygon(a,b,5);
21+
}
22+
}

Applet/Graphics.html

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<body bgcolor="red" >
3+
<applet code="Graphics.class" width="500" height="400">
4+
</applet>
5+
</body>
6+
</html>

Applet/Graphics.java

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
import java.applet;
3+
import java.awt.*;
4+
public class Graphics extends Applet
5+
{
6+
public void paint(Graphics g)
7+
{
8+
Font f1=new Font("Arial",Font.BOLD,25);
9+
g.setFont(f1);
10+
g.drawString("Welcome Kalyani",100,100);
11+
g.drawRect(100,100,200,50);//x y width height
12+
g.drawOval(100,200,100,150);//x y w h
13+
g.drawLine(100,200,300,300);//x1 y1 x2 y2
14+
g.setColor(Color.red);
15+
g.fillOval(300,200,100,100);
16+
g.setColor(Color.pink);
17+
g.fillRect(100,300,200,50);
18+
g.drawArc(100,100,200,200,90,360);
19+
}
20+
}

Applet/Jtable.java

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import java.awt.*;
2+
import javax.swing.*;
3+
class table extends JFrame
4+
{
5+
JTable tbl;
6+
table()
7+
{
8+
setVisible(true);
9+
setSize(500,500);
10+
setLayout(new FlowLayout());
11+
String head[]={"ENO","NAME","SALARY"};
12+
String data[][]={{"101","sai","60000"},
13+
{"102","ram","78000"},
14+
{"103","om","67000"}};
15+
tbl=new JTable(data , head);
16+
// add(tbl);
17+
JScrollPane js=new JScrollPane(tbl);
18+
add(js);
19+
}
20+
public static void main(String ar[])
21+
{
22+
new table();
23+
}
24+
}

Applet/car.html

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<body>
3+
<applet code="car" width="500" height="500">
4+
</aplet>
5+
</body>
6+
</html>

Applet/car.java

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import java.awt.event.*;
2+
import java.awt.*;
3+
import java.applet.*;
4+
public class car extends Applet implements ActionListener
5+
{
6+
int i;
7+
Button b1,b2;
8+
public void init()
9+
{
10+
b1= new Button("next");
11+
b2=new Button("stop");
12+
setLayout(new FlowLayout());
13+
add(b1);
14+
add(b2);
15+
16+
}
17+
public void paint(Graphics g)
18+
{
19+
g.drawRect(100+i,100,100,50);
20+
g.fillOval(120+i,150,30,30);
21+
g.fillOval(150+i,150,30,30);
22+
}
23+
public void actionPerformed(ActionEvent ae)
24+
{
25+
if(ae.getSource()==b1)
26+
{
27+
i=i+30;
28+
repaint();
29+
}
30+
if(ae.getSource()==b2)
31+
{
32+
stop();
33+
}
34+
}
35+
36+
}

Applet/color.html

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<body>
3+
<applet code ="color.class" width="500" height="500">
4+
</applet>
5+
</body>
6+
</html>

Applet/color.java

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import java.applet.*;
2+
import java.awt.*;
3+
import java.awt.event.*;
4+
class color extends Applet implements ItemListener
5+
{
6+
Checkbox c1,c2,c3;
7+
CheckboxGroup cg;
8+
public void init()
9+
{
10+
cg=new checkboxGroup();
11+
c1=new Checkbox("Red",cg,true);
12+
c2=new Checkbox("Yellow',cg,false);
13+
c3=new Checkbox("Blue",cg,false);
14+
add(c1);add(c2);add(c3);
15+
c1.addItemListener(this);
16+
c2.addItemListener(this);
17+
c3.addItemListener(this);
18+
}
19+
public void itemStateChanged(ItemEvent ie)
20+
{
21+
if(c1.getState()==true)
22+
{
23+
setBackground(Color.red);
24+
}
25+
if(c2.getState()==true)
26+
{
27+
setBackground(Color.yellow);
28+
}
29+
if(c3.getState()==true)
30+
{
31+
setBackground(Color.blue);
32+
}
33+
}
34+
}

Applet/demo.class

1.23 KB
Binary file not shown.

Applet/demo.html

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<body>
3+
<applet code="demo.class" width="500" height="400">
4+
</applet>
5+
</body>
6+
</html>

Applet/demo.java

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import java.awt.*;
2+
import java.awt.event.*;
3+
import java.applet.*;
4+
public class demo extends Applet
5+
{
6+
public void init()
7+
{
8+
}
9+
public void paint(Graphics g)
10+
{
11+
g.drawString("Welcome Kalyani",100,100);
12+
}
13+
}

Applet/emp.class

1.72 KB
Binary file not shown.

Applet/gc.java

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import java.util.*;
2+
class emp
3+
{
4+
int eno;
5+
String ename;
6+
double sal;
7+
void accept(int eno1,String ename1,double sal1)
8+
{
9+
eno=eno1;
10+
ename=ename1;
11+
sal=sal1;
12+
}
13+
void disp()
14+
{
15+
System.out.println("Emp no = "+eno);
16+
System.out.println("Emp name = "+ename);
17+
System.out.println("Emp Salary = "+sal);
18+
}
19+
protected void finalize()
20+
{
21+
System.gc();
22+
System.out.println("Memory Freee.....");
23+
}
24+
public static void main(String arg[])
25+
{
26+
emp ob=new emp();
27+
Scanner sc=new Scanner(System.in);
28+
System.out.println("Enter eno = ");
29+
int eno=sc.nextInt();
30+
System.out.println("Enter ename = ");
31+
String ename=sc.next();
32+
System.out.println("Enter salary = ");
33+
double sal=sc.nextDouble();
34+
ob.accept(eno,ename,sal);
35+
ob.disp();
36+
}
37+
}

Applet/image.html

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<body>
3+
<applet code="image" width="500" height="500">
4+
</applet>
5+
</body>
6+
</html>

Applet/image.java

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import java.awt.*;
2+
import java.awt.event.*;
3+
import java.Applet.*;
4+
import javax.swing.*;
5+
class image extends Applet implements ItemListener
6+
{
7+
Choice c1;
8+
Image img;
9+
public void init()
10+
{
11+
c1=new Choice();
12+
c1.add(img1);
13+
c1.add(img2);
14+
c1.add(img3);
15+
c1.addItemListener(this);
16+
}
17+
public void itemStateChanged(ItemEvent ie)
18+
{
19+
if(ie.getSelectedItem()==c1)
20+
String s1=c1.getSelectedItem();
21+
img=getImage(getDocumentBase(),s1+".jpg");
22+
//img=getImage(getCodeBase(),s1+".jpg");
23+
repaint();
24+
}
25+
public void paint(Graphic g)
26+
{
27+
g.drawImage(img,100,100,this);
28+
}
29+
}

Applet/item.html

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<body>
3+
<applet code="item.class" width="500" height="500">
4+
</applet>
5+
</body>
6+
</html>

Applet/item.java

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import java.awt.*;
2+
import java.awt.event.*;
3+
import java.applet.*;
4+
public class item extends Applet implements ItemListener,MouseListener
5+
{
6+
int f1=1;
7+
int x1,x2,y1,y2;
8+
CheckboxGroup cg;
9+
Checkbox c1,c2,c3;
10+
public void init()
11+
{
12+
cg=new CheckboxGroup();
13+
c1=new Checkbox("Line",cg,true);
14+
c2=new Checkbox("Rectangle",cg,false);
15+
c3=new Checkbox("Oval",cg,false);
16+
add(c1);
17+
add(c2);
18+
add(c3);
19+
c1.addItemListener(this);
20+
c2.addItemListener(this);
21+
c3.addItemListener(this);
22+
addMouseListener(this);
23+
}
24+
public void update(Graphic g)
25+
{
26+
if(f1==1)
27+
g.drawLine(x1,y1,x2,y2);
28+
if(f1==2)
29+
g.drawRect(x1,y1,x2-x1,y2-y1);
30+
if(f==3)
31+
g.drawOval(x1,y1,x2,x1,y2-y1);
32+
}
33+
public void mouseClicked(MouseEvent me)
34+
{}
35+
public void mouseEntered(MouseEvent me)
36+
{}
37+
38+
public void mousePressed(MouseEvent me)
39+
{
40+
x1=me.getX();
41+
y1=me.getY();
42+
}
43+
public void mouseReleased(MouseEvent me)
44+
{
45+
x2=me.getX();
46+
y2=me.getY();
47+
repaint();
48+
}
49+
public void mouseExited(MouseEvent me)
50+
{}
51+
public void itemStateChanged(ItemEvent ie)
52+
{
53+
if(c1.getState()==true)
54+
f1=1;
55+
if(c2.getState()==true)
56+
f1=2;
57+
if(c3.getState()==true)
58+
f1=3;
59+
}
60+
}

Applet/mousemotion.html

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<body>
3+
<applet code="mousemotion" width="500" height="500">
4+
</applet>
5+
</body>
6+
</html>

Applet/mousemotion.java

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import java.awt.*;
2+
import java.awt.event.*;
3+
import java.applet.*;
4+
public class mousemotion extends Applet implements MouseMotionListener
5+
{
6+
int x,y;
7+
public void init()
8+
{
9+
addMouseMotionListener(this);
10+
}
11+
public void update(Graphics g)
12+
{
13+
g.fillOval(x,y,3,5);
14+
//g.drawOval(x,y,5,5);
15+
}
16+
public void mouseMoved(MouseEvent me)
17+
{
18+
19+
}
20+
public void mouseDragged(MouseEvent me)
21+
{
22+
x=me.getX();
23+
y=me.getY();
24+
repaint();
25+
}
26+
}

0 commit comments

Comments
 (0)