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