/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Swing;
/**
*
* @author Administrator
*/
import javax.swing.*;
import java.awt.*;
public class AbsCoordinate {
public static void main(String[] args) {
JFrame frame = new JFrame("Laying Out Components Using Absolute Coordinates");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel();
panel.setLayout(null);
JLabel label1 = new JLabel("NAME : ");
JTextField field = new JTextField(20);
JButton button1 = new JButton("OK");
JButton button2 = new JButton("Cancel");
label1.setBounds(20, 20, 200,50);
field.setBounds(75, 33, 200, 25);
button1.setBounds(60, 70, 75, 25);
button2.setBounds(150,70, 75, 25);
panel.add(label1);
panel.add(field);
panel.add(button1);
panel.add(button2);
frame.add(panel);
frame.setSize(400,400);
frame.setVisible(true);
}
}
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Swing;
/**
*
* @author Administrator
*/
import javax.swing.*;
import java.awt.*;
public class AbsCoordinate {
public static void main(String[] args) {
JFrame frame = new JFrame("Laying Out Components Using Absolute Coordinates");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel();
panel.setLayout(null);
JLabel label1 = new JLabel("NAME : ");
JTextField field = new JTextField(20);
JButton button1 = new JButton("OK");
JButton button2 = new JButton("Cancel");
label1.setBounds(20, 20, 200,50);
field.setBounds(75, 33, 200, 25);
button1.setBounds(60, 70, 75, 25);
button2.setBounds(150,70, 75, 25);
panel.add(label1);
panel.add(field);
panel.add(button1);
panel.add(button2);
frame.add(panel);
frame.setSize(400,400);
frame.setVisible(true);
}
}
Comments
Post a Comment