- 博客(0)
- 资源 (8)
空空如也
java项目之教务管理系统
package cn.com.edu.view.frame;
import java.awt.AWTException;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Dimension;
import java.awt.GridBagLayout;
import java.awt.MenuItem;
import java.awt.PopupMenu;
import java.awt.SystemTray;
import java.awt.Toolkit;
import java.awt.TrayIcon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.JToolBar;
import org.jvnet.substance.SubstanceLookAndFeel;
import org.jvnet.substance.skin.FindingNemoSkin;
import cn.com.edu.action.JMenuItemAction;
import cn.com.edu.action.MainFrameAction;
import cn.com.edu.util.GBC;
import cn.com.edu.view.panel.AddStudentInfoPanel;
import cn.com.edu.view.panel.FindStudentInfoPanel;
/**
* 教务管理系统主界面
*
* @author Administrator
*
*/
public class MainFrame extends JFrame {
private static MainFrame instance;
private JMenuBar bar;// 菜单条
private JMenu studentJMenu;// 菜单
private JMenu teacherJMenu;// 菜单
private JPanel center = new JPanel();// 中心面板用来放置卡片
private CardLayout card = new CardLayout();// 卡片布局
private JPanel west;// 西边面板
private JSplitPane split;// 分割面板
private JToolBar tool;// 工具条
private MainFrameAction action = new MainFrameAction(this);// 按钮事件对象
private JMenuItemAction menuItemAction = new JMenuItemAction(this);// 菜单事件对象
private SystemTray tray;// 系统托盘
private TrayIcon trayIcon;// 设置系统托盘的图片
/**
* 使用单子设计模式主界面对象
*
*/
private MainFrame() {
init();
}
public static MainFrame getInstance() {
if (instance == null) {
instance = new MainFrame();
}
return instance;
}
/**
* 初始化主界面
*
*/
public void init() {
// 设置标题
this.setTitle("教务管理系统");
// 设置标题图片
ImageIcon icon = new ImageIcon("img/switchuser.png");
this.setIconImage(icon.getImage());
// 得到屏幕对象
Dimension size = Toolkit.getDefaultToolkit().getScreenSize();
// 设置主界面大小
this.setSize(size.width, size.height - 20);
// 设置居中
this.setLocationRelativeTo(null);
// 添加工具条
this.add(createTool(), BorderLayout.NORTH);
// 将菜单添加到主界面
this.setJMenuBar(createJMenuBar());
// 将卡片添加到主界面
center.setLayout(card);
addCardPanel(center);
this.add(createSplit());
// 设置关闭主界面
this.setDefaultCloseOperation(this.DO_NOTHING_ON_CLOSE);
//创建系统托盘
createSystemTray();
//关闭窗口事件
closeWindow(this);
// 设置显示主界面
this.setVisible(true);
}
public JMenuBar createJMenuBar() {
if (bar == null) {
bar = new JMenuBar();
studentJMenu = createJMenu("学生管理");
teacherJMenu = createJMenu("老师管理");
addJMenuItem(studentJMenu, "添加学生信息");
addJMenuItem(studentJMenu, "查询学生信息");
addJMenuItem(studentJMenu, "修改学生信息");
addJMenuItem(studentJMenu, "删除学生信息");
studentJMenu.addSeparator();
addJMenuItem(studentJMenu, "退出");
bar.add(studentJMenu);
bar.add(teacherJMenu);
}
return bar;
}
/**
* 创建菜单
*
* @param name
* @return
*/
private JMenu createJMenu(String name) {
JMenu menu = new JMenu(name);
return menu;
}
/**
* 将创建的菜单项添加到菜单
*
* @param menu
* @param name
*/
private void addJMenuItem(JMenu menu, String name) {
JMenuItem item = new JMenuItem(name);
item.addActionListener(menuItemAction);
menu.add(item);
}
/**
* 用于添加卡片
*
* @param center
*/
public void addCardPanel(JPanel center) {
JPanel jp2 = new JPanel();
JPanel jp3 = new JPanel();
JPanel jp4 = new JPanel();
jp2.add(new JButton("卡片2"));
jp3.add(new JButton("卡片3"));
jp4.add(new JButton("卡片4"));
center.add(new AddStudentInfoPanel(), "添加学生信息");
center.add(new FindStudentInfoPanel(), "查询学生信息");
center.add(jp3, "修改学生信息");
center.add(jp4, "删除学生信息");
}
/**
* 创建西边面板,用添加选项按钮
*
* @return
*/
public JPanel createWestPanel() {
if (west == null) {
west = new JPanel();
west.setLayout(new GridBagLayout());
west.add(createButton("添加学生信息", "img/switchuser.png"),
new GBC(0, 0).setInset(10));
west.add(createButton("查询学生信息", "img/switchuser.png"),
new GBC(0, 1).setInset(10));
west.add(createButton("修改学生信息", "img/switchuser.png"),
new GBC(0, 2).setInset(10));
west.add(createButton("删除学生信息", "img/switchuser.png"),
new GBC(0, 3).setInset(10));
}
return west;
}
/**
* 创建按钮方法
*
* @param name
* @return
*/
public JButton createButton(String name, String icon) {
JButton button = new JButton(name);
button.setIcon(new ImageIcon(icon));
button.addActionListener(action);
return button;
}
public CardLayout getCard() {
return card;
}
public JPanel getCenter() {
return center;
}
/**
* 分割面板
*
* @return
*/
public JSplitPane createSplit() {
if (split == null) {
split = new JSplitPane();
split.setOneTouchExpandable(true);
split.setLeftComponent(createWestPanel());
split.setRightComponent(center);
}
return split;
}
/**
* 创建工具条
*
* @return
*/
public JToolBar createTool() {
if (tool == null) {
tool = new JToolBar();
tool.add("添加学生信息", createButton("添加学生信息", "img/switchuser.png"));
tool.add("查询学生信息", createButton("查询学生信息", "img/switchuser.png"));
tool.add("修改学生信息", createButton("修改学生信息", "img/switchuser.png"));
tool.add("删除学生信息", createButton("删除学生信息", "img/switchuser.png"));
tool.add("帮助", createButton("帮助", "img/syssetup.png"));
}
return tool;
}
///////////////////////////系统托盘设置/////////////////////////////////////
/**
* 窗口事件
*
* @param jframe
*/
public void closeWindow(MainFrame jframe) {
jframe.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
int show = JOptionPane.showConfirmDialog(null, "是否确定关闭?",
"确认关闭系统", JOptionPane.YES_NO_OPTION);
if (show == JOptionPane.YES_OPTION) {
System.exit(0);
}
}
public void windowIconified(WindowEvent e) {
if (getState() == 1) {// 最小化
try {
tray.add(trayIcon);
} catch (AWTException e1) {
e1.printStackTrace();
}
setVisible(false);
}
}
});
}
/**
* 创建系统托盘
*
*/
public void createSystemTray() {
// 得到当前系统的托盘对象
tray = SystemTray.getSystemTray();
ImageIcon icon = new ImageIcon("img/2.png");
// 添加鼠标右键 弹出菜单
PopupMenu menu = new PopupMenu();
MenuItem show = new MenuItem("显示窗体");
MenuItem exit = new MenuItem("退出窗体");
trayIcon = new TrayIcon(icon.getImage(), "学生管理系统", menu);
trayIcon.addMouseListener(new MouseAdapter() {
/**
* 鼠标点击事件
*/
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2) {// 鼠标双击
tray.remove(trayIcon);
setVisible(true);
// 设置窗口全屏
setExtendedState(JFrame.MAXIMIZED_BOTH);
}
}
});
/**
*鼠标右键显示窗体
*/
show.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
tray.remove(trayIcon);
setVisible(true);
// 设置窗口全屏
setExtendedState(JFrame.MAXIMIZED_BOTH);
}
});
/**
* 鼠标右键关闭窗体
*/
exit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
int show = JOptionPane.showConfirmDialog(null, "是否确定关闭?",
"确认关闭系统", JOptionPane.YES_NO_OPTION);
if (show == JOptionPane.YES_OPTION) {
System.exit(0);
}
}
});
menu.add(show);
menu.add(exit);
}
/**
* @param args
*/
public static void main(String[] args) {
SubstanceLookAndFeel.setSkin(new FindingNemoSkin());
// 蓝色幽灵
// SubstanceLookAndFeel.setSkin(new OfficeBlue2007Skin());
// 麦田风光
// SubstanceLookAndFeel.setSkin(new FieldOfWheatSkin());
// 默认皮肤
// SubstanceLookAndFeel.setSkin(new BusinessSkin());
// 朦胧风格
// SubstanceLookAndFeel.setSkin(new MistAquaSkin());
MainFrame.getInstance();
}
}
2010-07-29
java项目之学生信息管理系统
package cn.com.dao.chivementdao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import cn.com.util.DBConnection;
import cn.com.util.DBSql;
import cn.com.vo.chivementvo.ChivementVo;
public class ExamDao {
private Connection conn = DBConnection.getConnectionOracle();
private ChivementVo examVo;
public ExamDao() {
}
public ExamDao(ChivementVo examVo) {
super();
this.examVo = examVo;
}
/**
* 全部查询
*/
public Object[][] selectAll() {
Object date[][] = null;
int max = 0;
int i = 0;
PreparedStatement ps = null;
ResultSet rs = null;
try {
ps = conn.prepareStatement(DBSql.SELECT_ALL);
rs = ps.executeQuery();
// 得到列数
max = rs.getMetaData().getColumnCount();
date = new Object[getnumberAll(DBSql.SELECT_ALL_COUNT)][max];
while (rs.next()) {
for (int j = 0; j < max; j++) {
date[i][j] = rs.getObject(j + 1);
}
i++;
}
// rs.close();
// ps.close();
// conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
return date;
}
/**
* 根据学号查询
*/
public Object[][] selectBySid() {
Object date[][] = null;
int max = 0;
int i = 0;
PreparedStatement ps = null;
ResultSet rs = null;
try {
ps = conn.prepareStatement(DBSql.SELECT_BY_S_ID);
ps.setInt(1, examVo.getS_id());
rs = ps.executeQuery();
// 得到列数
max = rs.getMetaData().getColumnCount();
date = new Object[getnumber(DBSql.SELECT_BY_S_ID_COUNT, examVo
.getS_id())][max];
while (rs.next()) {
for (int j = 0; j < max; j++) {
date[i][j] = rs.getObject(j + 1);
}
i++;
}
// rs.close();
// ps.close();
// conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
return date;
}
/**
* 根据组号查询
*/
public Object[][] selectByGid() {
Object date[][] = null;
int max = 0;
int i = 0;
PreparedStatement ps = null;
ResultSet rs = null;
try {
ps = conn.prepareStatement(DBSql.SELECT_BY_G_ID);
ps.setInt(1, examVo.getG_id());
rs = ps.executeQuery();
// 得到列数
max = rs.getMetaData().getColumnCount();
date = new Object[getnumber(DBSql.SELECT_BY_G_ID_COUNT, examVo
.getG_id())][max];
while (rs.next()) {
for (int j = 0; j < max; j++) {
date[i][j] = rs.getObject(j + 1);
}
i++;
}
// rs.close();
// ps.close();
// conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
return date;
}
/**
* 根据课程号查询
*/
public Object[][] selectByCid() {
Object date[][] = null;
int max = 0;
int i = 0;
PreparedStatement ps = null;
ResultSet rs = null;
try {
ps = conn.prepareStatement(DBSql.SELECT_BY_C_ID);
ps.setInt(1, examVo.getC_id());
rs = ps.executeQuery();
// 得到列数
max = rs.getMetaData().getColumnCount();
date = new Object[getnumber(DBSql.SELECT_BY_C_ID_COUNT, examVo
.getC_id())][max];
while (rs.next()) {
for (int j = 0; j < max; j++) {
// System.out.println( examVo.getG_id());
date[i][j] = rs.getObject(j+1);
}
i++;
}
// rs.close();
// ps.close();
// conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
return date;
}
/**
* 根据姓名模糊查询
*
* @return
*/
public Object[][] selectByName() {
Object date[][] = null;
int max = 0;
int i = 0;
PreparedStatement ps = null;
ResultSet rs = null;
try {
ps = conn.prepareStatement(DBSql.SELECT_BY_S_NAME);
ps.setString(1, examVo.getS_name());
ps.setString(2, "%" + examVo.getS_name() + "%");
ps.setString(3, "%" + examVo.getS_name());
ps.setString(4, examVo.getS_name() + "%");
rs = ps.executeQuery();
// 得到列数
max = rs.getMetaData().getColumnCount();
date = new Object[getnumberByName(DBSql.SELECT_BY_S_NAME_COUNT,
examVo.getS_name())][max];
while (rs.next()) {
for (int j = 0; j < max; j++) {
date[i][j] = rs.getObject(j + 1);
}
i++;
}
} catch (SQLException e) {
e.printStackTrace();
}
return date;
}
/**
* 根据课程名称模糊查询
*
* @return
*/
public Object[][] selectByClassName() {
Object date[][] = null;
int max = 0;
int i = 0;
PreparedStatement ps = null;
ResultSet rs = null;
try {
ps = conn.prepareStatement(DBSql.SELECT_BY_CLASS_NAME);
ps.setString(1, examVo.getClass_name());
ps.setString(2, "%" + examVo.getClass_name() + "%");
ps.setString(3, "%" + examVo.getClass_name());
ps.setString(4, examVo.getClass_name() + "%");
rs = ps.executeQuery();
// 得到列数
max = rs.getMetaData().getColumnCount();
date = new Object[getnumberByName(DBSql.SELECT_BY_CLASS_COUNT,
examVo.getClass_name())][max];
while (rs.next()) {
for (int j = 0; j < max; j++) {
date[i][j] = rs.getObject(j + 1);
}
i++;
}
} catch (SQLException e) {
e.printStackTrace();
}
return date;
}
/**
* 修改选中学生的成绩
*
*/
public void updatSelectClass() {
PreparedStatement ps = null;
ResultSet rs = null;
try {
ps = conn.prepareStatement(DBSql.UPDATE_EXAM_BY_STUID);
ps.setInt(1, examVo.getClassExamChivement());
ps.setInt(2, examVo.getS_id());
ps.setInt(3, examVo.getC_id());
ps.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
}
}
/**
* 得到所有课程号和课程名
*
* @return
*/
public String[] getClassNoName() {
String[] classNoName = null;
PreparedStatement ps = null;
ResultSet rs = null;
int j = 0;
try {
int i = getnumberAll(DBSql.SELECT_CLASS_NAME_COUNT);
classNoName = new String[i + i];
ps = conn.prepareStatement(DBSql.SELECT_CLASS_NAME);
rs = ps.executeQuery();
while (rs.next()) {
classNoName[j] = rs.getString(1);
classNoName[j + i] = rs.getString(2);
j++;
}
} catch (SQLException e) {
e.printStackTrace();
}
return classNoName;
}
/**
* 根据科目修改成绩 查询学号 姓名 成绩
*
*/
public void SelectClassStuName() {
int i = 0;
PreparedStatement ps = null;
ResultSet rs = null;
int j = getnumberBySelectClassName(
DBSql.SELECT_CLASS_STU_SNO_SNAME_EXAM_COUNT, examVo.getC_id());
int[] sNum = new int[j];
String[] sName = new String[j];
int[] classExam = new int[j];
try {
ps = conn.prepareStatement(DBSql.SELECT_CLASS_STU_SNO_SNAME_EXAM);
ps.setInt(1, examVo.getC_id());
rs = ps.executeQuery();
while (rs.next()) {
sNum[i] = rs.getInt(1);
sName[i] = rs.getString(2);
classExam[i] = rs.getInt(3);
i++;
}
} catch (SQLException e) {
e.printStackTrace();
}
examVo.setSid(sNum);
examVo.setSname(sName);
examVo.setClassExam(classExam);
}
/**
* 根据科目修改成绩 查询学号 姓名 成绩 后修改成绩
*
*/
public void UpdateClassStuName() {
// int i = 0;
PreparedStatement ps = null;
ResultSet rs = null;
int j = getnumberBySelectClassName(
DBSql.SELECT_CLASS_STU_SNO_SNAME_EXAM_COUNT, examVo.getC_id());
try {
ps = conn.prepareStatement(DBSql.UPDATE_CHIVEMENT_BY_CLASS);
for(int i =0;i<j;i++){
ps.setInt(1, examVo.getClassExam()[i]);
ps.setInt(2, examVo.getSid()[i]);
ps.setInt(3, examVo.getC_id());
ps.executeUpdate();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
/**
* 全部查询获得行数
*
* @return
*/
public int getnumberAll(String str) {
int number = 0;
PreparedStatement ps = null;
ResultSet rs = null;
try {
ps = conn.prepareStatement(str);
rs = ps.executeQuery();
rs.next();
number = rs.getInt(1);
// rs.close();
// ps.close();
// conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
return number;
}
/**
* 根据学号 根据组号 根据课程号查询 获得行数
*
* @return
*/
public int getnumber(String str, int i) {
int number = 0;
PreparedStatement ps = null;
ResultSet rs = null;
try {
ps = conn.prepareStatement(str);
ps.setInt(1, i);
rs = ps.executeQuery();
rs.next();
number = rs.getInt(1);
// rs.close();
// ps.close();
// conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
return number;
}
/**
* 根据姓名 课程名 查询 获得行数
*
*/
public int getnumberByName(String str, String i) {
int number = 0;
PreparedStatement ps = null;
ResultSet rs = null;
try {
ps = conn.prepareStatement(str);
ps.setString(1, i);
ps.setString(2, "%" + i + "%");
ps.setString(3, "%" + i);
ps.setString(4, i + "%");
rs = ps.executeQuery();
rs.next();
number = rs.getInt(1);
} catch (SQLException e) {
e.printStackTrace();
}
return number;
}
// /**
// * 根据课程名查询 获得行数
// *
// */
//
// public int getnumberByClassName(String str, String i) {
// int number = 0;
// PreparedStatement ps = null;
// ResultSet rs = null;
// try {
// ps = conn.prepareStatement(str);
// ps.setString(1, i);
// ps.setString(2, "%" + i + "%");
// ps.setString(3, "%" + i);
// ps.setString(4, i + "%");
// rs = ps.executeQuery();
// rs.next();
// number = rs.getInt(1);
// } catch (SQLException e) {
// e.printStackTrace();
// }
// return number;
// }
/**
*
* 根据课程名修改成绩获得行数
*
* @param str
* @param i
* @return
*/
public int getnumberBySelectClassName(String str, int i) {
int number = 0;
PreparedStatement ps = null;
ResultSet rs = null;
try {
ps = conn.prepareStatement(str);
ps.setInt(1, i);
rs = ps.executeQuery();
rs.next();
number = rs.getInt(1);
} catch (SQLException e) {
e.printStackTrace();
}
return number;
}
}
2010-07-29
struts2入门及提高
Struts2的拦截器
Struts2整合JSF
Struts2整合Ajax
Struts2的国际化(Internationalization)
Struts2标签库
Struts2整合Hibernate及Spring
2010-07-29
史上最全Java面试题目大集合
整理了网上的一些java面试题目,很全很强大
面向对象的特征有哪些方面
1. 抽象:抽象就是忽略一个主题中与当前目标2. 无关的那些方面,3. 以便更充分地注意与当前目标4. 有关的方面。抽象并不5. 打算了解全部问题,而6. 只是选择其中的一部分,7. 暂时不 8. 用部分细节。抽象包括两个方面,9. 一是过程抽象,10. 二是数据抽象。
11. 继承:继承是一种联结类的层次模型,12. 并且允许和鼓励类的重用,13. 它提供了一种明确表述共性的方法。对象的一个新类可以从现有的类中派生,14. 这个过程称为类继承。新类继承了原始类的特性,15. 新类称为原始类的派生类(子类),而16. 原始类称为新类的基类(父类)。派生类可以从它的基类那里继承方法和实例变量,17. 并且类可以修改或增加新的方法使之更适合特殊的需要。
18. 封装:封装是把过程和数据包围起来,19. 对数据的访问只能通过已定义的界面。面向对象计算始于这个基本概念,20. 即现实世界可以被描绘成一系列完全自治、封装的对象,21. 这些对象通过一个受保护的接口访问其他对象。
22. 多态性:多态性是指23. 允许不同24. 类的对象对同25. 一消息作出响应。多态性包括参数化多态性和包含多态性。多态性语言具有灵活、抽象、行为共享、代码共享的优势,26. 很好的解决了应用程序函数同27. 名28. 问题。
2、String是最基本的数据类型吗?
基本数据类型包括byte、int、char、long、float、double、boolean和short。
java.lang.String类是final类型的,因此不可以继承这个类、不能修改这个类。为了提高效率节省空间,我们应该用StringBuffer类
3、int 和 Integer 有什么区别
Java 提供两种不同的类型:引用类型和原始类型(或内置类型)。Int是java的原始数据类型,Integer是java为int提供的封装类。Java为每个原始类型提供了封装类。
原始类型封装类booleanBoolean charCharacter byteByte shortShort intInteger longLong floatFloat doubleDouble
引用类型和原始类型的行为完全不同,并且它们具有不同的语义。引用类型和原始类型具有不同的特征和用法,它们包括:大小和速度问题,这种类型以哪种类型的数据结构存储,当引用类型和原始类型用作某个类的实例数据时所指定的缺省值。对象引用实例变量的缺省值为 null,而原始类型实例变量的缺省值与它们的类型有关。
4、String 和StringBuffer的区别
JAVA平台提供了两个类:String和StringBuffer,它们可以储存和操作字符串,即包含多个字符的字符数据。这个String类提供了数值不可改变的字符串。而这个StringBuffer类提供的字符串进行修改。当你知道字符数据要改变的时候你就可以使用StringBuffer。典型地,你可以使用 StringBuffers来动态构造字符数据。
2010-06-04
Java面试基础测试题及答案
4、 Java的核心机制是什么?并介绍其核心机制
1、JVM和GC
2、Jvm:在一台计算机上由软件或者硬件模拟的计算机(读取字节码代码的Cpu)。Java虚拟机(JVM)读取并处理经编译过的平台无关的字节码(class)文件;java编译器针对JVM产生的class文件,因此是独立于平台的;java解释器负责将java虚拟机的代码在特定的平台上运行
3、GC:不再使用的内存空间应该回收----垃圾收集;在C和C++等语言中,是由程序员自己回收垃圾释放内存的;java语言解除了程序员自己亲自回收内存空间的责任。它提供一种系统级线程跟踪内存的分配情况。并在JVM的空闲时,检查并释放无用的内存空间。垃圾收集在程序运行的过程中自动进行,程序员无法控制和干涉
2010-05-23
java项目之餐饮管理系统
java项目package project.action.dialogAction;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JOptionPane;
import project.dao.common.DbException;
import project.dao.dataDao.LoginInfoDao;
import project.dao.dataDaoImpl.LoginInfoDaoImpl;
import project.view.dialog.AddLoginInfoDialog;
import project.vo.LoginInfoVo;
/**
* 添加登录账号action
*
* @author Administrator
*
*/
public class AddLoginInfoAction implements ActionListener {
private AddLoginInfoDialog dialog;
public AddLoginInfoAction(AddLoginInfoDialog dialog) {
this.dialog = dialog;
}
public void actionPerformed(ActionEvent e) {
String name = e.getActionCommand();
if (name.equals("确定")) {
// 检验输入是否正确
if (dialog.checkInputValue()) {
LoginInfoDao dao = null;
LoginInfoVo vo = null;
try {
// 获得界面输入信息
vo = dialog.getInputInfo();
String confirm = dialog.getConfirm();
if (vo.getLog_pwd().equals(confirm)) {
dao = new LoginInfoDaoImpl();
if (dao.insertLoginInfo(vo)) {
// 打印提示信息
JOptionPane.showMessageDialog(null, "添加登录人员成功", "提示信息",
JOptionPane.YES_OPTION);
dialog.dispose();
} else {
// 打印提示信息
JOptionPane.showMessageDialog(null, "添加登录人员失败", "提示信息",
JOptionPane.YES_OPTION);
}
} else {
// 如果密码确认输入错误,打印提示信息
JOptionPane.showMessageDialog(null, "密码确认错误,请重新输入", "提示信息",
JOptionPane.YES_OPTION);
}
} catch (DbException ex) {
JOptionPane.showMessageDialog(null, ex.getMessage(), "提示信息",
JOptionPane.YES_OPTION);
}
} else {
JOptionPane.showMessageDialog(null, "请确认输入是否完整正确", "提示信息",
JOptionPane.YES_OPTION);
}
} else if (name.equals("取消")) {
dialog.dispose();
}
}
}
2010-05-23
J2EE项目之网络视频UML图
个人日志编辑
注册用户拥有一个日志空间,可以不定期向上面上传日志
注册用户
一直持有
1. 必须是注册用户才能进行此操作
成功
1. 增加用户相应积分
2. 开通对这篇日志的评论和浏览功能
失败
1. 返回操作失败信息
1.注册用户登录成功进入日志编辑区 2.发表新日志或者删除以前的日志
1. 查看别人对自己日志的相关评论
1发表新日志2删除已有日志3编辑个人日志4验证登陆5增加个人积分6减少个人积分 7编辑个人日志信息
1更改用户等级
2010-05-23
UML各种图详细讲解ppt
分析是从开发者的角度来描述系统需要做什么
设计阶段是软件开发生命周期中最富挑战性和创造性的阶段
面向对象的系统分析是在对象帮助下构建系统。并且,面向对象的系统设计是设计由现实世界对象组成的系统
UML 是在面向对象模式下为软件建模使用的语言
由于人们无法全面理解复杂系统,因此应构建复杂系统的模型,建模型的主要原因是为了能够更好地理解将要开发的系统
2010-05-21
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人