Java Swing+mysql实现的出租车计价器系统(车辆管理、司机管理、订单管理)

本文主要是介绍Java Swing+mysql实现的出租车计价器系统(车辆管理、司机管理、订单管理),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

博客目录

  • 出租车计价器系统
    • 功能截图
    • 系统流程图
    • 关键代码
    • 写在最后

出租车计价器系统

背景:
出租车计价系统可以大大降低出租车运营的成本,为出租车运营管理公司提供灵活的销售策略和强力可靠的运营平台,给用户全新的打车体验和便捷的打车服务。

功能截图

本系统实现的功能点如下:
(1) 可以添加车辆信息;
(2) 可以删除车辆信息;
(3) 可以添加司机信息;
(4) 可以删除手机信息;
(5) 可以维护车辆信息;
(6) 可以管理车辆信息;
(7) 可以维护司机信息;
(8) 可以管理司机信息;
(9) 可以查询订单,实现出租车计价

登录界面:
在这里插入图片描述
车辆状态页面:
在这里插入图片描述
车辆管理:
在这里插入图片描述
司机信息:
在这里插入图片描述
计价信息:
在这里插入图片描述
订单信息:
在这里插入图片描述

系统流程图

1、数据流图
在这里插入图片描述
2、系统流程图
在这里插入图片描述
在这里插入图片描述

关键代码

1、dao层
车辆Dao:CarDao.java

package cn.itbaizhan.dao;import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;import cn.itbaizhan.db.DbManager;
import cn.itbaizhan.entity.CarEntity;
import cn.itbaizhan.tool.ArrayListToString;public class CarDAO {
/*	private static int id;private static String number;private static String type;private static String state;*/private Connection con;private static PreparedStatement sta;private static ResultSet rs;private static ArrayList<CarEntity> list;public CarDAO(Connection con){this.con = con;}public static ArrayList<CarEntity> findByStateAndType(String type,String state){String sql = "";if(type.endsWith("全部")&&state.endsWith("全部")){sql = "select * from car";}else if(type.endsWith("全部")){sql = "select * from car where state='"+state+"'";}else if(state.endsWith("全部")){sql = "select * from car where type='"+type+"'";}else{sql = "select * from car where state='"+state+"' and type = '"+type+"' ";}list = new ArrayList<CarEntity>();rs = DbManager.quert(sql);try {while(rs.next()){CarEntity car= new CarEntity();car.setId(rs.getInt(1));car.setNumber(rs.getString(2));car.setXinghao(rs.getString(3));car.setType(rs.getString(4));car.setF_number(rs.getString(5));car.setJ_number(rs.getString(6));car.setSelltime(new java.sql.Date(rs.getDate(7).getTime()));car.setState(rs.getString(8));car.setInf(rs.getString(9));list.add(car);}DbManager.close();return list;} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}return null;}public static ArrayList<CarEntity> findByState(String state){String sql = "select * from car where state='"+state+"'";list = new ArrayList<CarEntity>();rs = DbManager.quert(sql);try {while(rs.next()){CarEntity car= new CarEntity();car.setId(rs.getInt(1));car.setNumber(rs.getString(2));car.setXinghao(rs.getString(3));car.setType(rs.getString(4));car.setF_number(rs.getString(5));car.setJ_number(rs.getString(6));car.setSelltime(new java.sql.Date(rs.getDate(7).getTime()));car.setState(rs.getString(8));car.setInf(rs.getString(9));list.add(car);}DbManager.close();return list;} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}return null;}public static ArrayList<CarEntity> findAll(){String sql = "select * from car";list = new ArrayList<CarEntity>();rs = DbManager.quert(sql);try {while(rs.next()){CarEntity car= new CarEntity();car.setId(rs.getInt(1));car.setNumber(rs.getString(2));car.setXinghao(rs.getString(3));car.setType(rs.getString(4));car.setF_number(rs.getString(5));car.setJ_number(rs.getString(6));car.setSelltime(new java.sql.Date(rs.getDate(7).getTime()));car.setState(rs.getString(8));car.setInf(rs.getString(9));list.add(car);}DbManager.close();return list;} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}return null;}public static CarEntity findByID(int id){CarEntity car= new CarEntity();String sql="select * from car where id_c="+id;rs = DbManager.quert(sql);try {while(rs.next()){car.setId(rs.getInt(1));car.setNumber(rs.getString(2));car.setXinghao(rs.getString(3));car.setType(rs.getString(4));car.setF_number(rs.getString(5));car.setJ_number(rs.getString(6));car.setSelltime(new java.sql.Date(rs.getDate(7).getTime()));car.setState(rs.getString(8));car.setInf(rs.getString(9));}DbManager.close();return car;} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();System.out.println("没有找到车辆信息");}return null;}public static CarEntity findByNumber(String number){CarEntity car= new CarEntity();String sql="select * from car where number='"+number+"'";rs = DbManager.quert(sql);try {while(rs.next()){car.setId(rs.getInt(1));car.setNumber(rs.getString(2));car.setXinghao(rs.getString(3));car.setType(rs.getString(4));car.setF_number(rs.getString(5));car.setJ_number(rs.getString(6));car.setSelltime(new java.sql.Date(rs.getDate(7).getTime()));car.setState(rs.getString(8));car.setInf(rs.getString(9));}DbManager.close();return car;} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}return null;}public static ArrayList<String> findAllNumber(){String sql = "select number from car";ArrayList<String> numberList = new ArrayList<String>();rs = DbManager.quert(sql);try {while(rs.next()){numberList.add(rs.getString(1));}DbManager.close();return numberList;} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}return null;}public static boolean save(CarEntity car){boolean flag = false;String sql = "INSERT INTO car(number,xinghao,type,f_number,j_number,selltime,state,inf) VALUES(?,?,?,?,?,?,?,?)";// pstmt = this.con.prepareStatement(sql);try {sta = (PreparedStatement) DbManager.update(sql);//sta.setInt(1,null);//sta.setInt(1, car.getId());sta.setString(1, car.getNumber());sta.setString(2, car.getXinghao());sta.setString(3, car.getType());sta.setString(4, car.getF_number());sta.setString(5, car.getJ_number());sta.setDate(6,new java.sql.Date(car.getSelltime().getTime()));sta.setString(7, car.getState());sta.setString(8, car.getInf());sta.executeUpdate();} catch (SQLException e) {e.printStackTrace();return false;}DbManager.close();return true;}public static boolean updateRemark(int id,String remark){String sql="UPDATE car set inf='"+remark+"' where id_c='"+id+"'";try {sta = (PreparedStatement) DbManager.update(sql);sta.executeUpdate();} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();return false;}return true;}public static boolean updateState(int id,String state){String sql="UPDATE car set state='"+state+"' where id_c='"+id+"'";try {sta = (PreparedStatement) DbManager.update(sql);sta.executeUpdate();} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();return false;}return true;}public static boolean update(CarEntity car){String sql="UPDATE car set number=?,xinghao=?,type=?,f_number=?,j_number=?,selltime=?,state=?,inf=? where id_c='"+car.getId()+"'";try {sta = (PreparedStatement) DbManager.update(sql);sta.setString(1, car.getNumber());sta.setString(2, car.getXinghao());sta.setString(3, car.getType());sta.setString(4, car.getF_number());sta.setString(5, car.getJ_number());sta.setDate(6,new java.sql.Date(car.getSelltime().getTime()));sta.setString(7, car.getState());sta.setString(8, car.getInf());sta.executeUpdate();} catch (SQLException e) {e.printStackTrace();return false;}DbManager.close();return true;}public static void delete(int id){String sql="DELETE FROM car where id_c=?"; try {sta = (PreparedStatement) DbManager.update(sql);sta.setInt(1,id	);sta.executeUpdate();} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}DbManager.close();}public static ArrayList<String> showEnumContent(){ArrayList<String> carType = new ArrayList<String>();String sql = "show columns from car like 'type'";ResultSet rs = DbManager.quert(sql);try {rs.next();String enums = rs.getString("Type");//System.out.println(enums);int position = 0, count = 0;String[] availableEnums = new String[10];while ((position = enums.indexOf("'", position)) > 0) {int secondPosition = enums.indexOf("'", position + 1);availableEnums[count++] = enums.substring(position + 1,secondPosition);position = secondPosition + 1;carType.add(availableEnums[count - 1]);// System.out.println(availableEnums[count - 1]);}} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}DbManager.close();return carType;}public static void addCarTyep(String newType){//String sql = "alter table car modify type enum("a","b","c","d","e","f")";String[] oldcararray=ArrayListToString.arrayListToString( CarDAO.showEnumContent());String[] newcararray = new String[oldcararray.length+1];for(int i=0;i<oldcararray.length;i++){newcararray[i] = oldcararray[i];}newcararray[newcararray.length-1] = newType;String sql1 = "alter table car modify type enum(";String sql2 = "";for(int i=0;i<newcararray.length;i++){sql2+="\'"+newcararray[i]+"\'"+",";}sql2 = sql2.substring(0,sql2.length()-1);String sql3 = ")";String sql = sql1+sql2+sql3;System.out.println(sql);//DbManager.alter(sql);System.out.println(showEnumContent().toString());DbManager.close();}/*public static void main(String args[]){addCarTyep("没有");}*/}

DriverDao.java

package cn.itbaizhan.dao;import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Iterator;import cn.itbaizhan.db.DbManager;
import cn.itbaizhan.entity.DriverEntity;public class DriverDAO {private Connection con;private static PreparedStatement sta;private static ResultSet rs;private static ArrayList<DriverEntity> list;public DriverDAO(Connection con){this.con = con;}public static boolean save(DriverEntity driver){boolean flag = false;String sql = "INSERT INTO driver(name,sex,nation,jiguan,idcard,xueli,school,tel,mail,address,state) VALUES(?,?,?,?,?,?,?,?,?,?,?)";try {sta = (PreparedStatement) DbManager.update(sql);int i=1;sta.setString(i++, driver.getName());sta.setString(i++, driver.getSex());sta.setString(i++, driver.getNation());sta.setString(i++, driver.getJiguan());sta.setString(i++, driver.getIdcard());sta.setString(i++, driver.getXueli());sta.setString(i++, driver.getSchool());sta.setString(i++, driver.getTel());sta.setString(i++, driver.getMail());sta.setString(i++, driver.getAddress());sta.setString(i++, driver.getState());sta.executeUpdate();} catch (SQLException e) {e.printStackTrace();return false;}return true;}public static boolean updateRemark(int id,String remark){String sql="UPDATE driver set inf='"+remark+"' where id_p='"+id+"'";try {sta = (PreparedStatement) DbManager.update(sql);sta.executeUpdate();} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();return false;}return true;}public static boolean updateState(int id,String state){String sql="UPDATE driver set state='"+state+"' where id_p='"+id+"'";try {sta = (PreparedStatement) DbManager.update(sql);sta.executeUpdate();} catch (SQLException e) {e.printStackTrace();return false;}return true;}public static boolean update(DriverEntity driver){String sql="UPDATE driver set name=?,sex=?,nation=?,jiguan=?,idcard=?,xueli=?,school=?,tel=?,mail=?,address=?,state=? where id_p='"+driver.getId_p()+"'";try {sta = (PreparedStatement) DbManager.update(sql);//sta.setInt(1, driver.getId());int i = 1;sta.setString(i++, driver.getName());sta.setString(i++, driver.getSex());sta.setString(i++, driver.getNation());sta.setString(i++, driver.getJiguan());sta.setString(i++, driver.getIdcard());sta.setString(i++, driver.getXueli());sta.setString(i++, driver.getSchool());sta.setString(i++, driver.getTel());sta.setString(i++, driver.getMail());sta.setString(i++, driver.getAddress());sta.setString(i++, driver.getState());sta.executeUpdate();} catch (SQLException e) {e.printStackTrace();DbManager.close();return false;}DbManager.close();return true;}public static ArrayList<DriverEntity> findByState(String state,String fendui){String sql = "";if(fendui.equals("全部")){if(state.equals("全部")){sql = "select * from driver";}else{sql = "select * from driver where  state = '"+state+"' ";}}else{sql="select id_de from depart where fendui = '"+fendui+"'";ArrayList<Integer> departList = new ArrayList<Integer>();rs = DbManager.quert(sql);try{while(rs.next()){departList.add(rs.getInt(1));}}catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}if(state.equals("全部")){int number = 0;Iterator<Integer> it = departList.iterator();sql = "select * from driver WHERE depart = ";while(it.hasNext()){number++;sql = sql + "'"+it.next()+"'";if(number!=departList.size()){sql = sql + "or depart=";}}}else{sql = "select * from driver where  state = '"+state+"' AND (depart = ";int number = 0;Iterator<Integer> it = departList.iterator();//sql = "select * from driver WHERE depart = ";while(it.hasNext()){number++;sql = sql + "'"+it.next()+"'";if(number!=departList.size()){sql = sql + "or depart=";}else{sql = sql + ")";}}}}list = new ArrayList<DriverEntity>();rs = DbManager.quert(sql);try {while(rs.next()){DriverEntity driver= new DriverEntity();driver.setId_p(rs.getInt(1));driver.setName(rs.getString(2));driver.setSex(rs.getString(3));driver.setNation(rs.getString(4));driver.setJiguan(rs.getString(5));driver.setIdcard(rs.getString(6));driver.setXueli(rs.getString(7));driver.setSchool(rs.getString(8));driver.setTel(rs.getString(9));driver.setMail(rs.getString(10));driver.setAddress(rs.getString(11));driver.setState(rs.getString(12));list.add(driver);}DbManager.close();return list;} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}return null;}public static ArrayList<DriverEntity> findAll(){String sql = "select id_p,driver.name,sex,nation,jiguan,idcard,xueli,school,tel,mail,address,state from driver ";list = new ArrayList<DriverEntity>();rs = DbManager.quert(sql);try {while(rs.next()){DriverEntity driver= new DriverEntity();int i=1;driver.setId_p(rs.getInt(i++));driver.setName(rs.getString(i++));driver.setSex(rs.getString(i++));driver.setNation(rs.getString(i++));driver.setJiguan(rs.getString(i++));driver.setIdcard(rs.getString(i++));driver.setXueli(rs.getString(i++));driver.setSchool(rs.getString(i++));driver.setTel(rs.getString(i++));driver.setMail(rs.getString(i++));driver.setAddress(rs.getString(i++));driver.setState(rs.getString(i++));list.add(driver);}DbManager.close();return list;} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}DbManager.close();return null;}public static DriverEntity findByID(int id){DriverEntity driver= new DriverEntity();//String sql="select * from driver where id_p="+id;String sql = "select driver.id_p,driver.name,sex,nation,jiguan,idcard,xueli,school,tel,mail,address,state from driver WHERE driver.id_p="+id;rs = DbManager.quert(sql);try {while(rs.next()){int i=1;driver.setId_p(rs.getInt(i++));driver.setName(rs.getString(i++));driver.setSex(rs.getString(i++));driver.setNation(rs.getString(i++));driver.setJiguan(rs.getString(i++));driver.setIdcard(rs.getString(i++));driver.setXueli(rs.getString(i++));driver.setSchool(rs.getString(i++));driver.setTel(rs.getString(i++));driver.setMail(rs.getString(i++));driver.setAddress(rs.getString(i++));driver.setState(rs.getString(i++));}DbManager.close();return driver;} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}DbManager.close();return null;}public static ArrayList<DriverEntity> findByName(String name){DriverEntity driver= new DriverEntity();list = new ArrayList<DriverEntity>();//String sql="select * from driver where id_p="+id;String sql = "select driver.id_p,name,sex,nation,jiguan,idcard,xueli,school,tel,mail,address,state from driver WHERE driver.name='"+name+"'";rs = DbManager.quert(sql);try {while(rs.next()){int i=1;driver.setId_p(rs.getInt(i++));driver.setName(rs.getString(i++));driver.setSex(rs.getString(i++));driver.setNation(rs.getString(i++));driver.setJiguan(rs.getString(i++));driver.setIdcard(rs.getString(i++));driver.setXueli(rs.getString(i++));driver.setSchool(rs.getString(i++));driver.setTel(rs.getString(i++));driver.setMail(rs.getString(i++));driver.setAddress(rs.getString(i++));driver.setState(rs.getString(i++));list.add(driver);}DbManager.close();return list;} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}DbManager.close();return null;}
public static ArrayList<DriverEntity> findByZhiWu(String zhiwu){DriverEntity driver= new DriverEntity();list = new ArrayList<DriverEntity>();//String sql="select * from driver where id_p="+id;System.out.println(zhiwu);String sql = "select name,sex,nation,jiguan,idcard,xueli,school,tel,mail,address,state from driver WHERE sex='"+zhiwu+"'";rs = DbManager.quert(sql);try {while(rs.next()){int i=1;driver.setName(rs.getString(i++));driver.setSex(rs.getString(i++));driver.setNation(rs.getString(i++));driver.setJiguan(rs.getString(i++));driver.setIdcard(rs.getString(i++));driver.setXueli(rs.getString(i++));driver.setSchool(rs.getString(i++));driver.setTel(rs.getString(i++));driver.setMail(rs.getString(i++));driver.setAddress(rs.getString(i++));driver.setState(rs.getString(i++));list.add(driver);}DbManager.close();return list;} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}DbManager.close();return null;}
public static ArrayList<String> findAllName(){String sql = "select name from driver ";ArrayList<String> nameList = new ArrayList<String>();rs = DbManager.quert(sql);try {while(rs.next()){int i=1;nameList.add(rs.getString(i++));}DbManager.close();return nameList;} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}DbManager.close();return null;
}public static DriverEntity findByID2(int id){DriverEntity driver= new DriverEntity();String sql = "select id_p,driver.name,sex,nation,jiguan,idcard,xueli,school,tel,mail,address,state WHERE driver.id_p="+id;rs = DbManager.quert(sql);try {while(rs.next()){int i=1;driver.setId_p(rs.getInt(i++));driver.setName(rs.getString(i++));driver.setSex(rs.getString(i++));driver.setNation(rs.getString(i++));driver.setJiguan(rs.getString(i++));driver.setIdcard(rs.getString(i++));driver.setXueli(rs.getString(i++));driver.setSchool(rs.getString(i++));driver.setTel(rs.getString(i++));driver.setMail(rs.getString(i++));driver.setAddress(rs.getString(i++));driver.setState(rs.getString(i++));}DbManager.close();return driver;} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}DbManager.close();return null;}public static void delete(int id){String sql="DELETE FROM driver where id_p=?"; try {sta = (PreparedStatement) DbManager.update(sql);sta.setInt(1,id	);sta.executeUpdate();} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}DbManager.close();}}

2、view层:主页面
Main.java

package cn.itbaizhan.swing;import java.awt.Dimension;
import java.awt.Font;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.ArrayList;import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import javax.swing.UIManager;import cn.itbaizhan.dao.UserDAO;
import cn.itbaizhan.entity.UserEntity;
import cn.itbaizhan.swing.Manage;public class Main extends JFrame{public static void main(String[] args) {  try{UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");//Windows风格 //可以传入以下参数javax.swing.plaf.metal.MetalLookAndFeel;   Metal外观  //com.sun.java.swing.plaf.motif.MotifLookAndFeel;   Motif外观  //com.sun.java.swing.plaf.windows.WindowsLookAndFeel;   windows外观 //SwingUtilities.updateComponentTreeUI(getContentPane());}catch(Exception e){}Main j = new Main();  j.setVisible(true);  }  private static final long serialVersionUID = 1L;  //用于处理拖动事件,表示鼠标按下时的坐标,相对于JFrame  int xOld = 0;  int yOld = 0;  private JPanel imagePanel;private ImageIcon background; public Main() {  final JTextField text1 = new JTextField();this.setLayout(null);  //设置出现位置Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();this.setBounds(((int)dimension.getWidth() - 500) / 2, ((int)dimension.getHeight() - 500) / 2, 500, 255);//处理拖动事件  this.addMouseListener(new MouseAdapter() {  @Override  public void mousePressed(MouseEvent e) {  xOld = e.getX();  yOld = e.getY();  }  });  this.addMouseMotionListener(new MouseMotionAdapter() {  @Override  public void mouseDragged(MouseEvent e) {  int xOnScreen = e.getXOnScreen();  int yOnScreen = e.getYOnScreen();  int xx = xOnScreen - xOld;  int yy = yOnScreen - yOld;  Main.this.setLocation(xx, yy);  }  });  this.addWindowListener(new WindowAdapter() { @Overridepublic void windowActivated(WindowEvent e) { text1.requestFocusInWindow(); } });background = new ImageIcon("image\\background.jpg");// 背景图片JLabel label = new JLabel(background);// 把背景图片显示在一个标签里面// 把标签的大小位置设置为图片刚好填充整个面板label.setBounds(0, 0, background.getIconWidth(),background.getIconHeight());// 把内容窗格转化为JPanel,否则不能用方法setOpaque()来使内容窗格透明imagePanel = (JPanel) this.getContentPane();imagePanel.setOpaque(false);// 内容窗格默认的布局管理器为BorderLayoutimagePanel.setLayout(null);imagePanel.add(new JButton("测试按钮"));this.getLayeredPane().setLayout(null);// 把背景图片添加到分层窗格的最底层作为背景this.getLayeredPane().add(label, new Integer(Integer.MIN_VALUE));this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);this.setSize(background.getIconWidth(), background.getIconHeight());this.setResizable(false);//jFrame.setBounds(((int)dimension.getWidth() - 200) / 2, ((int)dimension.getHeight() - 300) / 2, 400, 50);//jFrame.setResizable(false);//setLayout(null);//setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);Font f = new Font("楷体", Font.BOLD, 18);JLabel label1 = new JLabel("用户名:");label1.setFont(f);label1.setBounds(150, 290, 100, 30);imagePanel.add(label1);JLabel label2 = new JLabel("密  码:");label2.setBounds(150, 320, 100, 30);label2.setFont(f);imagePanel.add(label2);text1.setBounds(220, 295, 130, 20);text1.requestFocus();imagePanel.add(text1);final JPasswordField text2 = new JPasswordField();text2.setBounds(220, 325, 130, 20);text2.addActionListener(new ActionListener(){@Overridepublic void actionPerformed(ActionEvent arg0) {Boolean key = false;ArrayList<UserEntity> user = UserDAO.findAll();for(UserEntity temp : user){if(temp.getUsername().equals(text1.getText()) && temp.getPassword().equals(text2.getText())) {JOptionPane.showMessageDialog(null, "登陆成功", "提示", JOptionPane.INFORMATION_MESSAGE);dispose();new Manage(temp);key = true;break;}}if(key == false){JOptionPane.showMessageDialog(null, "用户名-密码错误", "提示", JOptionPane.ERROR_MESSAGE);text1.setText("");text2.setText("");}}});imagePanel.add(text2);JButton button1 = new JButton("登录");button1.setBounds(220, 355, 60, 20);imagePanel.add(button1);JButton button2 = new JButton("取消");button2.setBounds(290, 355, 60, 20);imagePanel.add(button2);button1.addActionListener(new ActionListener() {@Overridepublic void actionPerformed(ActionEvent e) {Boolean key = false;ArrayList<UserEntity> user = UserDAO.findAll();for(UserEntity temp : user){if(temp.getUsername().equals(text1.getText()) && temp.getPassword().equals(text2.getText())) {JOptionPane.showMessageDialog(null, "登陆成功", "提示", JOptionPane.INFORMATION_MESSAGE);dispose();new Manage(temp);key = true;break;}}if(key == false){JOptionPane.showMessageDialog(null, "错误", "提示", JOptionPane.ERROR_MESSAGE);text1.setText("");text2.setText("");}}});
button2.addActionListener(new ActionListener() {@Overridepublic void actionPerformed(ActionEvent e) {System.exit(0);}});setUndecorated(true);//setBounds(50,50,500,255);  // }  /*public static void main(String[] args) {JPanel imagePanel;ImageIcon background;final JFrame jFrame = new JFrame();Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();//JLayeredPane用于添加两个图层的,一个用于背景,一个用于界面  JLayeredPane layeredPane = new JLayeredPane();  layeredPane.setBounds(0, 0, 500, 255);  jFrame.add(layeredPane);  //背景Panel  JPanel bgPanel = new JPanel();  bgPanel.setBounds(0, 0, 500, 255);  layeredPane.add(bgPanel);  //背景图片,添加到背景Panel里面  JLabel bgLabel = new JLabel(new ImageIcon("image/background.jpg"));  bgPanel.add(bgLabel);  //主界面,也就是背景上面的一层Panel  JPanel mainPanel = new JPanel();  mainPanel.setBounds(0, 0, 500, 255);  mainPanel.setLayout(null);  layeredPane.add(mainPanel);  //jFrame.setBounds(((int)dimension.getWidth() - 200) / 2, ((int)dimension.getHeight() - 300) / 2, 400, 50);//jFrame.setResizable(false);jFrame.setLayout(null);jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);JLabel label1 = new JLabel("用户名");label1.setBounds(10, 10, 100, 30);mainPanel.add(label1);JLabel label2 = new JLabel("密码");label2.setBounds(10, 40, 100, 30);mainPanel.add(label2);final JTextField text1 = new JTextField();text1.setBounds(50, 15, 130, 20);mainPanel.add(text1);final JPasswordField text2 = new JPasswordField();text2.setBounds(50, 45, 130, 20);mainPanel.add(text2);JButton button = new JButton("登录");button.setBounds(50, 75, 100, 30);button.addActionListener(new ActionListener() {@Overridepublic void actionPerformed(ActionEvent e) {Boolean key = false;ArrayList<UserEntity> user = UserDAO.findAll();for(UserEntity temp : user){if(temp.getUsername().equals(text1.getText()) && temp.getPassword().equals(text2.getText())) {JOptionPane.showMessageDialog(null, "登陆成功", "提示", JOptionPane.INFORMATION_MESSAGE);jFrame.dispose();new Manage(temp);key = true;break;}}if(key == false){JOptionPane.showMessageDialog(null, "错误", "提示", JOptionPane.ERROR_MESSAGE);text1.setText("");text2.setText("");}}});mainPanel.add(button);jFrame.setVisible(true);jFrame.setBounds(50,50,500,255);  jFrame.setUndecorated(true); }*/}

DriverPane.java

package cn.itbaizhan.swing;import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Image;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.IOException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Vector;import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.JToolBar;
import javax.swing.SwingConstants;
import javax.swing.table.DefaultTableModel;import cn.itbaizhan.addpanel.DriverCorJFrame;
import cn.itbaizhan.dao.DriverDAO;
import cn.itbaizhan.entity.DriverEntity;
import cn.itbaizhan.tool.Snippet;
import cn.itbaizhan.tool.TableToWord;
import cn.itbaizhan.tool.TableTools;
import cn.itbaizhan.updatepanel.DriverUpdateJFrame;
import cn.itbaizhan.updatepanel.DriverUpdateJFrame2;public class DriverPanel extends JPanel{public static JTable table;QueryPanel querypanel;DriverEntity driver;Connection con;Statement sta;ResultSet rs;ResultSetMetaData rsmd;public static Vector<Vector<String>> data;Vector<String>	dataline;public static Vector<String> tableHead;ArrayList<DriverEntity> list;public static DefaultTableModel tablemodel;private int queryNumber;private String queryKey = "姓名";//Vector meta;public DriverPanel(){querypanel = new QueryPanel();String[] dataString = DriverEntity.title;tableHead = new Vector<String>();for(String temp:dataString){tableHead.add(temp);}data = new Vector<Vector<String>>();list = DriverDAO.findAll();queryNumber = list.size();for(DriverEntity temp : list){dataline = new Vector<String>();dataline.add(Integer.toString(temp.getId_p()));dataline.add(temp.getName());//dataline.add(temp.getDepart_name());//dataline.add(temp.getZhiwu_name());dataline.add(temp.getSex());dataline.add(temp.getNation());dataline.add(temp.getJiguan());dataline.add(temp.getIdcard());dataline.add(temp.getXueli());dataline.add(temp.getSchool());dataline.add(temp.getTel());dataline.add(temp.getMail());dataline.add(temp.getAddress());dataline.add(temp.getState());/*dataline.add(temp.getEntertime().toString());dataline.add(temp.getState());dataline.add(temp.getProfessional());dataline.add(temp.getDriverid());dataline.add(temp.getGettime().toString());dataline.add(temp.getEffecttime());dataline.add(temp.getAllowtype());dataline.add(temp.getOvertime().toString());dataline.add(temp.getIn_driverid());dataline.add(temp.getIn_gettime().toString());dataline.add(temp.getIn_effecttime());dataline.add(temp.getIn_allowtype());dataline.add(temp.getIn_overtime().toString());*/data.add(dataline);}tablemodel = new DefaultTableModel(data,tableHead);table = new JTable(tablemodel){@Overridepublic boolean isCellEditable(int row, int column) {			return false;	}
};table.setToolTipText("人员信息");//Table双击事件table.addMouseListener(new MouseAdapter(){@Overridepublic void mouseClicked(MouseEvent e) {if(e.getClickCount()==2){//点击几次,这里是双击事件int key = Integer.parseInt(table.getModel().getValueAt(table.getSelectedRow(), 0).toString());DriverEntity driver = DriverDAO.findByID(key);new DriverUpdateJFrame2(driver);}}});//设置table显示TableTools.setTable(table);//TableTools.fitTableColumns(table);TableTools.contentCenter(table);//table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); Snippet.hideTableColumn(table, 0);querypanel = new QueryPanel();JScrollPane js = new JScrollPane(table);js.getViewport().setBackground(Color.WHITE);setLayout(new BorderLayout());add(querypanel,BorderLayout.NORTH);add(js,BorderLayout.CENTER);}private class QueryPanel extends JToolBar implements ActionListener{private JToolBar querybar;private JButton add;private JButton update;private JButton delete;private JButton check;private JButton query;private JButton show;private String[] queryitem;private JComboBox<String> jcb;private JTextField text;private JLabel querylabel;private JButton save;public QueryPanel(){add = createButton("image\\add.png","添加");update = createButton("image\\edit.png","编辑");delete = createButton("image\\delete.png","删除");check = createButton("image\\state.png","查看");query = createButton("image\\search.png","查询");show = createButton("image\\show.png","显示");save = createButton("image\\save.png","保存表格");queryitem = new String[]{"姓名","性别","状态"};jcb = new JComboBox<String>(queryitem);querylabel = new JLabel("      查询条目:"+queryNumber);querylabel.setForeground(Color.red);text = new JTextField("");text.setBorder(BorderFactory.createLineBorder(new Color(122,138,153)));text.setBackground(null);jcb.setPreferredSize(new Dimension(100,22));text.setPreferredSize(new Dimension(80,22));setLayout(new FlowLayout(FlowLayout.LEFT));add.addActionListener(this);update.addActionListener(this);delete.addActionListener(this);jcb.addActionListener(this);query.addActionListener(this);show.addActionListener(this);save.addActionListener(this);if(Manage.user.getType().equals("管理员")){add(add);add(update);add(delete);}else if(Manage.user.getType().equals("一般用途")){add(add);}this.addSeparator();//add(check);add(jcb);add(text);add(query);add(show);add(save);add(querylabel);//add(querybar);}public JButton createButton(String imagePath,String name){final JButton button = new JButton(name);button.setContentAreaFilled(false);// 设置按钮透明button.setFont(new Font("粗体", Font.PLAIN, 12));// 按钮文本样式button.setMargin(new Insets(0, 0, 0, 0));// 按钮内容与边框距�?ImageIcon image = new ImageIcon(imagePath); image.setImage(image.getImage().getScaledInstance(20,20,Image.SCALE_DEFAULT));button.setIcon(image);button.setHorizontalTextPosition(SwingConstants.CENTER);button.setVerticalTextPosition(SwingConstants.BOTTOM);button.setBorderPainted(false);button.addMouseListener(new MouseListener() {@Overridepublic void mouseReleased(MouseEvent e) {// TODO Auto-generated method stub}@Overridepublic void mousePressed(MouseEvent e) {// TODO Auto-generated method stub}@Overridepublic void mouseExited(MouseEvent e) {button.setBorderPainted(false);button.setBackground(new Color(191,239,255));}@Overridepublic void mouseEntered(MouseEvent e) {button.setBorderPainted(true);button.setBackground(new Color(191,230,250));}@Overridepublic void mouseClicked(MouseEvent e) {// TODO Auto-generated method stub}});return button;}@Overridepublic void actionPerformed(ActionEvent e) {if(e.getSource()==add){new DriverCorJFrame();}if(e.getSource()==delete){try{if(JOptionPane.showConfirmDialog(this, "确定要删除吗", "删除信息", 2)==JOptionPane.YES_OPTION){int key = Integer.parseInt(table.getModel().getValueAt(table.getSelectedRow(), 0).toString());DriverDAO.delete(key);//更新表格内容list = DriverDAO.findAll();DriverPanel.data.clear();for(DriverEntity temp : list){dataline = new Vector<String>();dataline.add(Integer.toString(temp.getId_p()));dataline.add(temp.getName());//dataline.add(temp.getDepart_name());//dataline.add(temp.getZhiwu_name());dataline.add(temp.getSex());dataline.add(temp.getNation());dataline.add(temp.getJiguan());dataline.add(temp.getIdcard());dataline.add(temp.getXueli());dataline.add(temp.getSchool());dataline.add(temp.getTel());dataline.add(temp.getMail());dataline.add(temp.getAddress());dataline.add(temp.getState());/*dataline.add(temp.getEntertime().toString());dataline.add(temp.getState());dataline.add(temp.getProfessional());dataline.add(temp.getDriverid());dataline.add(temp.getGettime().toString());dataline.add(temp.getEffecttime());dataline.add(temp.getAllowtype());dataline.add(temp.getOvertime().toString());dataline.add(temp.getIn_driverid());dataline.add(temp.getIn_gettime().toString());dataline.add(temp.getIn_effecttime());dataline.add(temp.getIn_allowtype());dataline.add(temp.getIn_overtime().toString());*/DriverPanel.data.add(dataline);}DriverPanel.table.updateUI();queryNumber = list.size();querylabel.setText("      查询条目:"+queryNumber);text.setText("");}}catch(ArrayIndexOutOfBoundsException e1){JOptionPane.showMessageDialog(this, "请选择编辑条目");}}if(e.getSource()==update){try{int key = Integer.parseInt(table.getModel().getValueAt(table.getSelectedRow(), 0).toString());DriverEntity driver = DriverDAO.findByID(key);new DriverUpdateJFrame(driver);}catch(ArrayIndexOutOfBoundsException e1){JOptionPane.showMessageDialog(this, "请选择编辑条目");}}if(e.getSource()==jcb){queryKey = (String) jcb.getSelectedItem(); }if(e.getSource()==query){ArrayList<DriverEntity> list = new ArrayList<DriverEntity>();if(text.getText().equals("")){list = DriverDAO.findAll();}else{if(queryKey.endsWith("姓名")){list = DriverDAO.findByName(text.getText());}else if(queryKey.endsWith("性别")){list = DriverDAO.findByZhiWu(text.getText());}else if(queryKey=="状态"){list = DriverDAO.findByState(text.getText(),"全部");}}queryNumber = list.size();querylabel.setText("      查询条目:"+queryNumber);DriverPanel.data.clear();for(DriverEntity temp : list){Vector<String> dataline = new Vector<String>();dataline = new Vector<String>();dataline.add(Integer.toString(temp.getId_p()));dataline.add(temp.getName());//dataline.add(temp.getDepart_name());//dataline.add(temp.getZhiwu_name());dataline.add(temp.getSex());dataline.add(temp.getNation());dataline.add(temp.getJiguan());dataline.add(temp.getIdcard());dataline.add(temp.getXueli());dataline.add(temp.getSchool());dataline.add(temp.getTel());dataline.add(temp.getMail());dataline.add(temp.getAddress());dataline.add(temp.getState());/*dataline.add(temp.getEntertime().toString());dataline.add(temp.getState());dataline.add(temp.getProfessional());dataline.add(temp.getDriverid());dataline.add(temp.getGettime().toString());dataline.add(temp.getEffecttime());dataline.add(temp.getAllowtype());dataline.add(temp.getOvertime().toString());dataline.add(temp.getIn_driverid());dataline.add(temp.getIn_gettime().toString());dataline.add(temp.getIn_effecttime());dataline.add(temp.getIn_allowtype());dataline.add(temp.getIn_overtime().toString());*/DriverPanel.data.add(dataline);}DriverPanel.table.updateUI();}if(e.getSource()==show){//更新表格内容list = DriverDAO.findAll();DriverPanel.data.clear();for(DriverEntity temp : list){dataline = new Vector<String>();dataline.add(Integer.toString(temp.getId_p()));dataline.add(temp.getName());//dataline.add(temp.getDepart_name());//dataline.add(temp.getZhiwu_name());dataline.add(temp.getSex());dataline.add(temp.getNation());dataline.add(temp.getJiguan());dataline.add(temp.getIdcard());dataline.add(temp.getXueli());dataline.add(temp.getSchool());dataline.add(temp.getTel());dataline.add(temp.getMail());dataline.add(temp.getAddress());dataline.add(temp.getState());/*dataline.add(temp.getEntertime().toString());dataline.add(temp.getState());dataline.add(temp.getProfessional());dataline.add(temp.getDriverid());dataline.add(temp.getGettime().toString());dataline.add(temp.getEffecttime());dataline.add(temp.getAllowtype());dataline.add(temp.getOvertime().toString());dataline.add(temp.getIn_driverid());dataline.add(temp.getIn_gettime().toString());dataline.add(temp.getIn_effecttime());dataline.add(temp.getIn_allowtype());dataline.add(temp.getIn_overtime().toString());*/DriverPanel.data.add(dataline);}DriverPanel.table.updateUI();queryNumber = list.size();querylabel.setText("      查询条目:"+queryNumber);text.setText("");}if(e.getSource()==save){if(JOptionPane.showConfirmDialog(this, "是否要保存此数据表格", "保存数据", 2)==JOptionPane.YES_OPTION){//将table中的内容保存为Wordlong temp = System.currentTimeMillis();TableToWord.openWord("carDate\\人员信息"+  temp +".doc", DriverEntity.width,"人员信息", DriverEntity.title.length, DriverEntity.title, data,-2,1);try {String a ="carDate\\人员信息"+ temp +".doc";Runtime.getRuntime().exec("cmd /c \""+a+"\"");} catch (IOException e1) {// TODO Auto-generated catch blocke1.printStackTrace();}}}}}}

CarInfPane.java

package cn.itbaizhan.swing;import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Image;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.IOException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Vector;import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JToolBar;
import javax.swing.SwingConstants;
import javax.swing.table.DefaultTableModel;import cn.itbaizhan.dao.CarInfDAO;
import cn.itbaizhan.entity.CarInfEntity;
import cn.itbaizhan.entity.DriverEntity;
import cn.itbaizhan.tool.TableToWord;
import cn.itbaizhan.tool.TableTools;public class CarInfPanel extends JPanel{public static JTable table;QueryPanel querypanel;DriverEntity driver;Connection con;Statement sta;ResultSet rs;ResultSetMetaData rsmd;public static Vector<Vector<String>> data;Vector<String>	dataline;public static Vector<String> tableHead;ArrayList<CarInfEntity> list;public static DefaultTableModel tablemodel;public CarInfPanel(){querypanel = new QueryPanel();String[] dataString = CarInfEntity.title;tableHead = new Vector<String>();for(String temp:dataString){tableHead.add(temp);}data = new Vector<Vector<String>>();list = CarInfDAO.findAll();for(CarInfEntity temp : list){dataline = new Vector<String>();dataline.add(temp.getNumber());dataline.add(temp.getAddoilcount());dataline.add(temp.getRepaircount());data.add(dataline);}tablemodel = new DefaultTableModel(data,tableHead);table = new JTable(tablemodel){@Overridepublic boolean isCellEditable(int row, int column) {			return false;	}};table.setToolTipText("车辆综合信息表");//设置table显示TableTools.setTable(table);TableTools.fitTableColumns(table);TableTools.contentCenter(table);JScrollPane js = new JScrollPane(table);js.getViewport().setBackground(Color.WHITE);setLayout(new BorderLayout());add(querypanel,BorderLayout.NORTH);add(js,BorderLayout.CENTER);}private class QueryPanel extends JToolBar implements ActionListener{private JToolBar querybar;private JButton add;private JButton update;private JButton delete;private JButton check;private JButton query;private JButton show;private JButton save;public QueryPanel(){add = createButton("image\\add.png","添加");update = createButton("image\\edit.png","编辑");delete = createButton("image\\delete.png","删除");check = createButton("image\\state.png","查看");query = createButton("image\\search.png","查询");show = createButton("image\\show.png","显示");save = createButton("image\\save.png","保存表格");setLayout(new FlowLayout(FlowLayout.LEFT));add.addActionListener(this);update.addActionListener(this);delete.addActionListener(this);save.addActionListener(this);//add(add);//add(update);//add(delete);//this.addSeparator();//add(check);add(query);add(show);add(save);//add(querybar);}public JButton createButton(String imagePath,String name){final JButton button = new JButton(name);button.setContentAreaFilled(false);// 设置按钮透明button.setFont(new Font("粗体", Font.PLAIN, 12));// 按钮文本样式button.setMargin(new Insets(0, 0, 0, 0));// 按钮内容与边框距离ImageIcon image = new ImageIcon(imagePath); image.setImage(image.getImage().getScaledInstance(20,20,Image.SCALE_DEFAULT));button.setIcon(image);button.setHorizontalTextPosition(SwingConstants.CENTER);button.setVerticalTextPosition(SwingConstants.BOTTOM);button.setBorderPainted(false);button.addMouseListener(new MouseListener() {@Overridepublic void mouseReleased(MouseEvent e) {// TODO Auto-generated method stub}@Overridepublic void mousePressed(MouseEvent e) {// TODO Auto-generated method stub}@Overridepublic void mouseExited(MouseEvent e) {button.setBorderPainted(false);button.setBackground(new Color(191,239,255));}@Overridepublic void mouseEntered(MouseEvent e) {button.setBorderPainted(true);button.setBackground(new Color(191,230,250));}@Overridepublic void mouseClicked(MouseEvent e) {// TODO Auto-generated method stub}});return button;}@Overridepublic void actionPerformed(ActionEvent e) {if(e.getSource()==add){}if(e.getSource()==save){if(JOptionPane.showConfirmDialog(this, "是否要保存此数据表格", "保存数据", 2)==JOptionPane.YES_OPTION){//将table中的内容保存为Wordlong temp = System.currentTimeMillis();TableToWord.openWord("carDate\\车辆综合信息表"+ temp +".doc", CarInfEntity.width,"车辆综合信息表", CarInfEntity.title.length, CarInfEntity.title, data,0,0);try {String a ="carDate\\车辆综合信息表"+ temp +".doc";Runtime.getRuntime().exec("cmd /c \""+a+"\"");} catch (IOException e1) {// TODO Auto-generated catch blocke1.printStackTrace();}}}}}
}

写在最后

全部源码和详细文档,可以加博主微信交流:(Code2Life2)

这篇关于Java Swing+mysql实现的出租车计价器系统(车辆管理、司机管理、订单管理)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/766261

相关文章

Mysql虚拟列的使用场景

《Mysql虚拟列的使用场景》MySQL虚拟列是一种在查询时动态生成的特殊列,它不占用存储空间,可以提高查询效率和数据处理便利性,本文给大家介绍Mysql虚拟列的相关知识,感兴趣的朋友一起看看吧... 目录1. 介绍mysql虚拟列1.1 定义和作用1.2 虚拟列与普通列的区别2. MySQL虚拟列的类型2

详解Java如何向http/https接口发出请求

《详解Java如何向http/https接口发出请求》这篇文章主要为大家详细介绍了Java如何实现向http/https接口发出请求,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 用Java发送web请求所用到的包都在java.net下,在具体使用时可以用如下代码,你可以把它封装成一

在C#中获取端口号与系统信息的高效实践

《在C#中获取端口号与系统信息的高效实践》在现代软件开发中,尤其是系统管理、运维、监控和性能优化等场景中,了解计算机硬件和网络的状态至关重要,C#作为一种广泛应用的编程语言,提供了丰富的API来帮助开... 目录引言1. 获取端口号信息1.1 获取活动的 TCP 和 UDP 连接说明:应用场景:2. 获取硬

mysql数据库分区的使用

《mysql数据库分区的使用》MySQL分区技术通过将大表分割成多个较小片段,提高查询性能、管理效率和数据存储效率,本文就来介绍一下mysql数据库分区的使用,感兴趣的可以了解一下... 目录【一】分区的基本概念【1】物理存储与逻辑分割【2】查询性能提升【3】数据管理与维护【4】扩展性与并行处理【二】分区的

使用Python实现在Word中添加或删除超链接

《使用Python实现在Word中添加或删除超链接》在Word文档中,超链接是一种将文本或图像连接到其他文档、网页或同一文档中不同部分的功能,本文将为大家介绍一下Python如何实现在Word中添加或... 在Word文档中,超链接是一种将文本或图像连接到其他文档、网页或同一文档中不同部分的功能。通过添加超

windos server2022里的DFS配置的实现

《windosserver2022里的DFS配置的实现》DFS是WindowsServer操作系统提供的一种功能,用于在多台服务器上集中管理共享文件夹和文件的分布式存储解决方案,本文就来介绍一下wi... 目录什么是DFS?优势:应用场景:DFS配置步骤什么是DFS?DFS指的是分布式文件系统(Distr

NFS实现多服务器文件的共享的方法步骤

《NFS实现多服务器文件的共享的方法步骤》NFS允许网络中的计算机之间共享资源,客户端可以透明地读写远端NFS服务器上的文件,本文就来介绍一下NFS实现多服务器文件的共享的方法步骤,感兴趣的可以了解一... 目录一、简介二、部署1、准备1、服务端和客户端:安装nfs-utils2、服务端:创建共享目录3、服

SpringBoot使用Apache Tika检测敏感信息

《SpringBoot使用ApacheTika检测敏感信息》ApacheTika是一个功能强大的内容分析工具,它能够从多种文件格式中提取文本、元数据以及其他结构化信息,下面我们来看看如何使用Ap... 目录Tika 主要特性1. 多格式支持2. 自动文件类型检测3. 文本和元数据提取4. 支持 OCR(光学

Java内存泄漏问题的排查、优化与最佳实践

《Java内存泄漏问题的排查、优化与最佳实践》在Java开发中,内存泄漏是一个常见且令人头疼的问题,内存泄漏指的是程序在运行过程中,已经不再使用的对象没有被及时释放,从而导致内存占用不断增加,最终... 目录引言1. 什么是内存泄漏?常见的内存泄漏情况2. 如何排查 Java 中的内存泄漏?2.1 使用 J

JAVA系统中Spring Boot应用程序的配置文件application.yml使用详解

《JAVA系统中SpringBoot应用程序的配置文件application.yml使用详解》:本文主要介绍JAVA系统中SpringBoot应用程序的配置文件application.yml的... 目录文件路径文件内容解释1. Server 配置2. Spring 配置3. Logging 配置4. Ma