• 大小: 3.92MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-10
  • 语言: Java
  • 标签: rfid  java  

资源简介

用java实现对rfid的读写,是一个关于一卡通充值和消费的代码。

资源截图

代码片段和文件信息

import java.awt.EventQueue;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import javax.swing.ImageIcon;
import javax.swing.Jframe;
import javax.swing.GroupLayout;
import javax.swing.Timer;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.Layoutstyle.ComponentPlacement;
import javax.swing.JButton;

import org.xvolks.jnative.exceptions.NativeException;
import org.xvolks.jnative.pointers.Pointer;
import org.xvolks.jnative.pointers.memory.MemoryBlockFactory;

import com.syc.function.Function;

public class Add extends Jframe{
private JTextField no;
private JTextField value;
private JLabel add;
private Timer timer;
private JButton right;
private JButton cancle;

public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Add frame = new Add();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}


public Add() {
setDefaultCloseOperation(Jframe.EXIT_ON_CLOSE);
setBounds(100 100 450 300);

JLabel labelno = new JLabel(“\u5361\u53F7\uFF1A“);

no = new JTextField();
no.setColumns(10);

JButton buttonread = new JButton(“\u8BFB\u5361“);
buttonread.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
    timer = new Timer(1000 taskPerformer);  
        timer.start();  
}
});

JLabel labelvalue = new JLabel(“\u4F59\u989D\uFF1A“);

value = new JTextField();
value.setColumns(10);

JLabel labeladd = new JLabel(“\u5145\u503C\uFF1A“);

right = new JButton(“\u786E\u5B9A“);
right.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
initvalue();
}
});

cancle = new JButton(“\u53D6\u6D88“);
cancle.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
timer.stop();
}
});

JLabel add = new JLabel(“100“);


GroupLayout groupLayout = new GroupLayout(getContentPane());
groupLayout.setHorizontalGroup(
groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addGap(43)
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addComponent(labelvalue)
.addPreferredGap(ComponentPlacement.UNRELATED)
.addComponent(value 157 157 157))
.addGroup(groupLayout.createSequentialGro

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-07-05 19:59  RFID\
     目录           0  2018-07-05 19:59  RFID\JavaUsbDemo-Chinese\
     文件         603  2017-10-31 09:43  RFID\JavaUsbDemo-Chinese\.classpath
     文件         374  2017-10-31 09:43  RFID\JavaUsbDemo-Chinese\.project
     目录           0  2018-07-05 19:59  RFID\JavaUsbDemo-Chinese\.settings\
     文件         132  2017-10-31 09:43  RFID\JavaUsbDemo-Chinese\.settings\org.eclipse.core.resources.prefs
     文件         587  2017-10-31 09:43  RFID\JavaUsbDemo-Chinese\.settings\org.eclipse.jdt.core.prefs
     目录           0  2018-07-05 19:59  RFID\JavaUsbDemo-Chinese\bin\
     文件         586  2018-07-05 19:03  RFID\JavaUsbDemo-Chinese\bin\Add$1.class
     文件         662  2018-07-05 19:03  RFID\JavaUsbDemo-Chinese\bin\Add$2.class
     文件         844  2018-07-05 19:03  RFID\JavaUsbDemo-Chinese\bin\Add$3.class
     文件         584  2018-07-05 19:03  RFID\JavaUsbDemo-Chinese\bin\Add$4.class
     文件         656  2018-07-05 19:03  RFID\JavaUsbDemo-Chinese\bin\Add$5.class
     文件        8270  2018-07-05 19:03  RFID\JavaUsbDemo-Chinese\bin\Add.class
     目录           0  2018-07-05 19:59  RFID\JavaUsbDemo-Chinese\bin\com\
     目录           0  2018-07-05 19:59  RFID\JavaUsbDemo-Chinese\bin\com\syc\
     目录           0  2018-07-05 19:59  RFID\JavaUsbDemo-Chinese\bin\com\syc\function\
     文件        4260  2018-07-05 16:28  RFID\JavaUsbDemo-Chinese\bin\com\syc\function\ChangeBytesToNumber.class
     文件       12311  2018-07-05 16:28  RFID\JavaUsbDemo-Chinese\bin\com\syc\function\Function.class
     文件        6579  2018-07-05 16:28  RFID\JavaUsbDemo-Chinese\bin\DBUtil.class
     文件         610  2018-07-05 16:28  RFID\JavaUsbDemo-Chinese\bin\EPCRead$1.class
     文件        1684  2018-07-05 16:28  RFID\JavaUsbDemo-Chinese\bin\EPCRead$2.class
     文件        1173  2018-07-05 16:28  RFID\JavaUsbDemo-Chinese\bin\EPCRead$3.class
     文件        1422  2018-07-05 16:28  RFID\JavaUsbDemo-Chinese\bin\EPCRead$4.class
     文件        1273  2018-07-05 16:28  RFID\JavaUsbDemo-Chinese\bin\EPCRead$5.class
     文件         724  2018-07-05 16:28  RFID\JavaUsbDemo-Chinese\bin\EPCRead$6.class
     文件        8687  2018-07-05 16:28  RFID\JavaUsbDemo-Chinese\bin\EPCRead.class
     文件       12842  2018-07-05 16:28  RFID\JavaUsbDemo-Chinese\bin\EpcSDKDll.class
     文件        3518  2018-07-05 16:28  RFID\JavaUsbDemo-Chinese\bin\EpcSDKMain.class
     文件         783  2018-07-05 16:28  RFID\JavaUsbDemo-Chinese\bin\mainWindow$1.class
     文件        4050  2018-07-05 16:28  RFID\JavaUsbDemo-Chinese\bin\mainWindow$10.class
............此处省略139个文件信息

评论

共有 条评论