程式設計工藝大師 http://tccnchsu.blogspot.tw/

 

ljes88c18 發表在 痞客邦 留言(0) 人氣()

11232341_989710904381968_201499468_o  

 

ljes88c18 發表在 痞客邦 留言(0) 人氣()

擷取  

 

ljes88c18 發表在 痞客邦 留言(0) 人氣()

擷取  

 

ljes88c18 發表在 痞客邦 留言(0) 人氣()

逢甲大學

應用數學系四年甲班

ljes88c18 發表在 痞客邦 留言(0) 人氣()

  • Apr 24 Fri 2015 14:46
  • 150417

import java.awt.*;
import java.awt.event.*;

import javax.swing.*;

public class Calculator extends JFrame implements ActionListener{


public static void main(String[]args){

new Calculator();
}


public Calculator()
{
String s;
JFrame window=new JFrame("Calculator");

window.setDefaultLookAndFeelDecorated(true);


window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

window.setLayout(new GridLayout(3,3));

JPanel jplPanel = new JPanel();
jplPanel.setLayout(new GridLayout(3,3));

JButton button[]=new JButton[10];
//s=Integer.toString(1);
s=String.valueOf(1);
//System.out.println(s);
//s="1";

for (int i = 1; i <= 9; i++)
{
button[i] = new JButton();

button[i].setActionCommand(s);
button[i].addActionListener(this);
button[i].setSize(50,50);
button[i].setText(Integer.toString(i));

jplPanel.add(button[i]);
}
window.getContentPane().add(jplPanel, BorderLayout.CENTER);
window.setSize(500,500);
window.setVisible(true);
}




public void actionPerformed(ActionEvent e) {
        String cmd = e.getActionCommand();
        System.out.println(cmd);
        if (cmd == "1") {
           
            System.out.println("Yes....");
        }
    }

}


ljes88c18 發表在 痞客邦 留言(0) 人氣()

1  

 

ljes88c18 發表在 痞客邦 留言(0) 人氣()

1  

 

ljes88c18 發表在 痞客邦 留言(0) 人氣()

 1.為何why要選修這門課?(動機)

 

ljes88c18 發表在 痞客邦 留言(0) 人氣()

  • Dec 26 Fri 2014 16:09
  • 141226

 

未命名  

ljes88c18 發表在 痞客邦 留言(0) 人氣()

1 23