임베디드 프로그래밍  

         
전체 기타 | WinCE | Delphi | VisualC | ARM | Media | SE | 마리오네트 | Java | wdm | JTAG | 영상처리 | 인증 | 질문/답변 | H/W | 알고리즘 | Platform | .net | VB | PPC | Network | android | QT | WWW | Linux |
Together 로 만든 모양만 계산기인 프로그램 (시간이 없어서 완성 못함)
하창호08-31 16:48 | HIT : 3,818
import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Checkbox;
import java.awt.CheckboxGroup;
import java.awt.Dialog;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.Label;
import java.awt.Panel;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.TextField;

/**
* This example shows AWT Dialog.
* @author TogetherSoft
*/
public class TestDialog extends Dialog {
    public TestDialog(Frame frame) {
        super(frame);
        initGUI();
    }

    /** This method is called from within the constructor to initialize the form. */
    void initGUI() {
        okButton.setLabel("OK");
        okButton.setBounds(new java.awt.Rectangle(249,191,55,26));
        okButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) { okButtonActionPerformed(e); }
            });
        contentPanel.setLayout(null);
        contentPanel.add(button1);
        contentPanel.add(button2);
        contentPanel.add(button3);
        contentPanel.add(button4);
        contentPanel.add(button5);
        contentPanel.add(button6);
        contentPanel.add(button7);
        contentPanel.add(button8);
        contentPanel.add(button9);
        contentPanel.add(button10);
        contentPanel.add(button11);
        contentPanel.add(button12);
        contentPanel.add(button13);
        contentPanel.add(button14);
        contentPanel.add(button15);
        contentPanel.add(textField1);
        contentPanel.add(button16);
        contentPanel.add(okButton);
        button1.setLabel("1");
        button1.setBounds(new java.awt.Rectangle(47, 51, 57, 26));
        button2.setLabel("2");
        button2.setBounds(new java.awt.Rectangle(111, 51, 57, 26));
        button3.setLabel("3");
        button3.setBounds(new java.awt.Rectangle(173, 51, 57, 26));
        button4.setLabel("4");
        button4.setBounds(new java.awt.Rectangle(46, 84, 57, 26));
        button5.setLabel("5");
        button5.setBounds(new java.awt.Rectangle(109, 86, 57, 26));
        button6.setLabel("6");
        button6.setBounds(new java.awt.Rectangle(173, 85, 57, 26));
        button6.setActionCommand("6");
        button7.setLabel("7");
        button7.setBounds(new java.awt.Rectangle(45, 118, 57, 26));
        button8.setLabel("8");
        button8.setBounds(new java.awt.Rectangle(108, 117, 57, 26));
        button9.setLabel("9");
        button9.setBounds(new java.awt.Rectangle(172, 117, 57, 26));
        button10.setLabel("0");
        button10.setBounds(new java.awt.Rectangle(107, 153, 64, 26));
        button11.setLabel("+");
        button11.setBounds(new java.awt.Rectangle(239, 51, 64, 26));
        button12.setLabel("-");
        button12.setBounds(new java.awt.Rectangle(238, 84, 64, 26));
        button12.setActionCommand("-");
        button13.setLabel("*");
        button13.setBounds(new java.awt.Rectangle(237, 117, 64, 26));
        button14.setLabel("/");
        button14.setBounds(new java.awt.Rectangle(239, 150, 64, 26));
        button15.setLabel("=");
        button15.setBounds(new java.awt.Rectangle(178, 151, 54, 26));
        textField1.setText("0");
        textField1.setBounds(new java.awt.Rectangle(44,18,260,28));
        addWindowListener(
            new WindowAdapter() {
                public void windowClosing(WindowEvent e) { thisWindowClosing(e); }
            });
        setBounds(new java.awt.Rectangle(0, 0, 365, 268));
        setResizable(false);
        setTitle("Test Dialog");
        add(contentPanel, java.awt.BorderLayout.CENTER);
        add(buttonPanel, BorderLayout.SOUTH);
        buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
        buttonPanel.add(butttonHolder);
        butttonHolder.setLayout(new GridLayout(1, 0, 5, 0));
        button16.setLabel("CR");
        button16.setBounds(new java.awt.Rectangle(39, 152, 64, 26));
    }

    void ok() {
        dispose();
        System.exit(0);
    }

    public void thisWindowClosing(WindowEvent e) {
        ok();
    }

    public void okButtonActionPerformed(ActionEvent e) {
        ok();
    }

   public static void main(String[] args) {
        Frame frame = new Frame();
        TestDialog dialog = new TestDialog(frame);
        dialog.show();
    }

    private Panel contentPanel = new Panel();
    private Panel buttonPanel = new Panel();
    private Panel butttonHolder = new Panel();
    private Button okButton = new Button();
    private CheckboxGroup checkboxGroup1 = new CheckboxGroup();
    private Button button1 = new Button();
    private Button button2 = new Button();
    private Button button3 = new Button();
    private Button button4 = new Button();
    private Button button5 = new Button();
    private Button button6 = new Button();
    private Button button7 = new Button();
    private Button button8 = new Button();
    private Button button9 = new Button();
    private Button button10 = new Button();
    private Button button11 = new Button();
    private Button button12 = new Button();
    private Button button13 = new Button();
    private Button button14 = new Button();
    private Button button15 = new Button();
    private TextField textField1 = new TextField();
    private Button button16 = new Button();
}


3  Java :: java 간단한 다이얼로그 띄우기    하창호 2007·08·29 8769
 Java :: Together 로 만든 모양만 계산기인 프로그램 (시간...    하창호 2004·08·31 3818
1  Java :: 자바 기초 I/O 문법 예제  …1  하창호 2004·08·30 3497
1
   
Copyright 1999-2018 Zeroboard / skin by GGAMBO
....