Experiment No 01.: Aim: Develop A Javascript To Use Decision Making and Looping
Experiment No 01.: Aim: Develop A Javascript To Use Decision Making and Looping
Experiment No 01.: Aim: Develop A Javascript To Use Decision Making and Looping
Code
package Experiment1;
import java.applet.Applet;
import java.awt.*;
@Override
public void init() {
add(l1);
add(r1);
add(r2);
add(c1);
add(c2);
}
@Override
public void paint(Graphics g) {
c1.setBounds(150,40,200,20);
c2.setBounds(150,60,200,20);
}
}
Output:
CODE:
package Experiment1;
import java.applet.Applet;
import java.awt.*;
@Override
public void init() {
add(l1);
add(l2);
add(t1);
add(t2);
add(b1);
}
@Override
public void paint(Graphics g) {
l1.setBounds(10,10,100,20);
t1.setBounds(110,10,200,20);
l2.setBounds(10,50,100,20);
t2.setBounds(110,50,200,200);
b1.setBounds(110,260,80,20);
}
}
OUTPUT:
• Exercise:
o Develop a program using Label to display message
“welcome to Java”.
CODE:
package Experiment1;
import java.applet.Applet;
import java.awt.*;
CODE:
package Experiment1;
import java.applet.Applet;
import java.awt.*;
@Override
public void init() {
add(c1);
add(c2);
add(c3);
add(c4);
add(l1);
}
}
OUTPUT:
o Write a program to create three Buttons with Caption OK,
RESET and CANCEL.
CODE:
package Experiment1;
import java.applet.Applet;
import java.awt.*;
@Override
public void init() {
add(b1);
add(b2);
add(b3);
add(l1);
}
}
OUTPUT: