March 29, 2015

Button(APPLET) NetBeans

import java.applet.Applet;
import java.awt.Button;
import java.awt.Graphics;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

public abstract class Finalact extends Applet implements ItemListener{    
    Button Left=null;
    Button Center=null;
    Button Right=null;
 
    @Override
       public void init(){
             Left=new Button("Left");
             Center=new Button("Center");
             Right=new Button("Right");
                add(Left);
                add(Center);
                add(Right);
        }
    @Override
        public void paint(Graphics b) {
           b.drawString("AMA VISIION",140,150);
           b.drawString("To be the leader and dominant provider ",140,150);
           b.drawString("of relevant and globally recognized information ",140,150);
           b.drawString("technology based education and  ",140,150);
           b.drawString("related services in the global market.  ",140,150);
       }
       public void itemStatementChange(ItemEvent o){
           repaint();
       }
    }


import java.applet.Applet;
import java.awt.Button;
import java.awt.Graphics;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

public abstract class Finalact extends Applet implements ItemListener{    
    Button Left=null;
    Button Center=null;
    Button Right=null;
 
 
       public void init(){
             Button button1 = new Button();
             Button button2 = new Button();
             Button button3 = new Button();
             button1.setForeground(Center);
             button2.setLabel("My Button 1");
             button3.setLabel("My Button 1");
        }
 
        public void paint(Graphics b) {
           b.drawString("AMA VISIION",140,150);
           b.drawString("To be the leader and dominant provider ",140,150);
           b.drawString("of relevant and globally recognized information ",140,150);
           b.drawString("technology based education and  ",140,150);
           b.drawString("related services in the global market.  ",140,150);
       }
       public void itemStatementChange(ItemEvent o){
           repaint();
       }
    }
http://www.java-examples.com/create-awt-button-example
http://www.java-examples.com/change-button-foreground-color-example
http://www.java-examples.com/create-awt-radio-buttons-using-checkboxgroup-example

No comments: