2016年3月10日 星期四

上課教材

2015年4月24日 星期五

程式設計工藝大師(Master of Computer Programming)

2015年4月10日 星期五

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class Test
{

public static void main(String[] args)
{
JFrame jtfMainFrame = new JFrame("Which Button Demo");
JTextField jtfInput = new JTextField(20);

JPanel jpPanel = new JPanel();

JButton jbnButton1= new JButton("1");
JButton jbnButton2= new JButton("2");
JButton jbnButton3= new JButton("3");

jpPanel.add(jbnButton1);
jpPanel.add(jbnButton2);
jpPanel.add(jbnButton3);
jpPanel.add(jtfInput);

jtfMainFrame.setSize(300, 200);
jtfMainFrame.getContentPane().add(jpPanel, BorderLayout.CENTER);
jtfMainFrame.setVisible(true);

jbnButton1.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
System.out.println("Button 1!");
}
});
System.out.println("abc");
}
}

2015年3月27日 星期五

20150327 文字方塊及按鈕

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class Test
{
public static void main(String[] args)
{
JFrame jtfMainFrame = new JFrame("Which Button Demo");
JTextField jtfInput = new JTextField(20);
JPanel jpPanel = new JPanel();

JButton jbnButton1= new JButton("Button 1");
JButton jbnButton2= new JButton("Button 2");
jpPanel.add(jbnButton1);
jpPanel.add(jbnButton2);
jpPanel.add(jtfInput);

jtfMainFrame.setSize(300, 200);
jtfMainFrame.getContentPane().add(jpPanel, BorderLayout.CENTER);
jtfMainFrame.setVisible(true);


System.out.println("abc");
}
}

2015年3月20日 星期五

3/20 javascript 九九乘法表

<html>
<head>
<title> The First Example: Hello, World </title>
</head>
<body>
<h2> This line is HTML </h2>

<script language="JavaScript">
document.write("hello!!");
for(i=1;i<=10;i++)
{
document.write("<BR>"+i);
}
document.write("<BR>");

for(i=1;i<=9;i++)
{
for(j=1;j<=9;j++)
{
document.write(i*j);
}
document.write("<BR>");
}
</script>
<noscript>
Sorry, but your browser doesn't run JavaScript.
</noscript>

<h2> This line is HTML </h2>
</body>
</html>

2015年3月19日 星期四

3/20vba九九乘法表


Private Sub CommandButton1_Click()
For i = 1 To 9
For j = 1 To 9
Cells(i, j) = i * j
Next
Next

End Sub


2014年12月7日 星期日

12/5 excel VBA 亂數產生
VB excel 亂數程式碼
Private Sub CommandButton1_Click()
For i = 1 To 9
Cells(1, i) = i
Cells(1, i).Font.ColorIndex = 0
Next
For i = 1 To 9
j = 10 - i
myrandom = (Fix(Rnd() * j + 1))
Cells(3, 3) = myrandom
tem = Cells(1, j)
Cells(1, j) = Cells(1, myrandom)
Cells(1, myrandom) = tem
Next
End Sub