import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
/**
*
* Description
*
* @version 1.0 from 2/18/2010
* @author
*/
public class ee extends JFrame {
// start attributes
private JTextField jTextField1 = new JTextField();
// end attributes
public ee(String title) {
// Frame-Init
super(title);
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
int frameWidth = 544;
int frameHeight = 300;
setSize(frameWidth, frameHeight);
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
int x = (d.width - getSize().width) / 2;
int y = (d.height - getSize().height) / 2;
setLocation(x, y);
Container cp = getContentPane();
cp.setLayout(null);
// start components
jTextField1.setBounds(48, 8, 145, 24);
jTextField1.setText("jTextField1");
jTextField1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
jTextField1_ActionPerformed(evt);
}
});
jTextField1.setFont(new Font("Dialog", Font.PLAIN, 13));
cp.add(jTextField1);
// end components
setResizable(false);
setVisible(true);
}
// start methods
public void jTextField1_ActionPerformed(ActionEvent evt) {
// TODO add your code here
}
// end methods
public static void main(String[] args) {
new ee("ee");
}
}
Tuesday, 23 January 2018
Related Posts:
Code with problem in javaimport javax.swing.JOptionPane;import java.util.Scanner;public class C… Read More
java swing import java.awt.*;import java.awt.event.*;import javax.swing.*;import … Read More
Candy bar example in java import java.io.*;//import javax.swing.*;class Candy { public sta… Read More
throw exception in java import java.io.*; //include Java's standard Input and Output routinesc… Read More
0 comments: