Skip to main content

Posts

Showing posts from 2016

Starting and ending position in java

                    find the starting and ending                                   position  using awt in java import java.awt.*; import java.awt.event.*; import java.applet.*; /*             <applet code="TextArea2" height=200 width=200>             </applet> */ public class TextArea2 extends Applet implements ActionListener {             TextArea ta;             TextField tsp,tep;             public void init()             {        ...

Example of choice class in java

               Example of choice class (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();                         /...

MultiThreading in java

          MultiThreading in Java If you know about the threads in java than it is easy for you to understand multithreading. By default in every java program one thread is available. Thread is basically a lightweight sub-process , a smallest unit of processing .Multiprocessing and Multithreading , both are used to achieve multitasking. A thread can be in one of the following States:  New – A thread that has not yet Started is in this State. Blocked – A thread that is blocked waiting for a monitor lock is in this state. Timed_waiting –A thread that is waiting for another thread to perform an action for up to a                              Specified waiting time is in this state . Terminated – A thread that has exited is in this state.    Multithreading means more than one thing are correlated to each others. In java multithreading p...

Choice class methods

            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 ,void add(String s) where , s is the item which you want to add to                         the Choice control. 2. insert()       This method is used to insert the item in the choice list at the particular index position.                           The general form is  insert(String s,int index)   where , s is the string which we want ...

TEXTAREA EXAMPLE - 2 in java

                Awt program for finding starting and                            ending position import java.awt.*; import java.awt.event.*; import java.applet.*; /*             <applet code="TextArea2" height=200 width=200>             </applet> */ public class TextArea2 extends Applet implements ActionListener {             TextArea ta;             TextField tsp,tep;             public void init()             {                ...

Example of textarea in java

       find the length of the text in textarea import java.awt.*; import java.awt.event.*; import java.applet.*; /*             <applet code="TextArea1" height=200 width=200>             </applet> */ public class TextArea1 extends Applet implements ActionListener {             TextArea ta;             TextField tsp,tep,tlen; public void init()             {                         Label l1=new Label("Enter the text                    ...

TEXTAREA

           TEXTAREA CLASS IN AWT TextArea class:             This class is used to create the text area where we want type the text  extending to the multiple             rows and columns. Constructors: (i) TextArea()  It is the default constructor of the TextArea class.                         The general form is,                                     TextArea objectname =new TextArea(); (ii) TextArea(String)   It is used to create a textarea and assign in it the default string.              ...