java软件开发课程设计
『壹』 java课程设计源代码(急!!!!)
import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.SwingConstants;
import javax.swing.border.LineBorder;
public class game21 extends JFrame {
private JLabel label_2;
private int number;
private int sum;
final JLabel label = new JLabel();
final JLabel label_1 = new JLabel();
public static void main(String[] args) {
new game21();
}
public game21() {
super("21点?!");
getContentPane().setLayout(null);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
final JButton button = new JButton();
button.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent arg0) {
onClick();
}
});
button.setText("出牌");
button.setBounds(170, 350, 106, 28);
getContentPane().add(button);
label.setBorder(new LineBorder(Color.black, 1, false));
label.setHorizontalAlignment(SwingConstants.CENTER);
label.setFont(new Font("", Font.BOLD, 26));
label.setText("背面");
label.setBounds(158, 81, 137, 153);
getContentPane().add(label);
label_1.setText("你已经拥有的牌:");
label_1.setBounds(109, 22, 270, 45);
getContentPane().add(label_1);
this.setBounds(200, 300, 501, 528);
this.setVisible(true);
getContentPane().add(getLabel_2());
}
public int randNumber() {
try {
Thread.sleep(10);
} catch (InterruptedException e) {
e.printStackTrace();
}
return (int) (Math.random() * 10 + 1);
}
public void onClick() {
number = this.randNumber();
this.sum += number;
label.setText("" + number);
String strTemp = this.label_1.getText();
strTemp += "" + number + " ";
label_1.setText(strTemp);
String temp = "合计:" + sum;
label_2.setText(temp);
isWin();
}
public void isWin() {
if (sum > 21) {
JOptionPane.showMessageDialog(this, "你输了");
clear();
return;
} else if (sum == 21) {
JOptionPane.showMessageDialog(this, "你赢了");
clear();
return;
} else {
int i = JOptionPane.showOptionDialog(this, "是否继续?", "提示",
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.INFORMATION_MESSAGE, null, null, null);
if (i == JOptionPane.OK_OPTION) {
onClick();
} else
return;
}
}
private void clear() {
label_2.setText("合计:");
sum = 0;
number = 0;
label_1.setText("你已经拥有的牌:");
}
/**
* @return
*/
protected JLabel getLabel_2() {
if (label_2 == null) {
label_2 = new JLabel();
label_2.setText("合计:");
label_2.setBounds(313, 35, 66, 18);
}
return label_2;
}
}
真好无聊中。。
『贰』 求一份软件工程课程设计,用java编写。
开个价;一般上班的都没时间帮你写
『叁』 《JAVA程序设计》结课设计
你应该问一些技术上的问题,而不是让别人帮你做作业
『肆』 《JAVA程序设计》课程设计
1 package study.part02;
2 import java.util.Calendar;
3 import java.awt.*;
4 import javax.swing.*;
5 import java.awt.event.*;
6 import java.lang.Thread;
7 public class Clock extends JFrame implements ComponentListener,
8 ItemListener,Runnable{
9 Thread timer;
10 private JComboBox combobox_color;
11 public void start(){
12 if(timer==null)
13 timer=new Thread(this,"ShowTime");
14 timer.start();
15 }
16 public void run(){
17 while(true){
18 try{
19 timer.sleep(1000);
20 }catch(InterruptedException e){}
21 repaint();
22 }
23 }
24 public void stop(){
25 timer.stop();
26 }
27 public Clock(){
28 super("Clock");
29 this.setSize(600,600);
30 this.setDefaultCloseOperation(EXIT_ON_CLOSE);
31 this.setLayout(new FlowLayout());
32
33 this.setVisible(true);
34 }
35 public void paint(Graphics g){
36 Calendar cal=Calendar.getInstance();
37 int year=cal.get(Calendar.YEAR);
38 int month=cal.get(Calendar.MONTH);
39 int day=cal.get(Calendar.DATE);
40 int hour=cal.get(Calendar.HOUR);
41 int minute=cal.get(Calendar.MINUTE);
42 int second=cal.get(Calendar.SECOND);
43 int a,b;
44 a=this.getWidth()/2;
45 for(int i=1;i<=360;i++){
46 double angle=i*Math.PI/180;
47 double radius=a-50;
48 int x=(int)Math.round(radius*Math.sin(angle));
49 int y=(int)Math.round(radius*Math.cos(angle));
50 if(i%30==0){
51 int j=i/30;
52 String str=String.valueOf(j);
53 g.setColor(Color.black);
54 // g.fillOval(a+x,a+y,1,1);
55 g.drawString(str,a+x,a-y);
56 }
57 double radh=a-200;
58 angle=hour*Math.PI/30;
59 int xh=(int)Math.round(radh*Math.sin(angle));
60 int yh=(int)Math.round(radh*Math.cos(angle));
61 g.setColor(Color.red);
62 g.drawLine(a,a,a+xh,a-yh);
63 double radm=a-150;
64 angle=minute*Math.PI/30;
65 int xm=(int)Math.round(radm*Math.sin(angle));
66 int ym=(int)Math.round(radm*Math.cos(angle));
67 g.setColor(Color.blue);
68 g.drawLine(a,a,a+xm,a-ym);
69 double rads=a-100;
70 angle=second*Math.PI/30;
71 int xs=(int)Math.round(rads*Math.sin(angle));
72 int ys=(int)Math.round(rads*Math.cos(angle));
73 g.setColor(Color.yellow);
74 g.drawLine(a,a,a+xs,a-ys);
75 //g.drawString(cal.get(Calendar.HOUR)+":"+cal.get(Calendar.
76 // MINUTE)+":"+cal.get(Calendar.SECOND));
77 }
78 }
79 public void itemStateChanged(ItemEvent e){
80 repaint();
81 }
82 public void componentResized(ComponentEvent e){
83 repaint();
84 }
85 public void componentMoved(ComponentEvent e){}
86 public void componentHidden(ComponentEvent e){}
87 public void componentShown(ComponentEvent e){}
88
89 public static void main(String[] args){
90 Clock show=new Clock();
91 show.start();
92 }
93 }
『伍』 Java课程设计的介绍
本书以15个课程设计题目为框架,从各个方面介绍了Java在应用系统开发和网络开发中的实用技巧。内各个课程设计题目相容互独立,可以从任何一个课程设计题目开始阅读本书。每个课程设计题目都给出了详细的设计步骤,包括设计内容、总体设计、具体设计、软件发布、课程设计作业等。本书全部程序代码可由前言中指定网站下载。
『陆』 Java课程设计,毕业设计怎么做
可以用它做一个网站当毕业设计,需要的可以私聊我
『柒』 java课程设计要求:编写一个简单的画图应用程序
JAVA gui
没人会帮你全部写出来的,自己去写
『捌』 java课程设计
根据网上的资料,自己改吧改吧就好专了。属
http://wenku..com/link?url=d6T6qVFsQ9I4HSpdbTK0WjDBQV0_BGU5sJCVeMl3kQ_-Cy3_mowAB9e8T6t0VRY_xwFtIRhzu