techpreparation-homepage

Home  Interview Questions  Aptitude Questions  Tutorials  Placement Papers  Search  Resume Guide  Soft Skills  Video  Forum  Blog


Technical Interview Questions
Javascript Interview Questions
Oracle Interview Questions
J2EE Interview Questions
C++ Interview Questions
XML Interview Questions
EJB Interview Questions
JSP Interview Questions
                              .........More

Programming Source Codes
Java Source Codes
Html Source Codes
CSS Source Codes
C Source Codes
                              .........More

Soft Skills
Communication Skills
Leadership Skills
                              .........More

Subscribe to our Newsletters
Name:
Email:

 

 

  

Java Source Codes

Creating TextField in Swing

import javax.swing.*;
import java.awt.*;

/**
* how to Create TextField in Swing
* @author jimmi.prajapati
*
*/
public class JTextFieldTest extends JFrame {



public JTextFieldTest() {
super("JTextField Test");

getContentPane().setLayout(new FlowLayout());

JTextField textField1 = new JTextField("1", 1);
JTextField textField2 = new JTextField("22", 2);
JTextField textField3 = new JTextField("333", 3);

getContentPane().add(textField1);
getContentPane().add(textField2);
getContentPane().add(textField3);

setSize(300, 170);
setVisible(true);
}

public static void main(String argv[]) {
new JTextFieldTest();
}
}


<<<----- Return to Java Source Code Questions Page.


 

Have a Question ? post your questions here. It will be answered as soon as possible.

Check Java Interview Questions for more Java Interview Questions with answers

Check Servlet Interview Questions for more Servlet Interview Questions with answers

Check Structs Interview Questions for more Structs Interview Questions with answers