Skip to content

How to implements Item Listener in java Frams

How to implements Item Listener in java Frams. Here you will learn that how can we implement implements Item Listener in java Frams using AWT classes. Here is a complete java program that will show you that how we can apply ItemListener in java.

You can say that this complied java program will teach you that how you can create a frame or window in java that is looking like you are are creating a paint window.
Its means that you are developing a program to create a paint programe after some changing.

How to implements Item Listener in java Frams

import java.awt.event.*;
import java.awt.*;
class myframe extends Frame implements ItemListener
    Checkbox redchk,greenchk;
     CheckboxGroup grp;
     TextField txt;
   super(“Show the selected”);
   setBackground(new Color(245,25,25));
   addWindowListener(new WindowAdapter()
                 public void windowClosing(WindowEvent we)

grp=new CheckboxGroup();

redchk=new Checkbox(“red”,grp,true);

        greenchk=new Checkbox(“green”,grp,false);

          txt=new TextField(30);        


   public void itemStateChanged(ItemEvent ie)
         if (ie.getSource()==redchk)
              txt.setText(“Red Selected (By Kaleem)”);
                txt.setText(“Green Selected(By Kaleem)”);

class sajjad
  public static void main(String str[])
   myframe f=new myframe();

Here is also different java and programs like:

  1. How to connect java with database|Using JDBC-ODBC Connection string
  2. How to Create combo box in java|Complete Coding
  3. Java program to calculate Age from Date of birth
  4. How to create a Recruitment or job announcement page in | Complete front end designing and backend coding
  5. How to Add multiple textbox values and showing their sum
  6. Employee Registration form | Creation of Registration form in visual studio using c# and
  7. How add new webpage in a website using C#, in visual studio.
  8. How to create login page using and C#

%d bloggers like this: