SlideShare a Scribd company logo
1 of 7
UNIQUE COMPUTER


AWT- Close
import java.awt.*;
import java.awt.event.*;
public class awt_close
{
  public static void main(String[] args)
{
  Frame frame = new Frame("Close Operation Frame");
  Label lbl = new Label("Welcome to Unique Computer: ",Label.CENTER);
  frame.add(lbl);
  frame.setSize(400,400);
  frame.setVisible(true);
  frame.addWindowListener(new WindowAdapter()
         {
                  public void windowClosing(WindowEvent we)
                  {
                          System.exit(0);
                  }
         }
         );
  }
}


Data-1

import java.awt.*;
import java.awt.event.*;
class data extends Frame implements ActionListener
{
        TextField txt=new TextField(20);
        TextField txt2=new TextField(20);
        Label lbl=new Label("Name",Label.LEFT);
        Label lbl2=new Label("Output");
        Button input_b=new Button("Input");
        Button exit_b=new Button("Exit");
        public data(String title)
        {
                 super(title);
                 setLayout(new FlowLayout());
                 add(lbl);
                 add(txt);
                 add(lbl2);
                 txt2.setEditable(false);
                 add(txt2);
                 add(input_b);
                 input_b.setBackground(Color.yellow);
                 input_b.setForeground(Color.red);
UNIQUE COMPUTER


                 add(exit_b);
                 input_b.addActionListener(this);
                 exit_b.addActionListener(this);


          }
          public void actionPerformed(ActionEvent e)
          {
                   if(e.getSource()==input_b)
                   {
                            String a=txt.getText();
                            txt2.setText(a);
                   }
                   if(e.getSource()==exit_b)
                   {
                            System.exit(0);
                   }
          }
          public static void main(String args[])
          {
                   data t=new data("Testing Component");
                   t.setSize(250,250);
                   t.show();
          }
}


Data- 2

import java.awt.*;
import java.awt.event.*;
class data_2 extends Frame implements ActionListener
{
        TextField txt=new TextField(20);
        TextField txt2=new TextField(20);
        Label lbl=new Label("Name",Label.LEFT);
        Label lbl2=new Label("Output");
        Button input_b=new Button("Input");
        Button exit_b=new Button("Exit");
        public data_2(String title)
        {
                 super(title);
                 setLayout(new FlowLayout());
                 add(lbl);
                 add(txt);
                 add(lbl2);
                 txt2.setEditable(false);
                 add(txt2);
UNIQUE COMPUTER


               add(input_b);
               input_b.setBackground(Color.yellow);
               input_b.setForeground(Color.red);
               add(exit_b);
               input_b.addActionListener(this);
               exit_b.addActionListener(this);


       }
       public void actionPerformed(ActionEvent e)
       {
                if(e.getSource()==input_b)
                {
                         int num=Integer.parseInt(txt.getText());
                         int sq=num*num;
                         txt2.setText(String.valueOf(sq));
                }
                if(e.getSource()==exit_b)
                {
                         System.exit(0);
                }
       }
       public static void main(String args[])
       {
                data_2 t=new data_2("Testing Component");
                t.setSize(250,250);
                t.show();
       }
}




Frame Demo

import java.awt.*;
class framedemo extends Frame
{
         public framedemo(String title)
         {
                  super(title);
         }
         public static void main(String args[])
         {
                  framedemo obj=new framedemo("I have been Frame");
                  obj.setSize(500,500);
                  obj.setVisible(true);
         }
}
UNIQUE COMPUTER


Panel

import java.awt.*;
class paneldemo extends Panel
{
        public paneldemo()
        {

        }
        public static void main(String args[])
        {
                 paneldemo obj=new paneldemo();
                 Frame f=new Frame("Testing a Panel");
                 f.add(obj);
                 f.setSize(500,500);
                 f.setVisible(true);

        }
}


Label

import java.awt.*;
import java.awt.event.*;
class t_label extends Frame implements ActionListener
{
         TextField txt=new TextField(20);
         Label lbl=new Label("Name");
         Button exit_b=new Button("Exit");
         public t_label(String title)
         {
                  super(title);
                  setLayout(new FlowLayout());
                  add(lbl);
                  add(txt);
                  System.out.println();
                  add(exit_b);
                  exit_b.addActionListener(this);


        }
        public void actionPerformed(ActionEvent e)
        {
                if(e.getSource()==exit_b)
                {
                         System.exit(0);
                }
UNIQUE COMPUTER


       }
       public static void main(String args[])
       {
                t_label t=new t_label("Testing Component");
                t.setSize(250,250);
                t.show();
       }
}



                                             APPLET
Applet-Life Cycle:

import java.awt.*;
import java.applet.*;

public class applet_demo1 extends Applet
{
        public void init()
        {
                setBackground(Color.cyan);
                setForeground(Color.red);
        }
        public void start()
        {

       }
       public void stop()
       {

       }
       public void destroy()
       {
       }
       public void paint(Graphics g)
       {

       }
}
UNIQUE COMPUTER


Applet-String 1:

import java.awt.*;
import java.applet.*;
/*
<applet code="applet_demo2" width=300 height=100>
</applet>
*/
public class applet_demo2 extends Applet
{
        String msg;
        public void init()
        {
        setBackground(Color.cyan);
        setForeground(Color.red);
        msg="Inside init()";
        }
        public void start()
        {
        msg+=" Inside_Start()";
        }
        public void stop()
        {
        }
        public void destroy()
        {
        }
        public void paint(Graphics g)
        {
        msg+=" Inside_Paint()";
        g.drawString(msg,40,40);
        }
}


Applet String- Scrolling:
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import java.util.*;
/*
<applet code="applet_demo3" width=300 height=100>
</applet>
*/
UNIQUE COMPUTER


public class applet_demo3 extends Applet implements Runnable
{
        String msg;
        Thread t=null;
        char c;
        public void init()
        {
        setBackground(Color.cyan);
        setForeground(Color.red);
        msg=" A simple banner ";
        }
        public void start()
        {
                try
                {
                  t=new Thread(this);
                  t.start();
                }catch(Exception e){}
        }
        public void stop()
        {
        }
        public void destroy()
        {
        }
        public void paint(Graphics g)
        {
                g.drawString(msg,50,50);
        }
        public void run()
        {
                for(;;)
                {
                  try
                  {
                         repaint();
                         t.sleep(300);
                         c=msg.charAt(0);
                         msg=msg.substring(1,msg.length());
                         msg=msg+c;
                  }catch(Exception e){}
                 }
        }
}

More Related Content

What's hot

Java simple programs
Java simple programsJava simple programs
Java simple programsVEERA RAGAVAN
 
Cleanup and new optimizations in WPython 1.1
Cleanup and new optimizations in WPython 1.1Cleanup and new optimizations in WPython 1.1
Cleanup and new optimizations in WPython 1.1PyCon Italia
 
The Ring programming language version 1.5.4 book - Part 33 of 185
The Ring programming language version 1.5.4 book - Part 33 of 185The Ring programming language version 1.5.4 book - Part 33 of 185
The Ring programming language version 1.5.4 book - Part 33 of 185Mahmoud Samir Fayed
 
The Ring programming language version 1.4.1 book - Part 9 of 31
The Ring programming language version 1.4.1 book - Part 9 of 31The Ring programming language version 1.4.1 book - Part 9 of 31
The Ring programming language version 1.4.1 book - Part 9 of 31Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 31 of 180
The Ring programming language version 1.5.1 book - Part 31 of 180The Ring programming language version 1.5.1 book - Part 31 of 180
The Ring programming language version 1.5.1 book - Part 31 of 180Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 40 of 210
The Ring programming language version 1.9 book - Part 40 of 210The Ring programming language version 1.9 book - Part 40 of 210
The Ring programming language version 1.9 book - Part 40 of 210Mahmoud Samir Fayed
 
Final JAVA Practical of BCA SEM-5.
Final JAVA Practical of BCA SEM-5.Final JAVA Practical of BCA SEM-5.
Final JAVA Practical of BCA SEM-5.Nishan Barot
 
Advanced Java Practical File
Advanced Java Practical FileAdvanced Java Practical File
Advanced Java Practical FileSoumya Behera
 
The Ring programming language version 1.5.3 book - Part 10 of 184
The Ring programming language version 1.5.3 book - Part 10 of 184The Ring programming language version 1.5.3 book - Part 10 of 184
The Ring programming language version 1.5.3 book - Part 10 of 184Mahmoud Samir Fayed
 
The Ring programming language version 1.4 book - Part 9 of 30
The Ring programming language version 1.4 book - Part 9 of 30The Ring programming language version 1.4 book - Part 9 of 30
The Ring programming language version 1.4 book - Part 9 of 30Mahmoud Samir Fayed
 
4. Обработка ошибок, исключения, отладка
4. Обработка ошибок, исключения, отладка4. Обработка ошибок, исключения, отладка
4. Обработка ошибок, исключения, отладкаDEVTYPE
 
The Ring programming language version 1.3 book - Part 23 of 88
The Ring programming language version 1.3 book - Part 23 of 88The Ring programming language version 1.3 book - Part 23 of 88
The Ring programming language version 1.3 book - Part 23 of 88Mahmoud Samir Fayed
 
Java practice programs for beginners
Java practice programs for beginnersJava practice programs for beginners
Java practice programs for beginnersishan0019
 
The Ring programming language version 1.10 book - Part 101 of 212
The Ring programming language version 1.10 book - Part 101 of 212The Ring programming language version 1.10 book - Part 101 of 212
The Ring programming language version 1.10 book - Part 101 of 212Mahmoud Samir Fayed
 

What's hot (19)

Java simple programs
Java simple programsJava simple programs
Java simple programs
 
Cleanup and new optimizations in WPython 1.1
Cleanup and new optimizations in WPython 1.1Cleanup and new optimizations in WPython 1.1
Cleanup and new optimizations in WPython 1.1
 
The Ring programming language version 1.5.4 book - Part 33 of 185
The Ring programming language version 1.5.4 book - Part 33 of 185The Ring programming language version 1.5.4 book - Part 33 of 185
The Ring programming language version 1.5.4 book - Part 33 of 185
 
The Ring programming language version 1.4.1 book - Part 9 of 31
The Ring programming language version 1.4.1 book - Part 9 of 31The Ring programming language version 1.4.1 book - Part 9 of 31
The Ring programming language version 1.4.1 book - Part 9 of 31
 
The Ring programming language version 1.5.1 book - Part 31 of 180
The Ring programming language version 1.5.1 book - Part 31 of 180The Ring programming language version 1.5.1 book - Part 31 of 180
The Ring programming language version 1.5.1 book - Part 31 of 180
 
The Ring programming language version 1.9 book - Part 40 of 210
The Ring programming language version 1.9 book - Part 40 of 210The Ring programming language version 1.9 book - Part 40 of 210
The Ring programming language version 1.9 book - Part 40 of 210
 
Oop lecture9 13
Oop lecture9 13Oop lecture9 13
Oop lecture9 13
 
Java file
Java fileJava file
Java file
 
Final JAVA Practical of BCA SEM-5.
Final JAVA Practical of BCA SEM-5.Final JAVA Practical of BCA SEM-5.
Final JAVA Practical of BCA SEM-5.
 
Advanced Java Practical File
Advanced Java Practical FileAdvanced Java Practical File
Advanced Java Practical File
 
The Ring programming language version 1.5.3 book - Part 10 of 184
The Ring programming language version 1.5.3 book - Part 10 of 184The Ring programming language version 1.5.3 book - Part 10 of 184
The Ring programming language version 1.5.3 book - Part 10 of 184
 
Javascript
JavascriptJavascript
Javascript
 
The Ring programming language version 1.4 book - Part 9 of 30
The Ring programming language version 1.4 book - Part 9 of 30The Ring programming language version 1.4 book - Part 9 of 30
The Ring programming language version 1.4 book - Part 9 of 30
 
Sam wd programs
Sam wd programsSam wd programs
Sam wd programs
 
4. Обработка ошибок, исключения, отладка
4. Обработка ошибок, исключения, отладка4. Обработка ошибок, исключения, отладка
4. Обработка ошибок, исключения, отладка
 
The Ring programming language version 1.3 book - Part 23 of 88
The Ring programming language version 1.3 book - Part 23 of 88The Ring programming language version 1.3 book - Part 23 of 88
The Ring programming language version 1.3 book - Part 23 of 88
 
Java File
Java FileJava File
Java File
 
Java practice programs for beginners
Java practice programs for beginnersJava practice programs for beginners
Java practice programs for beginners
 
The Ring programming language version 1.10 book - Part 101 of 212
The Ring programming language version 1.10 book - Part 101 of 212The Ring programming language version 1.10 book - Part 101 of 212
The Ring programming language version 1.10 book - Part 101 of 212
 

Similar to Awt

Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.Kuldeep Jain
 
Java весна 2013 лекция 2
Java весна 2013 лекция 2Java весна 2013 лекция 2
Java весна 2013 лекция 2Technopark
 
Advanced Java - Practical File
Advanced Java - Practical FileAdvanced Java - Practical File
Advanced Java - Practical FileFahad Shaikh
 
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_04-Mar-2021_L14...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_04-Mar-2021_L14...WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_04-Mar-2021_L14...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_04-Mar-2021_L14...MaruMengesha
 
Java Simple Programs
Java Simple ProgramsJava Simple Programs
Java Simple ProgramsUpender Upr
 
Java programming lab_manual_by_rohit_jaiswar
Java programming lab_manual_by_rohit_jaiswarJava programming lab_manual_by_rohit_jaiswar
Java programming lab_manual_by_rohit_jaiswarROHIT JAISWAR
 
code for quiz in my sql
code for quiz  in my sql code for quiz  in my sql
code for quiz in my sql JOYITAKUNDU1
 
java slip for bachelors of business administration.pdf
java slip for bachelors of business administration.pdfjava slip for bachelors of business administration.pdf
java slip for bachelors of business administration.pdfkokah57440
 
Modify HuffmanTree.java and HuffmanNode.java to allow the user to se.pdf
Modify HuffmanTree.java and HuffmanNode.java to allow the user to se.pdfModify HuffmanTree.java and HuffmanNode.java to allow the user to se.pdf
Modify HuffmanTree.java and HuffmanNode.java to allow the user to se.pdfarjuncorner565
 
I dont know what is wrong with this roulette program I cant seem.pdf
I dont know what is wrong with this roulette program I cant seem.pdfI dont know what is wrong with this roulette program I cant seem.pdf
I dont know what is wrong with this roulette program I cant seem.pdfarchanaemporium
 
JEEConf 2017 - Having fun with Javassist
JEEConf 2017 - Having fun with JavassistJEEConf 2017 - Having fun with Javassist
JEEConf 2017 - Having fun with JavassistAnton Arhipov
 
OrderTest.javapublic class OrderTest {       Get an arra.pdf
OrderTest.javapublic class OrderTest {         Get an arra.pdfOrderTest.javapublic class OrderTest {         Get an arra.pdf
OrderTest.javapublic class OrderTest {       Get an arra.pdfakkhan101
 

Similar to Awt (20)

Java programs
Java programsJava programs
Java programs
 
Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.
 
Java весна 2013 лекция 2
Java весна 2013 лекция 2Java весна 2013 лекция 2
Java весна 2013 лекция 2
 
Advanced Java - Practical File
Advanced Java - Practical FileAdvanced Java - Practical File
Advanced Java - Practical File
 
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_04-Mar-2021_L14...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_04-Mar-2021_L14...WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_04-Mar-2021_L14...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_04-Mar-2021_L14...
 
Java Simple Programs
Java Simple ProgramsJava Simple Programs
Java Simple Programs
 
Java programming lab_manual_by_rohit_jaiswar
Java programming lab_manual_by_rohit_jaiswarJava programming lab_manual_by_rohit_jaiswar
Java programming lab_manual_by_rohit_jaiswar
 
Java oops features
Java oops featuresJava oops features
Java oops features
 
code for quiz in my sql
code for quiz  in my sql code for quiz  in my sql
code for quiz in my sql
 
TDD Hands-on
TDD Hands-onTDD Hands-on
TDD Hands-on
 
662305 11
662305 11662305 11
662305 11
 
java slip for bachelors of business administration.pdf
java slip for bachelors of business administration.pdfjava slip for bachelors of business administration.pdf
java slip for bachelors of business administration.pdf
 
Modify HuffmanTree.java and HuffmanNode.java to allow the user to se.pdf
Modify HuffmanTree.java and HuffmanNode.java to allow the user to se.pdfModify HuffmanTree.java and HuffmanNode.java to allow the user to se.pdf
Modify HuffmanTree.java and HuffmanNode.java to allow the user to se.pdf
 
JDK 8
JDK 8JDK 8
JDK 8
 
Awt components
Awt componentsAwt components
Awt components
 
I dont know what is wrong with this roulette program I cant seem.pdf
I dont know what is wrong with this roulette program I cant seem.pdfI dont know what is wrong with this roulette program I cant seem.pdf
I dont know what is wrong with this roulette program I cant seem.pdf
 
TechTalk - Dotnet
TechTalk - DotnetTechTalk - Dotnet
TechTalk - Dotnet
 
JEEConf 2017 - Having fun with Javassist
JEEConf 2017 - Having fun with JavassistJEEConf 2017 - Having fun with Javassist
JEEConf 2017 - Having fun with Javassist
 
OrderTest.javapublic class OrderTest {       Get an arra.pdf
OrderTest.javapublic class OrderTest {         Get an arra.pdfOrderTest.javapublic class OrderTest {         Get an arra.pdf
OrderTest.javapublic class OrderTest {       Get an arra.pdf
 
Nabil code
Nabil  codeNabil  code
Nabil code
 

Recently uploaded

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 

Recently uploaded (20)

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 

Awt

  • 1. UNIQUE COMPUTER AWT- Close import java.awt.*; import java.awt.event.*; public class awt_close { public static void main(String[] args) { Frame frame = new Frame("Close Operation Frame"); Label lbl = new Label("Welcome to Unique Computer: ",Label.CENTER); frame.add(lbl); frame.setSize(400,400); frame.setVisible(true); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { System.exit(0); } } ); } } Data-1 import java.awt.*; import java.awt.event.*; class data extends Frame implements ActionListener { TextField txt=new TextField(20); TextField txt2=new TextField(20); Label lbl=new Label("Name",Label.LEFT); Label lbl2=new Label("Output"); Button input_b=new Button("Input"); Button exit_b=new Button("Exit"); public data(String title) { super(title); setLayout(new FlowLayout()); add(lbl); add(txt); add(lbl2); txt2.setEditable(false); add(txt2); add(input_b); input_b.setBackground(Color.yellow); input_b.setForeground(Color.red);
  • 2. UNIQUE COMPUTER add(exit_b); input_b.addActionListener(this); exit_b.addActionListener(this); } public void actionPerformed(ActionEvent e) { if(e.getSource()==input_b) { String a=txt.getText(); txt2.setText(a); } if(e.getSource()==exit_b) { System.exit(0); } } public static void main(String args[]) { data t=new data("Testing Component"); t.setSize(250,250); t.show(); } } Data- 2 import java.awt.*; import java.awt.event.*; class data_2 extends Frame implements ActionListener { TextField txt=new TextField(20); TextField txt2=new TextField(20); Label lbl=new Label("Name",Label.LEFT); Label lbl2=new Label("Output"); Button input_b=new Button("Input"); Button exit_b=new Button("Exit"); public data_2(String title) { super(title); setLayout(new FlowLayout()); add(lbl); add(txt); add(lbl2); txt2.setEditable(false); add(txt2);
  • 3. UNIQUE COMPUTER add(input_b); input_b.setBackground(Color.yellow); input_b.setForeground(Color.red); add(exit_b); input_b.addActionListener(this); exit_b.addActionListener(this); } public void actionPerformed(ActionEvent e) { if(e.getSource()==input_b) { int num=Integer.parseInt(txt.getText()); int sq=num*num; txt2.setText(String.valueOf(sq)); } if(e.getSource()==exit_b) { System.exit(0); } } public static void main(String args[]) { data_2 t=new data_2("Testing Component"); t.setSize(250,250); t.show(); } } Frame Demo import java.awt.*; class framedemo extends Frame { public framedemo(String title) { super(title); } public static void main(String args[]) { framedemo obj=new framedemo("I have been Frame"); obj.setSize(500,500); obj.setVisible(true); } }
  • 4. UNIQUE COMPUTER Panel import java.awt.*; class paneldemo extends Panel { public paneldemo() { } public static void main(String args[]) { paneldemo obj=new paneldemo(); Frame f=new Frame("Testing a Panel"); f.add(obj); f.setSize(500,500); f.setVisible(true); } } Label import java.awt.*; import java.awt.event.*; class t_label extends Frame implements ActionListener { TextField txt=new TextField(20); Label lbl=new Label("Name"); Button exit_b=new Button("Exit"); public t_label(String title) { super(title); setLayout(new FlowLayout()); add(lbl); add(txt); System.out.println(); add(exit_b); exit_b.addActionListener(this); } public void actionPerformed(ActionEvent e) { if(e.getSource()==exit_b) { System.exit(0); }
  • 5. UNIQUE COMPUTER } public static void main(String args[]) { t_label t=new t_label("Testing Component"); t.setSize(250,250); t.show(); } } APPLET Applet-Life Cycle: import java.awt.*; import java.applet.*; public class applet_demo1 extends Applet { public void init() { setBackground(Color.cyan); setForeground(Color.red); } public void start() { } public void stop() { } public void destroy() { } public void paint(Graphics g) { } }
  • 6. UNIQUE COMPUTER Applet-String 1: import java.awt.*; import java.applet.*; /* <applet code="applet_demo2" width=300 height=100> </applet> */ public class applet_demo2 extends Applet { String msg; public void init() { setBackground(Color.cyan); setForeground(Color.red); msg="Inside init()"; } public void start() { msg+=" Inside_Start()"; } public void stop() { } public void destroy() { } public void paint(Graphics g) { msg+=" Inside_Paint()"; g.drawString(msg,40,40); } } Applet String- Scrolling: import java.awt.*; import java.applet.*; import java.awt.event.*; import java.util.*; /* <applet code="applet_demo3" width=300 height=100> </applet> */
  • 7. UNIQUE COMPUTER public class applet_demo3 extends Applet implements Runnable { String msg; Thread t=null; char c; public void init() { setBackground(Color.cyan); setForeground(Color.red); msg=" A simple banner "; } public void start() { try { t=new Thread(this); t.start(); }catch(Exception e){} } public void stop() { } public void destroy() { } public void paint(Graphics g) { g.drawString(msg,50,50); } public void run() { for(;;) { try { repaint(); t.sleep(300); c=msg.charAt(0); msg=msg.substring(1,msg.length()); msg=msg+c; }catch(Exception e){} } } }