java课程设计
㈠ 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直接做吧,简单点。
要看到结果,选择题的好看,问题怎么判断。再来个论述题。
把要求写详细点。