how to create a text box using awt

how to create a text box using awt

give an example how creat multi buttons & text boxes

View Answers

March 16, 2011 at 11:18 AM

import java.awt.*;
class AWTExample 
{
    public static void main(String[] args) 
    {
        Frame f=new Frame();
        f.setLayout(null);
        Label lab=new Label("Name: ");
        TextField text=new TextField(20);
        Button b1=new Button("Add");
        Button b2=new Button("Edit");
        Button b3=new Button("Delete");
        Button b4=new Button("Search");

        lab.setBounds(50,50,80,20);
        text.setBounds(140,50,250,20);
        b1.setBounds(50,100,80,20);
        b2.setBounds(150,100,80,20);
        b3.setBounds(250,100,80,20);
        b4.setBounds(350,100,80,20);
        f.add(lab);
        f.add(text);
        f.add(b1);
        f.add(b2);
        f.add(b3);
        f.add(b4);
        f.setVisible(true);
        f.setSize(500,150);
    }
}

Ads









Related Tutorials/Questions & Answers:
how to create a text box using awt
how to create a text box using awt  give an example how creat multi buttons & text boxes
How to Validate dynamically created text box in HTML using Javascript
How to Validate dynamically created text box in HTML using Javascript  Here is the HTML code to create text boxes dynamically. It works properly.... And also how to validate the text boxes created dynamically. <html>
Advertisements
J2ME Text Box Example
J2ME Text Box Example       This application illustrates how to create the text box using TextBox class. The TextBox class is a Screen that allows the user to enter and edit text
how to display data from mysql table in text box using jsp??
how to display data from mysql table in text box using jsp??  <...="row">Reference GPC</th> 113: <td><input type="text" name...; 115: <th>Numint</th> 116: <td><input type="text
how to print all colors using awt
how to print all colors using awt  how to print all colors using awt
create, edit ,open simple documents using java - Swing AWT
create, edit ,open simple documents using java   In my program I have a text area.How to create document which will contain text in text... in text area? Then how to transfer text in that document back to text area
populating text box using jsp code
populating text box using jsp code  Sir, How to populate related values in a text box after selecting value from drop down list using JSP and mysql. I tried using Ajax from your example. But for some browser it does not support
List the names of classes used to create button and text box in Java.
List the names of classes used to create button and text box in Java.  List the names of classes used to create button and text box in Java
How to handle the text using Key Listener Interface
How to handle the text using Key Listener Interface... to handle the text using the key events on the Java Awt component. All the key events... are going to show you how to display the text of textField1 on the text field2 on key
how to create a combo box in html
how to create a combo box in html  <tr> <td>Number<span class=mandatory>*</span></td> <td> <select name="number" id="course" style="width:158px;"> <option value="none">----Select
how to implements jdbc connections using awt
how to implements jdbc connections using awt  sir, My name... valuable information about how to implements jdbc connections in awt.please give me sample example awt with jdbc. Thanking you sir.  
how to create using jsp
how to create using jsp  code 1: <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>...;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
how to implements jdbc connections using awt?
how to implements jdbc connections using awt?   My name is Aditya... information about how to implements jdbc connections in awt.please give me sample example awt with jdbc.   We are proving you a simple application
JDialog to create a customized dialog box for entering text data
JDialog to create a customized dialog box for entering text data   Hello sir I wanted to know the code to generate a JDialog to create a customized dialog box for entering text data. The dialog can be split into panes, left pane
How to assign a default value to text box in netbeans
How to assign a default value to text box in netbeans  I have a java application,and i want to assign a default variable to the textbox
how to display webservice response in a text box
how to display webservice response in a text box  Hallo, i have created a webservice and when i sended request to my webservice its sending proper response . the point is how to dispaly the response values in a text box usinj
Insert value of dynamic generated text box in jsp using javascript
Insert value of dynamic generated text box in jsp using javascript  hello sir , i want to generate dynamic text box at run time and i did that using... that dynamically generated text box value into database at a time without
select box and text box validations
select box and text box validations  hi, any one please tell me how to set validations for select box and text boxes using bean classes? thank you...-registration-form-using-jsp.shtml
Create a Container in Java awt
Create a Container in Java awt       Introduction This program illustrates you how to create... the position of the text area has been specified the center of the frame using
another frame by using awt or swings
another frame by using awt or swings  how to connect one frame to another frame by using awt or swings
how can i store text box values as it is in database table
how can i store text box values as it is in database table  CUSTOMER DESCRIPTION
How to put the logo in login form using swings/awt?
How to put the logo in login form using swings/awt?  Hi, How to put the logo in login form using swings/awt? I write the login form is working but i want to put the logo in login form plz help   Here is an example
How to Create Instance using PHP
How to Create Instance using PHP  Hi, How to create an instance class in PHP program. Can someone explain or suggest any online reference how to create an Instance class in PHP. Thanks
how to operate on select box using ajax in struts2?
how to operate on select box using ajax in struts2?  I am doing a project on struts2 in which i have a jsp page which has two select boxes like... box. so please help me..its urgent ... thanx in advance
how to operate on select box using ajax in struts2?
how to operate on select box using ajax in struts2?  I am doing a project on struts2 in which i have a jsp page which has two select boxes like <... it by assigning to the block list select box. so please help me..its urgent
create login page using data from text file
create login page using data from text file  I want to create login page using data store in textfile(data submit from regiter page to textfile) using jsp and servlet. Thanks
Create Box in Excel Sheet Using JSP
create box in excel sheet using jsp       In this program we are going create... that we create textbox and at last we set string into created box.   
How to Create Text Area In Java
How to Create Text Area In Java       In this section, you will learn how to create Text Area in Java... and a text area is also created on the panel by using JTextArea class
how to backup and restore database using java - Swing AWT
how to backup and restore database using java  sir my project is to backup and restore my datas using java so i want to know how to backup and restore databases using java give ur ideas and suggestions to me immediately  
Text box Checking
Text box Checking  I want to Write only the word A-Z in a text box What is the code
How to check text in textbox using JavaScript
How to check text in textbox using JavaScript  How to check text in textbox using JavaScript I have a form in HTML that contains text feilds... qestion is that is it possible to check text feilds for text or null value. I want

Ads