This program is for creating java text filed
compilation: javac JTextFieldDemo.java
Run: appletviewer JTextFieldDemo.java
-----------------------------------------------------
CODE:
-----------------------------------------------------
import java.awt.*;
import javax.swing.*;
/* <applet code="JTextFieldDemo" width=200 height=50>
</applet>
*/
public class JTextFieldDemo extends JApplet{
public void init() {
// Get content pane
Container contentPane = getContentPane();
//Creating a Text filed
JTextField jtf = new JTextField(JTextField.CENTER);
// Add text field to content pane
contentPane.add(jtf);
}
}
--------------------------------------------------------------
OUTPUT:
--------------------------------------------------------------
compilation: javac JTextFieldDemo.java
Run: appletviewer JTextFieldDemo.java
-----------------------------------------------------
CODE:
-----------------------------------------------------
import java.awt.*;
import javax.swing.*;
/* <applet code="JTextFieldDemo" width=200 height=50>
</applet>
*/
public class JTextFieldDemo extends JApplet{
public void init() {
// Get content pane
Container contentPane = getContentPane();
//Creating a Text filed
JTextField jtf = new JTextField(JTextField.CENTER);
// Add text field to content pane
contentPane.add(jtf);
}
}
--------------------------------------------------------------
OUTPUT:
--------------------------------------------------------------
1 comment:
Hi there, just wanted to say, I loved this blog post.
It was funny. Keep on posting!
Here is my webpage ... leckere rezepte
Also see my web page > pasta rezepte
Post a Comment