import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class myButton extends JFrame{

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

程式

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

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

import java.awt.*; import java.awt.event.*; import javax.swing.*; class test { public static void main(String[] args) { JFrame jtfMainFrame = new JFrame("安安"); jtfMainFrame.setSize(300, 250); JButton jbnButton1 = new JButton("Button 1"); JButton jbnButton2 = new JButton("Button 2"); JButton jbnButton3 = new JButton("Button 3"); JButton jbnButton4 = new JButton("Button 4"); JButton jbnButton5 = new JButton("Button 5"); JButton jbnButton6 = new JButton("Button 6"); JButton jbnButton7 = new JButton("Button 7"); JButton jbnButton8 = new JButton("Button 8"); JButton jbnButton9 = new JButton("Button 9"); JTextField jtfInput = new JTextField(20); JPanel jplPanel = new JPanel(); jplPanel.add(jtfInput); jplPanel.add(jbnButton1); jbnButton1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jtfInput.setText("Button 1!"); } }); jplPanel.add(jbnButton2); jbnButton2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jtfInput.setText("Button 2!"); } }); jplPanel.add(jbnButton3); jbnButton3.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jtfInput.setText("Button 3!"); } }); jplPanel.add(jbnButton4); jbnButton4.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jtfInput.setText("Button 4!"); } }); jplPanel.add(jbnButton5); jbnButton5.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jtfInput.setText("Button 5!"); } }); jplPanel.add(jbnButton6); jbnButton6.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jtfInput.setText("Button 6!"); } }); jplPanel.add(jbnButton7); jbnButton7.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jtfInput.setText("Button 7!"); } }); jplPanel.add(jbnButton8); jbnButton8.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jtfInput.setText("Button 8!"); } }); jplPanel.add(jbnButton9); jbnButton9.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jtfInput.setText("Button 9!"); } }); jtfMainFrame.getContentPane().add(jplPanel, BorderLayout.CENTER); jtfMainFrame.setVisible(true); System.out.print("Feng-Chia"); } }156  


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

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");

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

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

<script language="JavaScript">

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

<html>
<head>

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

import java.net.*;

public class TestInet1 {

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

  • Mar 13 Fri 2015 14:39
  • java

/**
* The HelloWorldApp class implements an application that

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

<html>
<head>

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

1.為何why要選修這門課? 沒學過java想學看看

2.希忘從這門課獲得那些知識? 學習寫程式的基礎

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