资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

java管理系统完整代码 javaweb简单管理系统源码

用JAVA怎么编写停车场管理系统源代码?

importjava.text.SimpleDateFormat;\x0d\x0aimportjava.util.Date;\x0d\x0aimportjava.util.Scanner;\x0d\x0a\x0d\x0a/*********************************\x0d\x0a*停车场管理\x0d\x0a*authorzhang\x0d\x0a*2013-12-13\x0d\x0a********************************/\x0d\x0apublicclassCarStopManager{\x0d\x0a\x0d\x0apublicstaticvoidmain(String[]args){\x0d\x0aScannersc=newScanner(System.in);\x0d\x0a\x0d\x0aSystem.out.println("请入车牌号:");\x0d\x0aStringcarno=sc.next();\x0d\x0aCarStopManagercarStopManager=newCarStopManager();\x0d\x0acarStopManager.setCarNo(carno);//设置车牌号\x0d\x0a\x0d\x0aSimpleDateFormatformat=newSimpleDateFormat("yyyy-MM-ddHH:mm:ss");\x0d\x0aStringsdate=format.format(newDate());\x0d\x0aSystem.out.println("当前时间(入场时间)是:"+sdate);\x0d\x0a\x0d\x0aSystem.out.println("需要开出车场吗?yes/no:");\x0d\x0aStringyesno=sc.next();\x0d\x0a\x0d\x0aif(yesno.equals("yes")){\x0d\x0aStringedate=format.format(newDate());\x0d\x0aSystem.out.println("出场时间是:"+edate);\x0d\x0a//计算方法\x0d\x0acarManager(2,sdate,edate,carStopManager);\x0d\x0a}\x0d\x0a}\x0d\x0a/**\x0d\x0a*计算方法\x0d\x0a*/\x0d\x0apublicstaticvoidcarManager(inttype,StringstarTime,\x0d\x0aStringendTime,CarStopManagercarStopManager){\x0d\x0a\x0d\x0aif(type==1){//按月收费\x0d\x0aSystem.out.println("如若没有缴纳月费请缴纳800元,如若缴纳将不再提示!");\x0d\x0a}else{\x0d\x0a/**\x0d\x0a*一般不会有停车几个月的吧?先不考虑停车几年或者几个月的\x0d\x0a*/\x0d\x0aStringsDay=starTime.substring(8,10);//入场日期(天)\x0d\x0aStringsHour=starTime.substring(11,13);//入场小时\x0d\x0aStringsMM=starTime.substring(14,16);//入场分钟\x0d\x0a\x0d\x0aStringeDay=starTime.substring(8,10);//出场日期(天)\x0d\x0aStringeHour=endTime.substring(11,13);//出厂小时\x0d\x0aStringeMM=endTime.substring(14,16);//出厂分钟\x0d\x0a\x0d\x0afloatmoney=0;//需缴纳的费用\x0d\x0aintshour=Integer.parseInt(sHour);\x0d\x0aintehour=Integer.parseInt(eHour);\x0d\x0aintsmm=Integer.parseInt(sMM);\x0d\x0aintemm=Integer.parseInt(eMM);\x0d\x0aintrehour=0;//停车几个小时\x0d\x0a\x0d\x0aif(sDay.equals(eDay)){//同一天\x0d\x0a//当天6点到20点之间\x0d\x0aif((shour=6shour

成都创新互联公司服务项目包括南江网站建设、南江网站制作、南江网页制作以及南江网络营销策划等。多年来,我们专注于互联网行业,利用自身积累的技术优势、行业经验、深度合作伙伴关系等,向广大中小型企业、政府机构等提供互联网行业的解决方案,南江网站推广取得了明显的社会效益与经济效益。目前,我们服务的客户以成都为中心已经辐射到南江省份的部分城市,未来相信会继续扩大服务区域并继续获得客户的支持与信任!

回答于 2022-12-14

求用Java编写的学生成绩管理系统的完整代码,要能运行的

以下方法实现了用户界面登陆

import java.awt.*;

import java.awt.event.*;

public class DengLuJieMian extends Frame implements ActionListener

{

Label username=new Label("用户名:");//使用文本创建一个用户名标签

TextField t1=new TextField();//创建一个文本框对象

Label password=new Label("密码:");//创建一个密码标签

TextField t2=new TextField();

Button b1=new Button("登陆");//创建登陆按钮

Button b2=new Button("取消");//创建取消按钮

public DengLuJieMian()

{

this.setTitle("学生信息管理系统");//设置窗口标题

this.setLayout(null);//设置窗口布局管理器

username.setBounds(50,40,60,20);//设置姓名标签的初始位置

this.add(username);// 将姓名标签组件添加到容器

t1.setBounds(120,40,80,20);// 设置文本框的初始位置

this.add(t1);// 将文本框组件添加到容器

password.setBounds(50,100,60,20);//密码标签的初始位置

this.add(password);//将密码标签组件添加到容器

t2.setBounds(120,100,80,20);//设置密码标签的初始位置

this.add(t2);//将密码标签组件添加到容器

b1.setBounds(50,150,60,20);//设置登陆按钮的初始位置

this.add(b1);//将登陆按钮组件添加到容器

b2.setBounds(120,150,60,20);//设置取消按钮的初始位置

this.add(b2);// 将取消按钮组件添加到容器

b1.addActionListener(this);//给登陆按钮添加监听器

b2.addActionListener(this);// 给取消按钮添加监听器

this.setVisible(true);//设置窗口的可见性

this.setSize(300,200);//设置窗口的大小

addWindowListener(new WindowAdapter()

{

public void windowClosing(WindowEvent e)

{

System.exit(0);

}

});//通过内部类重写关闭窗体的方法

}

public void actionPerformed(ActionEvent e)

{

if(e.getSource()==b1)//处理登陆事件

{

String name=t1.getText();

String pass=t2.getText();

if(name!=nullpass.equals("000123"))//判断语句

{

new StudentJieMian();

}

}

}

public static void main(String args[])//主函数

{

new DengLuJieMian();

}

}

以下方法实现了学生界面设计

import java.awt.*;

import java.awt.event.*;

class StudentJieMian extends Frame implements ActionListener

{

MenuBar m=new MenuBar();//创建菜单栏

Menu m1=new Menu("信息");//创建菜单“信息”

MenuItem m11=new MenuItem("插入");//创建“插入”的菜单项

MenuItem m12=new MenuItem("查询");

Menu m2=new Menu("成绩");//创建菜单“成绩”

MenuItem m21=new MenuItem("查询");

public StudentJieMian()

{

this.setTitle("学生界面");//设置窗口标题

this.setLayout(new CardLayout());//设置窗口布局管理器

this.setMenuBar(m);//将菜单栏组件添加到容器

m.add(m1);//将信息菜单放入菜单栏

m.add(m2);

m1.add(m11);//将“插入”菜单项添加到“信息”菜单

m1.add(m12); //将“查询”菜单项添加到“信息”菜单

m2.add(m21); //将“查询”菜单项添加到“成绩”菜单

m11.addActionListener(this); //给“插入”菜单项添加监听器

m12.addActionListener(this); //给“查询”菜单项添加监听器

m21.addActionListener(this); //给“查询”菜单项添加监听器

this.setVisible(true); //设置窗口的可见性

this.setSize(300,200); //设置窗口的大小

addWindowListener(new WindowAdapter()

{

public void windowClosing(WindowEvent e)

{

System.exit(0);//关闭窗口

}

});

}

public void actionPerformed(ActionEvent e)

{

if(e.getSource()==m11) //处理“添加信息”事件

{

new AddStudent();

}

if(e.getSource()==m12) //处理“查询信息”事件

{

new SelectStudent();

}

if(e.getSource()==m21) //处理“查询成绩”事件

{

new ChengJiStudent();

}

}

public static void main(String args[])

{ new StudentJieMian(); //创建一个对象 }

求用Java编写的学生成绩管理系统的完整代码

package jdbcproj;

import java.sql.*;

import java.awt.BorderLayout;

import java.awt.EventQueue;

import javax.swing.JFrame;

import javax.swing.JPanel;

import javax.swing.border.EmptyBorder;

import javax.swing.JLabel;

import javax.swing.JOptionPane;

import javax.swing.JTextField;

import javax.swing.JButton;

import java.awt.event.ActionListener;

import java.sql.Connection;

import java.sql.PreparedStatement;

import java.sql.SQLException;

import java.awt.event.ActionEvent;

public class MainFrame extends JFrame {

private JPanel contentPane;

private JTextField txtname;

private JTextField txtpassword;

/**

 * Launch the application.

 */

public static void main(String[] args) {

EventQueue.invokeLater(new Runnable() {

public void run() {

try {

MainFrame frame = new MainFrame();

frame.setVisible(true);

} catch (Exception e) {

e.printStackTrace();

}

}

});

}

/**

 * Create the frame.

 */

public MainFrame() {

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

setBounds(100, 100, 661, 399);

contentPane = new JPanel();

contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));

setContentPane(contentPane);

contentPane.setLayout(null);

JLabel lblNewLabel = new JLabel("\u7528\u6237\u540D");

lblNewLabel.setBounds(114, 51, 72, 18);

contentPane.add(lblNewLabel);

JLabel lblNewLabel_1 = new JLabel("\u5BC6\u7801");

lblNewLabel_1.setBounds(114, 106, 72, 18);

contentPane.add(lblNewLabel_1);

txtname = new JTextField();

txtname.setBounds(261, 48, 86, 24);

contentPane.add(txtname);

txtname.setColumns(10);

txtpassword = new JTextField();

txtpassword.setBounds(261, 103, 86, 24);

contentPane.add(txtpassword);

txtpassword.setColumns(10);

JButton btnadd = new JButton("\u589E\u52A0");

btnadd.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

if(txtname.getText().equals("")||txtpassword.getText().equals(""))

{

JOptionPane.showMessageDialog(getContentPane(), "用户名和密码不能为空","提示信息框",JOptionPane.WARNING_MESSAGE);

}

else{

Users u=new Users();

u.setPwd(txtpassword.getText());

u.setUsername(txtname.getText());

UserDAO usdo=new UserDAO();

usdo.addUser(u);

}

}

});

btnadd.setBounds(45, 205, 113, 27);

contentPane.add(btnadd);

JButton btndelete = new JButton("\u5220\u9664");

btndelete.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent arg0) {

if(txtname.getText().equals(""))

{

JOptionPane.showMessageDialog(getContentPane(), "用户名不能为空","提示信息框",JOptionPane.WARNING_MESSAGE);

}

else{

UserDAO usdo=new UserDAO();

usdo.delUser(txtname.getText());;

}

}

});

btndelete.setBounds(172, 205, 113, 27);

contentPane.add(btndelete);

JButton btnupdate = new JButton("\u4FEE\u6539");

btnupdate.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

if(txtname.getText().equals("")||txtpassword.getText().equals(""))

{

JOptionPane.showMessageDialog(getContentPane(), "用户名和密码不能为空","提示信息框",JOptionPane.WARNING_MESSAGE);

}

else{

Users u=new Users();

u.setPwd(txtpassword.getText());

u.setUsername(txtname.getText());

UserDAO usdo=new UserDAO();

usdo.updateUser(u);;

}

}

});

btnupdate.setBounds(300, 205, 113, 27);

contentPane.add(btnupdate);

JButton btnfind = new JButton("\u67E5\u8BE2");

btnfind.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

if(txtname.getText().equals(""))

{

JOptionPane.showMessageDialog(getContentPane(), "用户名不能为空","提示信息框",JOptionPane.WARNING_MESSAGE);

}

else{

Users u=new Users();

UserDAO usdo=new UserDAO();

u=usdo.findUser(txtname.getText(), txtpassword.getText());

if(u!=null){

JOptionPane.showMessageDialog(getContentPane(), "该用户存在!","提示信息框",JOptionPane.WARNING_MESSAGE);

}

else{

JOptionPane.showMessageDialog(getContentPane(), "该用户不存在!","提示信息框",JOptionPane.WARNING_MESSAGE);

}

}

}

});

btnfind.setBounds(427, 205, 113, 27);

contentPane.add(btnfind);

//记得要写这个

setVisible(true);

}

}


网站标题:java管理系统完整代码 javaweb简单管理系统源码
标题网址:http://cdkjz.cn/article/hhjise.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220