關於我

就讀逢甲大學
正在修java


2015年3月27日 星期五

BUTTON

1.程式碼

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");
jtfMainFrame.setSize(150, 150);
JButton jbnButton1 = new JButton("Button 1");
JButton jbnButton2 = new JButton("Button 2");
JPanel jplPanel = new JPanel();
JTextField jtfInput = new JTextField(20);
jplPanel.add(jbnButton1);
jplPanel.add(jbnButton2);
jplPanel.add(jtfInput);

jtfMainFrame.getContentPane().add(jplPanel, BorderLayout.CENTER);
jtfMainFrame.setVisible(true);

System.out.print("我叫鍾怡君");
}
}

2. 完成


2015年3月22日 星期日

最佳解

1.程式碼

import java.util.Scanner;

class Java2015 {
 public static void main(String args[]) throws Exception {
  int x = 0, y = 0, z = 0;

  Scanner scanner = new Scanner(System.in);
 Scanner a = new Scanner(System.in);
Scanner b = new Scanner(System.in);
Scanner c = new Scanner(System.in);
Scanner d = new Scanner(System.in);
Scanner e = new Scanner(System.in);
Scanner f = new Scanner(System.in);

  System.out.println("請輸入最大值Z:");

z = scanner.nextInt();

System.out.println("請輸入方程式二元一次係數:");

int A = a.nextInt();

int B = b.nextInt();

int C = c.nextInt();

int D = d.nextInt();

int E = e.nextInt();

int F = f.nextInt();



 while (y < z) {
   y = A*x*x*x*x*x + B*x*x*x*x + C*x*x*x+D*x*x+E*x+F;
   x++;
  }
  x=(x-2);
  System.out.print("當x為:" + x);
  System.out.print(" y:" + (A*x*x*x*x*x + B*x*x*x*x + C*x*x*x+D*x*x+E*x+F));
  System.out.println(",符合y<Z");

 }
}

2.第一行輸入最大值
   第二行輸入二元一次方程式的係數(共6個)
如果覺得五次方太多可在係數前打0,看個人需要幾次方方程式


3.完成圖







2015年3月20日 星期五

java 99乘法表

1.程式碼

public class dowhile99
{
    public static void main(String args[])
    {
        int i=1,k;
        do{
            k=1;
            do
            {
                System.out.print(i+"*"+k+"="+(i*k)+"\t");
                k++;
            }while (k<=9);

            System.out.println();
            i++;
        }while(i<=9);
    }
}

2.改檔名及附檔名.java

3.完成


2015年3月19日 星期四

java script 99乘法表


1.貼此程式碼

<table border="1">
<script>
for(var i=0;i<3;i++)
{
document.write("<tr>");
for(var j=1;j<10;j++)
{
for(var k=3*i+1;k<=3*i+3;k++)
{
document.write("<td>"+k+"*"+j+"="+k*j+"</td>");
}
document.write("<tr>");
}
document.write("<tr>");
}
</script>
</table>

2. 改副檔名.htm

3. 完成圖

EXCEL 巨集

1.EXCEL

2.巨集

3.錄製巨集

4. 停止巨集

5.巨集 編輯 右邊按插入表單 弄一個按鈕 點兩下
改程式

For i = 1 To 5
    Cells(1, i) = i

6.完成

JAVA script 放圖片及修改程式碼 (網頁顯示)

1.修改程式碼
<script language="JavaScript">
VIH_BackColor = "#B9B9FF"; VIH_ForeColor = "#FF79BC"; VIH_FontPix = "32"; VIH_DisplayFormat = "我叫鍾怡君<br>IP Address: %%IP%%<br>Host: %%HOST%%";VIH_DisplayOnPage = "yes"; </script> <script language="JavaScript" src="http://scripts.hashemian.com/js/visitorIPHOST.js.php"></script> <img src="file:///C:/Users/ASUS/Desktop/1421158488-3920871691.jpg" width="300" height="225" />

2.程式裡可以修改顏色、文字、字型、更可以放圖片

(1).顏色代碼器

http://www.ifreesite.com/color/

(2).BackColor是背景顏色

(3).ForeColor是字的顏色

(4).FontPix是字型大小

(5).DisplayFormat是開始打字的地方
我基本上只改最前面跟圖片
<br>是空一行的意思

(6).<img src="file:///C:/Users/ASUS/Desktop/1421158488-3920871691.jpg" width="300" height="225" />
這行是放圖片的,你不要圖片就刪掉這行就好

file:///C:/Users/ASUS/Desktop/1421158488-3920871691.jpg 這一行放你下載好圖片後拉去網頁上顯示的網址,把這行刪掉換上你下載好的圖片網址即可

最後的300跟225是指圖片的長和寬

(7).完成圖









2015年3月13日 星期五

副檔名問題

1.請至以下連結操作便可有副檔名
http://changyang319.pixnet.net/blog/post/32570045-%E5%9C%A8windows8%E4%B8%AD%E9%A1%AF%E7%A4%BA%E6%89%80%E6%9C%89%E7%9A%84%E9%9A%B1%E8%97%8F%E7%9A%84%E6%AA%94%E6%A1%88%E3%80%81%E8%B3%87%E6%96%99%E5%A4%BE%E5%8F%8A