[code]
import java.util.*;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.Label.*;
class project001 extends JFrame implements ActionListener {
private static final int FRAME_WIDTH = 500;
private static final int FRAME_HEIGHT = 400;
private static final int FRAME_X_ORIGIN = 250;
private static final int FRAME_Y_ORIGIN = 300;
private JLabel prompt;
private JButton enterButton;
public static void main(String[] args) {
project001 frame = new project001();
frame.setVisible(true);
}
public project001() {
Container contentPane;
setSize(FRAME_WIDTH, FRAME_HEIGHT);
setResizable(false);
setTitle("Student Information System");
setLocation(FRAME_X_ORIGIN, FRAME_Y_ORIGIN);
contentPane = getContentPane();
contentPane.setLayout(null);
contentPane.setBackground(Color.WHITE);
Font f = new Font("Tahoma", Font.BOLD, 28);
prompt = new JLabel();
prompt.setText("Student Information System");
prompt.setSize(500, 100);
prompt.setHorizontalAlignment(SwingConstants.CENTER);
prompt.setFont(f);
contentPane.add(prompt);
enterButton = new JButton("ENTER");
enterButton.setBounds(200, 300, 80, 30);
contentPane.add(enterButton);
enterButton.addActionListener(this);
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
public void actionPerformed(ActionEvent event) {
JButton clickedButton = (JButton) event.getSource();
// ????
}
}
[/code]
stakat nie je aku wat n kalo bleh button enter tu gi kat frame laen..
mcm mane ye coding nye... aku da try google tp xdpt n ade yg x phm..
tolong ye..