Up level

04:57 / Posted by Terry /


today is a big day for me

cause my programming skill up level already
below is the first interface that i create using java code, although i use an hour about it
any where.... thx to my fellow friends




below are the code:

import java.awt.*;
import javax.swing.*;
public class GUI extends JFrame{
private JLabel lblinput1;
private JLabel lblinput2;
private JTextField txt1;
private JTextField txt2;
private JButton btncalc;
private JButton btnReset;
public GUI() {
lblinput1 = new JLabel ("input1");
lblinput2 = new JLabel ("input2");
txt1 = new JTextField (10);
txt2 = new JTextField (10);
btncalc = new JButton ("Calculation");
btnReset = new JButton ("Reset");
this.setLayout(new GridLayout (4,4));
this.add (lblinput1);
this.add (lblinput2);
this.add (txt1);
this.add (txt2);
this.add (btncalc);
this.add (btnReset);
this.setSize (200,150);
this.setTitle ("Calculator");
this.setVisible (true);
}
public static void main(String[] args) {
// TODO code application logic here
new GUI();
}
}

thx for entertain

0 comments:

发表评论