重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

java做的库房界面代码 java数据库仓库管理系统代码

java仓库管理系统源码基于Java的仓库管理系统。求完整的源代码。跪谢!!!只有5币了

给你个流程,自己学着做,做出来你会很有成就感的,对你的技术也有很大帮助:

创新互联,是成都地区的互联网解决方案提供商,用心服务为企业提供网站建设、成都app软件开发公司、小程序制作、系统按需求定制开发和微信代运营服务。经过数十载的沉淀与积累,沉淀的是技术和服务,让客户少走弯路,踏实做事,诚实做人,用情服务,致力做一个负责任、受尊敬的企业。对客户负责,就是对自己负责,对企业负责。

仓库管理系统流程说明

(一)进货管理

现代商业管理,进货环节尤为重要,要求现场实时下订单(Purchase Order),及时补货。

1、 业务员根据手中的手持终端(Handheld Terminal,简称HHT),调用后台资料,与实际库存资料进行实 时对照,并可通过终端无线驱动打印机打印对照表;

2、 业务员根据实时对照表,现场决定是否应补货或退货,通过终端调用后台数据库制定订单,以最快速度进行补货或退货;维持库存的合理性。

(二)上架

将货物存放到货位上。

(三)交叉驳运

这种作业不对商品进行储存,只处理信息分类。作业接受来自制造商的顾客组合订货,并把他们装运到个别的顾客处去。交叉站台是指多对多的配送体系中的货物调整。直接通过交叉换货后为客户配送,可以避免出入库的麻烦。

(四)收货管理

1、 供货商按照订单要求将货品送到商场收货处;

2、 商场验收人员利用终端调用后台数据库中相应的订单存盘,与供货商送来的商品逐一检查对照,并进行确认,包括:商品编码、商品数量、生产地、品种、规格、包装时间、保质时间、旧价格、新价格、变更时间、条形码标准等信息;

注:终端在系统未授权的情况下无法修改订单。

3、 商场验收人员在终端上按[确认]键,将信息上传到后台服务器,并同时记录收货时间和收货人;

4、 终端可以现场实时调用后台数据库中供货商的历史订单,逐一查验对照核算;

5、 通过终端无线驱动打印机打印收货清单;

6、 在查验过程中出现问题,可以拒收货物。

JAVA的图形用户界面代码

package hao;

import java.awt.BorderLayout;

import java.awt.Color;

import java.awt.Dimension;

import java.awt.GridLayout;

import java.io.File;

import javax.swing.BorderFactory;

import javax.swing.Box;

import javax.swing.ImageIcon;

import javax.swing.JButton;

import javax.swing.JComboBox;

import javax.swing.JLabel;

import javax.swing.JPanel;

import javax.swing.JScrollPane;

import javax.swing.JTextArea;

import javax.swing.JTextPane;

import javax.swing.text.BadLocationException;

import javax.swing.text.SimpleAttributeSet;

import javax.swing.text.StyleConstants;

import javax.swing.text.StyledDocument;

public class ChatPanel extends JPanel {

private static final long serialVersionUID = 1L;

JButton send,record,saveRecord,image;

JTextArea inputArea;

JTextPane text;//注意用法****************************************************************************

JComboBox fontName = null, fontSize = null, fontStyle = null, fontColor = null,fontBackColor = null;

public StyledDocument doc = null; JScrollPane scrollPane;JPanel textChat;

JButton music;

public ChatPanel() {

setLayout(new BorderLayout());

text = new JTextPane();

text.setEditable(false);

doc = text.getStyledDocument();//跟踪文本和图片写到该区域的位置*************************************

scrollPane = new JScrollPane(text);

//注意下面对JComboBox的巧用***********************************************************************

String[] str_name = { "宋体", "黑体", "Dialog", "Gulim" };

String[] str_Size = { "12", "14", "18", "22", "30", "40" };

String[] str_Style = { "常规", "斜体", "粗体", "粗斜体" };

String[] str_Color = { "黑色", "红色", "蓝色", "黄色", "绿色" };

String[] str_BackColor = { "无色", "灰色", "淡红", "淡蓝", "淡黄", "淡绿" };

fontName = new JComboBox(str_name);

fontSize = new JComboBox(str_Size);

fontStyle = new JComboBox(str_Style);

fontColor = new JComboBox(str_Color);

fontBackColor = new JComboBox(str_BackColor);

fontName.setBackground(new Color(255,153,255));

fontSize.setBackground(new Color(255,153,255));

fontStyle.setBackground(new Color(255,153,255));

fontColor.setBackground(new Color(255,153,255));

fontBackColor.setBackground(new Color(255,153,255));

Box box = Box.createVerticalBox();//创建一个可以容纳多个Box组件的Box*******************************

Box box_1 = Box.createHorizontalBox();

Box box_2 = Box.createHorizontalBox();

Box box_4 = Box.createHorizontalBox();

box.add(box_1);

box.add(box_2);

box.add(box_4);

JLabel b1= new JLabel("字体~~"), b2 = new JLabel("样式~~"),b3 = new JLabel("字号~~"),b4 = new JLabel("颜色~~"),b5 = new JLabel("背景~~");

b1.setBackground(new Color(255,153,255));

b2.setBackground(new Color(255,153,255));

b3.setBackground(new Color(255,153,255));

b4.setBackground(new Color(255,153,255));

b5.setBackground(new Color(255,153,255));

box_1.add(b1);

box_1.add(fontName);

box_1.add(Box.createHorizontalStrut(8));

box_1.add(b2);

box_1.add(fontStyle);

box_1.add(Box.createHorizontalStrut(8));

box_1.add(b3);

box_1.add(fontSize);

box_2.add(Box.createHorizontalStrut(8));

box_2.add(b4);

box_2.add(fontColor);

box_2.add(Box.createHorizontalStrut(8));

box_4.add(b5);

box_4.add(fontBackColor);

textChat = new JPanel();

textChat.setLayout(new BorderLayout());

textChat.setBackground(new Color(255,153,255));

inputArea = new JTextArea(3, 20);

inputArea.setLineWrap(true); //设置文本区的换行策略。88888*********************************

send = new JButton("发送");

record=new JButton("显示记录");

saveRecord=new JButton("储存记录");

image=new JButton("表情");

send.setBackground(new Color(255,153,255));

record.setBackground(new Color(255,153,255));

saveRecord.setBackground(new Color(255,153,255));

image.setBackground(new Color(255,153,255));

Box box_3 = Box.createHorizontalBox();

box_3.add(send); box_3.add(Box.createHorizontalStrut(8));//设置按钮间距*************************888

box_3.add(record); box_3.add(Box.createHorizontalStrut(8)); //设置按钮间距*************************888

box_3.add(saveRecord); box_3.add(Box.createHorizontalStrut(8));//设置按钮间距*************************888

box_3.add(image);

box.setBorder(BorderFactory.createLineBorder(new Color(102,102,0),5));//设置Box的边框线********************

box_3.setBorder(BorderFactory.createLineBorder(new Color(102,102,0),5));

textChat.add(box,BorderLayout.NORTH);

textChat.add(inputArea,BorderLayout.CENTER);

textChat.add(box_3, BorderLayout.SOUTH);

inputArea.requestFocus(true);

inputArea.setBorder(BorderFactory.createLineBorder(new Color(102,102,0),5));//设置输入窗口边框线*******************

text.setBorder(BorderFactory.createLineBorder(new Color(102,102,0),8));//设置输入窗口边框线*******************

JPanel audioPanel = new JPanel();//最上面的边框************************************************************************

audioPanel.setBackground(new Color(255,153,255));

audioPanel.setLayout(new GridLayout(1,1));

music = new JButton("想听就听");

music.setPreferredSize(new Dimension(320,50));

music.setBorder(BorderFactory.createLineBorder(Color.BLACK,10));//设置输入窗口边框线*******************

audioPanel.add(music);

add(audioPanel, BorderLayout.NORTH);

add(scrollPane,BorderLayout.CENTER);

add(textChat, BorderLayout.SOUTH);

}

void insertIcon(ImageIcon image) {

text.setCaretPosition(doc.getLength());

text.insertIcon(image);

insert(new MessageStyle());//?????????????????????????????????????????????????????????????????????????????/

}

public void insert(MessageStyle attrib) {

try {

doc.insertString(doc.getLength(), attrib.getText() + "\n", attrib.getAttrSet());//写完后接着换行************

} catch (BadLocationException e) {

e.printStackTrace();

}

}

public MessageStyle getMessageStyle(String line) {

MessageStyle att = new MessageStyle();

att.setText(line);

att.setName((String) fontName.getSelectedItem());

att.setSize(Integer.parseInt((String) fontSize.getSelectedItem()));

String temp_style = (String) fontStyle.getSelectedItem();

if (temp_style.equals("常规")) {

att.setStyle(MessageStyle.GENERAL);

}

else if (temp_style.equals("粗体")) {

att.setStyle(MessageStyle.BOLD);

}

else if (temp_style.equals("斜体")) {

att.setStyle(MessageStyle.ITALIC);

}

else if (temp_style.equals("粗斜体")) {

att.setStyle(MessageStyle.BOLD_ITALIC);

}

String temp_color = (String) fontColor.getSelectedItem();

if (temp_color.equals("黑色")) {

att.setColor(new Color(0, 0, 0));

}

else if (temp_color.equals("红色")) {

att.setColor(new Color(255, 0, 0));

}

else if (temp_color.equals("蓝色")) {

att.setColor(new Color(0, 0, 255));

}

else if (temp_color.equals("黄色")) {

att.setColor(new Color(255, 255, 0));

}

else if (temp_color.equals("绿色")) {

att.setColor(new Color(0, 255, 0));

}

String temp_backColor = (String) fontBackColor.getSelectedItem();

if (!temp_backColor.equals("无色")) {

if (temp_backColor.equals("灰色")) {

att.setBackColor(new Color(200, 200, 200));

}

else if (temp_backColor.equals("淡红")) {

att.setBackColor(new Color(255, 200, 200));

}

else if (temp_backColor.equals("淡蓝")) {

att.setBackColor(new Color(200, 200, 255));

}

else if (temp_backColor.equals("淡黄")) {

att.setBackColor(new Color(255, 255, 200));

}

else if (temp_backColor.equals("淡绿")) {

att.setBackColor(new Color(200, 255, 200));

}

}

return att;

}

}

用Java做一个简单的界面,连接到数据库(SQL Server),大家有没有具体的例子,跪求解答

你可以做一个下拉框,选项有教师和学生,不过这个的话,一般是通过权限来控制的,这样教师和学生登录之后,看到的菜单就不一样了。

JDBC连接数据库

•创建一个以JDBC连接数据库的程序,包含7个步骤:

1、加载JDBC驱动程序:

在连接数据库之前,首先要加载想要连接的数据库的驱动到JVM(Java虚拟机),

这通过java.lang.Class类的静态方法forName(String className)实现。

例如:

try{

//加载MySql的驱动类

Class.forName("com.mysql.jdbc.Driver") ;

}catch(ClassNotFoundException e){

System.out.println("找不到驱动程序类 ,加载驱动失败!");

e.printStackTrace() ;

}

成功加载后,会将Driver类的实例注册到DriverManager类中。

2、提供JDBC连接的URL

•连接URL定义了连接数据库时的协议、子协议、数据源标识。

•书写形式:协议:子协议:数据源标识

协议:在JDBC中总是以jdbc开始

子协议:是桥连接的驱动程序或是数据库管理系统名称。

数据源标识:标记找到数据库来源的地址与连接端口。

例如:(MySql的连接URL)

jdbc:mysql:

//localhost:3306/test?useUnicode=truecharacterEncoding=gbk ;

useUnicode=true:表示使用Unicode字符集。如果characterEncoding设置为

gb2312或GBK,本参数必须设置为true 。characterEncoding=gbk:字符编码方式。

3、创建数据库的连接

•要连接数据库,需要向java.sql.DriverManager请求并获得Connection对象,

该对象就代表一个数据库的连接。

•使用DriverManager的getConnectin(String url , String username ,

String password )方法传入指定的欲连接的数据库的路径、数据库的用户名和

密码来获得。

例如:

//连接MySql数据库,用户名和密码都是root

String url = "jdbc:mysql://localhost:3306/test" ;

String username = "root" ;

String password = "root" ;

try{

Connection con =

DriverManager.getConnection(url , username , password ) ;

}catch(SQLException se){

System.out.println("数据库连接失败!");

se.printStackTrace() ;

}

4、创建一个Statement

•要执行SQL语句,必须获得java.sql.Statement实例,Statement实例分为以下3

种类型:

1、执行静态SQL语句。通常通过Statement实例实现。

2、执行动态SQL语句。通常通过PreparedStatement实例实现。

3、执行数据库存储过程。通常通过CallableStatement实例实现。

具体的实现方式:

Statement stmt = con.createStatement() ;

PreparedStatement pstmt = con.prepareStatement(sql) ;

CallableStatement cstmt =

con.prepareCall("{CALL demoSp(? , ?)}") ;

5、执行SQL语句

Statement接口提供了三种执行SQL语句的方法:executeQuery 、executeUpdate

和execute

1、ResultSet executeQuery(String sqlString):执行查询数据库的SQL语句

,返回一个结果集(ResultSet)对象。

2、int executeUpdate(String sqlString):用于执行INSERT、UPDATE或

DELETE语句以及SQL DDL语句,如:CREATE TABLE和DROP TABLE等

3、execute(sqlString):用于执行返回多个结果集、多个更新计数或二者组合的

语句。

具体实现的代码:

ResultSet rs = stmt.executeQuery("SELECT * FROM ...") ; 法长瘁短诓的搭痊但花

int rows = stmt.executeUpdate("INSERT INTO ...") ;

boolean flag = stmt.execute(String sql) ;

6、处理结果

两种情况:

1、执行更新返回的是本次操作影响到的记录数。

2、执行查询返回的结果是一个ResultSet对象。

• ResultSet包含符合SQL语句中条件的所有行,并且它通过一套get方法提供了对这些

行中数据的访问。

• 使用结果集(ResultSet)对象的访问方法获取数据:

while(rs.next()){

String name = rs.getString("name") ;

String pass = rs.getString(1) ; // 此方法比较高效

}

(列是从左到右编号的,并且从列1开始)

7、关闭JDBC对象

操作完成以后要把所有使用的JDBC对象全都关闭,以释放JDBC资源,关闭顺序和声

明顺序相反:

1、关闭记录集

2、关闭声明

3、关闭连接对象

if(rs != null){ // 关闭记录集

try{

rs.close() ;

}catch(SQLException e){

e.printStackTrace() ;

}

}

if(stmt != null){ // 关闭声明

try{

stmt.close() ;

}catch(SQLException e){

e.printStackTrace() ;

}

}

if(conn != null){ // 关闭连接对象

try{

conn.close() ;

}catch(SQLException e){

e.printStackTrace() ;

}

}


网站题目:java做的库房界面代码 java数据库仓库管理系统代码
标题链接:http://cqcxhl.cn/article/ddjoeih.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP