Sunday, June 19, 2016

Java Applets



/*


*/




import java.io.*;
import java.awt.*;
import java.applet.Applet.*;
import java.applet.*;
public class app1 extends Applet{
public void paint(Graphics gr){
setBackground(Color.blue);
gr.drawString("Al-Quds Open University",4,30);
gr.drawString("JAVA Programming",55,50);

}
}


/*


*/
import java.io.*;
import java.awt.*;
import java.applet.Applet.*;
import java.applet.*;
public class app10 extends Applet{
Button A = new Button("color");
public void init(){
add(A);
}
public boolean action(Event op,Object gp){
if (op.target instanceof Button)
if(gp.equals("color")){
setBackground(Color.red);
A.setLabel("RED");

return true;}
return false;}
}import java.io.*;
import java.awt.*;
import java.applet.Applet.*;
import java.applet.*;
public class app2 extends Applet{
public void paint(Graphics gr){
setBackground(Color.yellow);
gr.drawOval(80,100,190,100);

}
}
import java.io.*;
import java.awt.*;
import java.applet.Applet.*;
import java.applet.*;
public class app3 extends Applet{
TextField Text1 = new TextField();
public void init(){
add(Text1);

}
}
import java.io.*;
import java.awt.*;
import java.applet.Applet.*;
import java.applet.*;
public class app4 extends Applet{
TextField Text1 = new TextField(30);
public void init(){
add(Text1);

}
}
import java.io.*;
import java.awt.*;
import java.applet.Applet.*;
import java.applet.*;
public class app5 extends Applet{
TextField Text1 = new TextField("JAVA Applet",30);
public void init(){
add(Text1);
}
public void paint (Graphics gr){
setBackground(Color.green);
}
}

/*


*/


import java.io.*;
import java.awt.*;
import java.applet.Applet.*;
import java.applet.*;
public class app6 extends Applet{
TextField Text1 = new TextField("JAVA Applet",30);
public void init(){
add(Text1);
Text1.setEditable(false);
}
public void paint (Graphics gr){
setBackground(Color.green);
}
}

/*


*/


import java.io.*;
import java.awt.*;
import java.applet.Applet.*;
import java.applet.*;
import java.awt.event.*;
public class app7 extends Applet{
TextField Text1 = new TextField(35);
TextField Text2 = new TextField(35);
Button a=new Button("start");
public void init(){
add(Text1);
add(Text2);
add(a);
}

public boolean action(Event op,Object gp){
if (op.target instanceof Button)
if(gp.equals("start")){
setBackground(Color.red);
Text1.setEchoCharacter('*');
Text2.setEditable(false);
return true;}
return false;}

}

/*


*/

import java.io.*;
import java.awt.*;
import java.applet.Applet.*;
import java.applet.*;
public class app8 extends Applet{
TextArea mod = new TextArea(25,40);
public void init(){
add(mod);
}
public void paint (Graphics gr){
setBackground(Color.green);
}
}import java.io.*;
import java.awt.*;
import java.applet.Applet.*;
import java.applet.*;
public class app9 extends Applet{
Button A = new Button("color");
public void init(){
add(A);
}
public boolean action(Event op,Object gp){
if (op.target instanceof Button)
if(gp.equals("color")){
setBackground(Color.red);

return true;}
return false;}
}import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet.*;
import java.applet.*;

/*


*/


public class appbn1 extends Applet{
Button A = new Button("press here");
TextField X=new TextField(15);
String s1;

public void init(){
add(A);
add(X);
}


public void paint(Graphics g){

g.drawString(s1,40,40);


}

public boolean action(Event op,Object gp){
if (op.target instanceof Button)
if(gp.equals("press here")){

s1=X.getText();
System.out.println(s1);

repaint();
return true;}
return false;}
}/*


*/



import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import java.applet.*;

public class label0 extends Applet{

Button A=new Button("mat");
TextField B=new TextField(20);
Label C= new Label();
TextField e=new TextField(20);

public void init(){
add(A);
add(B);
add(C);
add(e);
}
public boolean action(Event op,Object gp){

if(op.target instanceof Button)
if(gp.equals("mat")){

setBackground(Color.orange);

                     String x =B.getText();
                     e.setText(x);
return true;}
return false;}
}
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import java.applet.*;

/*


*/

public class label1 extends Applet{

Button A=new Button("mat");
Label B= new Label();
int counter = 100;

public void init(){
add(A);
add(B);

}
public boolean action(Event op,Object gp){

if(op.target instanceof Button)
if(gp.equals("mat")){

setBackground(Color.orange);
                   
                     B.setText(Integer.toString(counter));
return true;}
return false;}
}
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import java.applet.*;

public class label2 extends Applet{

Button A=new Button("mat");
Label B= new Label();
String counter = "Al-Quds Open University";

public void init(){
add(A);
add(B);

}
public boolean action(Event op,Object gp){

if(op.target instanceof Button)
if(gp.equals("mat")){

setBackground(Color.orange);
                   
                     B.setText(counter);
return true;}
return false;}
}
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import java.applet.*;

public class label extends Applet{

Button A=new Button("mat");
TextField B=new TextField(6);
TextField C=new TextField(6);
Label D = new Label();

public void init(){
add(A);
add(B);
add(C);
add(D);

}
public boolean action(Event op,Object gp){

if(op.target instanceof Button)
if(gp.equals("mat")){

setBackground(Color.orange);

                     Stringx=B.getText();
                     Stringy=C.getText();
                     D.setText(x+y);
return true;}
return false;}
}

No comments:

Post a Comment

உப்பு மாங்காய்

சுருக்குப்பை கிழவி. சுருக்கங்கள் சூழ் கிழவி. பார்க்கும் போதெல்லாம் கூடையுடனே குடியிருப்பாள். கூடை நிறைய குட்டி குட்டி மாங்காய்கள். வெட்டிக்க...