Skip to main content

Posts

Showing posts from June, 2016

Scrolll bar in awt in java

                        Scrolll bar in awt        Scrollbar class: The Srcollbar class is used for creating the Scrollbar control. It is used for sliding in the range of values. Constructors: ü             Scrollbar() ü              Scrollbar(int orientation) ü             Scrollbar(int orientation , int value ,int width,int min,int max)     (i) Scrollbar()             It is the default constructor of the Scrollbar class.it will create a horizontal scrollbar,And the         position of the Thumb or elevator will be at zero. (ii) Scrollbar(int orientation)             It is also used to create the Scrollbar. It take one argument to specify the   ...

Choice class with button in java

        Choice class with button and label   import java.awt.*; import java.awt.event.*; import java.applet.*; /*             <applet code="ListBox" height=200 width=200>             </applet> */ public class ListBox extends Applet implements ActionListener {             Button b1,b2,b3;             TextField tf;             List lst;             public void init()             {                         Label...

Program of choise class on java

           program of choise class in awt import java.applet.*; import java.awt.*; import java.awt.event.*; /*             <applet code="ChoiceDemo" height=200 width=200>             </applet> */ public class ChoiceDemo extends Applet implements ItemListener {             TextField tf;             public void init()             {                         Choice ch=new Choice();                         /* add the items...

choice class in awt

                      choice class in awt Choice class: This class is used to draw a drop down list box. The drop down list box contains a list of items and it shows or display only a single item from the list. 1. add():         This method is used to add an item to the drop down list box or the Choice classobject.                                                                         The general form is ,                     ...

check box in java

              check box with condition(if else) import java.awt.*; import java.applet.*; import java.awt.event.*; /*<applet code="Classtest" height=300 width=300> </applet>*/ public class Classtest extends Applet implements ItemListener {    Checkbox c1,c2,c3;   Canvas s1; public void init( ) {    c1=new Checkbox("Red");    add(c1);   c1.addItemListener(this);  c2=new Checkbox("Green");    add(c2);   c2.addItemListener(this);  c3=new Checkbox("Blue");    add(c3);   c3.addItemListener(this); s1=new Canvas( ); s1.setSize(50,50); add(s1); } public void itemStateChanged(ItemEvent ie) {             Color c;             if(c1.getState()==true)          ...