當前位置:首頁 » 課程大全 » java課程設計

java課程設計

發布時間: 2020-11-28 22:21:15

㈠ java課程設計

去網站上下載一個,這里沒人能給你寫這么多

㈡ 有沒有Java課程設計的程序啊,難度不要太大,最好還有個word

1、 用圖形用戶界面實現。
2、 能實現編輯、保存、另存為、查找替換等功能。
3、 提示:使用文件輸入輸出流。
import java.awt.*;
import java.awt.event.*;
import java.io.FileReader;
import java.io.FileWriter;
import javax.swing.JFileChooser; import java.awt.*;
import java.awt.event.*;
import java.io.FileReader;
import java.io.FileWriter;
import javax.swing.JFileChooser;
public class TextEditor extends Frame implements ActionListener{
MenuBar mainmenubar=new MenuBar();
Menu file;
MenuItem nw;
MenuItem op;
MenuItem cl;
MenuItem sf;
MenuItem ex;
TextArea tx;
public TextEditor(String title){
super(title);
CloseHandler handler= new CloseHandler();
this.addWindowListener(handler);
setSize(400,400);
setLocationRelativeTo(null);
menuinit();
tx=new TextArea();
this.add(tx);
setVisible(true);
}
void menuinit(){
mainmenubar =new MenuBar();
file=new Menu("File");
nw=new MenuItem("Great");
op=new MenuItem("Open");
cl=new MenuItem("Close");
sf=new MenuItem("save");
ex=new MenuItem("Exit");
file.add(nw);
file.add(op);
file.add(cl);
file.add(sf);
file.add(ex);
mainmenubar.add(file);
setMenuBar(mainmenubar);
nw.addActionListener(this);
op.addActionListener(this);
cl.addActionListener(this);
sf.addActionListener(this);
ex.addActionListener(this);
}
public void actionPerformed(ActionEvent e){
Object ob=e.getSource();
JFileChooser f =new JFileChooser();
if((ob==nw)||(ob==ex)){
tx.setText("write word in here");
}else if(ob==op){
f.showOpenDialog(this);
try{
StringBuffer s=new StringBuffer();
FileReader in=new FileReader(f.getSelectedFile());
while(true){
int b=in.read();
if(b==-1)
break;
s.append((char)b);
}
String myString=s.toString();
char[] mychar=myString.toCharArray();
String unkeyFile =FileEncry(mychar);
tx.setText(unkeyFile.toString());
in.close();
}catch(Exception ee){
}
}else if(ob==sf){
f.showSaveDialog(this);
try{
FileWriter out =new FileWriter(f.getSelectedFile());
String mystr=tx.getText();
char[] strchar=mystr.toCharArray();
String keyFile =FileEncry(strchar);
out.write(keyFile);
out.close();
}catch (Exception ee){
}
}else if(ob==ex)
System.exit(0);
}
public static void main(String[] args){
new TextEditor("Simple TextEdit");
}
public String FileEncry(char[] encry){
StringBuffer str=new StringBuffer();
char[] encry1 =new char[encry.length];
for(int i=0; i<encry.length;i++){
encry1[i]=(char) (encry[i]^'F');
str.append(encry1[i]);
}
return str.toString();
}
}
class CloseHandler extends WindowAdapter{
public void windowClosing(WindowEvent e){
System.exit(0);
}
}

㈢ Java課程設計的介紹

本書以15個課程設計題目為框架,從各個方面介紹了Java在應用系統開發和網路開發中的實用技巧。內各個課程設計題目相容互獨立,可以從任何一個課程設計題目開始閱讀本書。每個課程設計題目都給出了詳細的設計步驟,包括設計內容、總體設計、具體設計、軟體發布、課程設計作業等。本書全部程序代碼可由前言中指定網站下載。

㈣ Java課程設計題目

這個控制台模擬的話很簡單啊,使用switch語句,1-7對應選下,case之後再進行if語句判斷就好了啊,程序模擬的話,自己做一個輸入認證,當做登陸界面,後面的功能選項其實建模之後的模塊而已,分別寫7個pannel,對應控制選項= =。

㈤ 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課程設計 學生成績管理

/**
* 學員管理系統
* 版本號1.0
*/
/**
* 這是一個類,
* 用於演示學員的基本信息操作
* 創建人: csx
* 創建時間:2008年3月25日21:51:27
*/
package com.student.csx;

/**
* 導入相關的包
*/
// 導入載入驅動程序包
import java.sql.DriverManager; // 導入連接包
import java.sql.Connection; // 導入獲得語句包
import java.sql.Statement; // 導入執行語句包
import java.sql.ResultSet; // 導入SQL異常包
import java.sql.SQLException; // 導入SQL異常包
import java.util.Scanner;// 導入接收輸入包

public class Student {
/**
* 構造方法
*/
public Student() {
}

/**
* 這是一個方法 用於顯示用戶需要的菜單
*/
public void meau() {
System.out.println("請選擇功能");
System.out.println("1.查詢學員的基本信息");
System.out.println("2.添加學員的基本信息");
System.out.println("3.刪除學員的基本信息");
System.out.println("4.排序學員的基本信息");
System.out.println("5.修改學員的基本信息");
System.out.println("6.退出使用");
}

/**
* 這是一個方法 用於顯示學員的信息
*/
public void showStudentInfo() {
// 捕獲異常
try {
/**
* 第一步: 載入驅動程序---橋連接
*/
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();// 列印出異常的詳細信息
}
// 捕獲異常
try {
/**
* 第二步: 創建連接
*/
Connection conn = DriverManager.getConnection("jdbc:odbc:student",
"sa", "sa");
/**
* 第三步: 獲取語句對象
*/
Statement stmt = conn.createStatement();
/**
* 第四步: 執行語句
*/
ResultSet rs = stmt.executeQuery("select * from student");
/**
* 第五步: 列印出結果
*/
while (rs.next()) {
System.out.print(rs.getString(1));
System.out.print(rs.getString(2));
System.out.print(rs.getString(3));
System.out.println(rs.getInt(4));
System.out.println(rs.getFloat(5));
}
/**
* 第六步: 釋放資源
*/
rs.close();
stmt.close();
conn.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}

/**
* 這是一個方法 用於添加學員的信息
*/
public void appendStudentInfo() {
// 准備接收輸入
Scanner input = new Scanner(System.in);
/**
* 提示用戶輸入
*/
System.out.println("請輸入姓名:");
/**
* 用於接收用戶輸入的信息
*/
String name = input.nextLine();
/**
* 提示用戶輸入
*/
System.out.println("請輸入學號:");
/**
* 用於接收用戶輸入的信息
*/
String id = input.nextLine();
/**
* 提示用戶輸入
*/
System.out.println("請輸入性別:");
/**
* 用於接收用戶輸入的信息
*/
String sex = input.nextLine();
/**
* 提示用戶輸入
*/
System.out.println("請輸入年齡:");
/**
* 用於接收用戶輸入的信息
*/
int age = input.nextInt();
/**
* 提示用戶輸入
*/
System.out.println("請輸入平均成績:'");
/**
* 用於接收用戶輸入的信息
*/
Float score = input.nextFloat();
/**
* 捕獲異常
*/
try {
/**
* 第一步: 載入驅動程序---橋連接
*/
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
/**
* 第二步:
* 創建連接
*/
Connection conn = DriverManager.getConnection("jdbc:odbc:student",
"sa", "sa");
/**
* 第三步:
* 獲得語句
*/
Statement stmt = conn.createStatement();
/**
* 第四步:
* 執行語句塊
*/
String sql = "insert into student(name,id,sex,age)" + "values('"
+ name + "','" + id + "','" + sex + "'," + age + ",'"
+ score + "')";
/** 執行語句,並返回一個數字(數字是指影響了幾行) */
int updateRow = stmt.executeUpdate(sql);
/** 判斷是否插入成功 */
if (updateRow > 0) {
System.out.println("插入成功");
} else {
System.out.println("插入失敗");
}
/**
* 最後一步:
* 釋放資源
*/
stmt.close();
conn.close();
} catch (Exception e) {
/**
* 列印異常的詳細信息
*/
e.getStackTrace();
}
}

/**
* 這是一個方法 用於刪除學員的信息
*/
public void deleteStudentInfo() {
try {
/**
* 第一步:
* 載入驅動程序
*/
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
//准備接收
Scanner input = new Scanner(System.in);
//創建連接
Connection conn = DriverManager.getConnection("jdbc:odbc:student",
"sa", "sa");
//獲取語句
Statement stmt = conn.createStatement();
//提示用戶輸入
System.out.println("請輸入你要刪除學員的姓名:");
//接收用戶輸入的信息
String name = input.nextLine();
//執行語句
String sql = "delete from student where name = '" + name + "'";
int updateRow = stmt.executeUpdate(sql);
/** 判斷是否刪除成功 */
if (updateRow > 0) {
System.out.println("刪除成功");
} else {
System.out.println("刪除失敗");
}
//釋放資源
stmt.close();
conn.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

/**
* 這是一個方法 用於將學員的信息進行排序
*/
public void compositorStudentInfo() {
// 捕獲異常
try {
/**
* 第一步: 載入驅動程序---橋連接
*/
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();// 列印出異常的詳細信息
}
// 捕獲異常
try {
/**
* 第二步: 創建連接
*/
Connection conn = DriverManager.getConnection("jdbc:odbc:student",
"sa", "sa");
/**
* 第三步: 獲取語句對象
*/
Statement stmt = conn.createStatement();
/**
* 第四步: 執行語句
*/
ResultSet rs = stmt
.executeQuery("select * from student order by age");
/**
* 第五步: 列印出結果
*/
System.out.print("按年齡排序為:\n");
while (rs.next()) {
System.out.print(rs.getString(1));
System.out.print(rs.getString(2));
System.out.print(rs.getString(3));
System.out.println(rs.getInt(4));
System.out.println(rs.getFloat(5));
}
/**
* 第六步: 釋放資源
*/
rs.close();
stmt.close();
conn.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}

/**
* 這是一個方法 用於修改學員的信息
*/

public void amendStudentInfo() {
// 捕獲異常
try {
/**
* 第一步: 載入驅動程序---橋連接
*/
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();// 列印出異常的詳細信息
}
// 捕獲異常
try {
/**
* 第二步: 創建連接
*/
Connection conn = DriverManager.getConnection("jdbc:odbc:student",
"sa", "sa");
/**
* 第三步: 獲取語句對象
*/
Statement stmt = conn.createStatement();
//准備接收輸入
Scanner input = new Scanner(System.in);
//提示用戶輸入
System.out.println("請輸入你要修改的學員的姓名:");
//接收用戶輸入的信息
String name = input.nextLine();
//提示輸入
System.out.println("請輸入你修改後學員的成績");
//接收用戶輸入的信息
Float score = input.nextFloat();
/**
* 第四步: 執行語句
*/
String sql = "update student set score = '" + score
+ "' where name = '" + name + "'";
int updateRow = stmt.executeUpdate(sql);
/** 判斷是否刪除成功 */
if (updateRow > 0) {
System.out.println("修改成功");
} else {
System.out.println("修改失敗");
}
//stmt.close();
//conn.close();

/**
* 第六步: 釋放資源
*/
stmt.close();
conn.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}

}

下面這是一個場景類:

/**
* 這是一個測試類
* 用於測試
* 創建人:CSX * 創建時間:2008年3月25日22:03:10
* 版本號:1.0
*/
//這是一個包
package com.student.csx;
//導入接收包
import java.util.Scanner;

public class Action {
/**
* 這是程序的入口點
* @param args
*/
public static void main(String[] args) {
Student stu = new Student();//聲明一個對象
stu.meau();//調用菜單
int elect;//聲明一個變數,用於接收用戶的選擇
while (true) {
/**准備接收輸入*/
Scanner input = new Scanner(System.in);

//System.out.println("");
/**接收*/
elect = input.nextInt();
//switch分支結構來判斷
switch (elect) {
case 1:
//調用顯示方法
stu.showStudentInfo();
break;
case 2:
//調用添加方法
stu.appendStudentInfo();
break;
case 3:
//調用刪除方法
stu.deleteStudentInfo();
break;
case 4://調用排序方法
stu.compositorStudentInfo();
break;
case 5:
//調用修改方法
stu.amendStudentInfo();
break;
case 6:
//退出使用
System.exit(0);

}
}
}

}

㈦ 老師讓做一個java 課程設計 題目如下:

這估計不是一時半刻的課程,你們老師也真夠狠的,不過我可以提供思路給你,你也可以找你們那些會做的同學一起討論!

1、自動偵測區域網內部的用戶可以這樣子做,根據本機在區域網內的IP段,試圖去socket每個IP的固定埠,每個軟體都設置一個Seversocket用循環一直等待著access。

2、私聊和群聊是統一的,只需通過在發送時判斷發一還是發多的問題。

3、文件的傳送也是簡單,只需在兩端用相同的讀寫方式既可,我認為不妨就用二進制輸入輸出流。

4、界面的話是個苦力活,你可以模仿QQ的界面,把QQ秀的地方變成用戶列表,其他可以保持不變!

㈧ Java課程設計問題

郵件已發送,請查收。
1.:

public class Matrix {
int i[][];
Matrix(){//構造一個10X10個元素的矩陣,沒有數據
i=new int[10][10];
}
Matrix(int n,int m){//構造一個n*m個元素的矩陣,數據由隨機數產生
i=new int[n][m];
for(int j=0;j<=n-1;j++){
for(int k=0;k<=m-1;k++)
i[j][k]=(int) (Math.random()*10);
}
}
Matrix(int table[][]){//以一個整型的二維數組構造一個矩陣
i=table;
}

public void output(){//輸出Matrix類中數組的元素值
for(int j=0;j<=i.length-1;j++){
for(int k=0;k<=i[0].length-1;k++)
System.out.print(i[j][k]+" ");
System.out.println();
}
}
public void transpose(){//輸出一個矩陣的轉置矩陣
for(int j=0;j<=i[0].length-1;j++){
for(int k=0;k<=i.length-1;k++)
System.out.print(i[k][j]+" ");
System.out.println();
}
}
public static void main(String args[]){
Matrix m=new Matrix(4,5);
m.output();
System.out.println();
m.transpose();
Square s=new Square(5);
s.output();
System.out.println();
s.transpose();
}

}

public class Square extends Matrix{
Square(){
i=new int[10][10];
}
Square(int b){
super(b,b);
}
Square(int table[][]){
if(table.length==table[0].length)
i=table;
}

}

2:

public class Complex {
int x,y;
Complex(){}
Complex(int i,int j){
x=i;
y=j;
}
public void showComp(){
if(y>=0)
System.out.println(x+"+"+y+"i");
else
System.out.println(x+""+y+"i");
}
public Complex addComp(Complex C1,Complex C2){
return new Complex(C1.x+C2.x,C1.y+C2.y);
}
public Complex subComp(Complex C1,Complex C2){
return new Complex(C1.x-C2.x,C1.y-C2.y);
}
public Complex multiComp(Complex C1,Complex C2){
return new Complex(C1.x*C2.x-C1.y*C2.y,C1.x*C2.y+C2.x*C1.y);
}
public boolean equalComp(Complex C1,Complex C2){
return C1.x==C2.x&&C1.y==C2.y;
}
public static void main(String args[]){
Complex c=new Complex(1,2);
c.showComp();
c.addComp(new Complex(-1,3), new Complex(3,-3)).showComp();
c.subComp(new Complex(-1,3), new Complex(3,-3)).showComp();
c.multiComp(new Complex(-1,3), new Complex(3,-3)).showComp();
System.out.println(c.equalComp(new Complex(-1,3), new Complex(3,-3)));
System.out.println(c.equalComp(new Complex(3,-3), new Complex(3,-3)));
}

}

3.:

import java.awt.BorderLayout;
import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class LayoutManager {
public static void main(String args[]){
JFrame jf=new JFrame();
JButton jbA=new JButton("Hello,");
JButton jbB=new JButton("取消");
JButton jbC=new JButton("確定");
JButton jbD=new JButton("Java!......");
JButton jb0=new JButton("0");
JButton jb1=new JButton("1");
JButton jb2=new JButton("2");
JButton jb3=new JButton("3");
JButton jb4=new JButton("4");
JButton jb5=new JButton("5");
JButton jb6=new JButton("6");
JButton jb7=new JButton("7");
JButton jb8=new JButton("8");

JPanel jp=new JPanel();
jp.setLayout(new GridLayout(0,3));
jp.add(jb0);
jp.add(jb1);
jp.add(jb2);
jp.add(jb3);
jp.add(jb4);
jp.add(jb5);
jp.add(jb6);
jp.add(jb7);
jp.add(jb8);

jf.add(jbA,BorderLayout.NORTH);
jf.add(jbB,BorderLayout.WEST);
jf.add(jbC,BorderLayout.EAST);
jf.add(jbD,BorderLayout.SOUTH);
jf.add(jp,BorderLayout.CENTER);

jf.setTitle("布局管理器");
jf.setSize(300, 300);
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jf.setVisible(true);
}

}

㈨ Java課程設計

感覺不是特別麻煩。
文件系統是什麼?就是讀取個特殊文件嗎?要解碼?
界面建議你就用windowbuilder直接做吧,簡單點。
要看到結果,選擇題的好看,問題怎麼判斷。再來個論述題。
把要求寫詳細點。

熱點內容
武漢大學學生會輔導員寄語 發布:2021-03-16 21:44:16 瀏覽:612
七年級學生作文輔導學案 發布:2021-03-16 21:42:09 瀏覽:1
不屑弟高考成績 發布:2021-03-16 21:40:59 瀏覽:754
大學畢業證會有成績單 發布:2021-03-16 21:40:07 瀏覽:756
2017信陽學院輔導員招聘名單 發布:2021-03-16 21:40:02 瀏覽:800
查詢重慶2018中考成績查詢 發布:2021-03-16 21:39:58 瀏覽:21
結業考試成績怎麼查詢 發布:2021-03-16 21:28:40 瀏覽:679
14中醫醫師資格筆試考試成績查分 發布:2021-03-16 21:28:39 瀏覽:655
名著賞析課程標准 發布:2021-03-16 21:27:57 瀏覽:881
北京大學商業領袖高端培訓課程 發布:2021-03-16 21:27:41 瀏覽:919