生成文件名、消息提示
This commit is contained in:
parent
20dc2d6bec
commit
d7976e7aa9
@ -37,6 +37,8 @@ import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.Icon;
|
||||
@ -160,7 +162,12 @@ public final class GUIRunner extends JFrame implements ActionListener {
|
||||
BitMatrix bitMatrix;
|
||||
String str=textArea2.getText();
|
||||
String user_dir=System.getProperty("user.dir");
|
||||
String path=user_dir+"\\qr.png";
|
||||
//long timestamp=System.currentTimeMillis();
|
||||
SimpleDateFormat sfd=new SimpleDateFormat ("yyyy-MM-dd-hh-mm-ss");
|
||||
String timestamp=sfd.format(new Date());
|
||||
|
||||
|
||||
String path=user_dir+"\\qr-"+timestamp+ ".png";
|
||||
try {
|
||||
bitMatrix = new MultiFormatWriter().encode
|
||||
(str, BarcodeFormat.QR_CODE, 200, 200);//ͼƬ´óС
|
||||
|
Loading…
Reference in New Issue
Block a user