📄 swingtest.java
字号:
import com.mask.util.barcode.BarCode;
import javax.swing.*;
import java.awt.*;
public class SwingTest extends JFrame {
BarCode barcode;
public void test() {
show();
barcode.print(getGraphics());
setSize(barcode.getSize().width + 5, barcode.getSize().height + 25);
}
public SwingTest() {
super("EAN13");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel pane = new JPanel();
pane.setLayout(new BorderLayout());
barcode = new BarCode();
barcode.code = "6901010101098";
barcode.barType = BarCode.EAN13;
pane.add("Center", barcode);
setContentPane(pane);
}
public static void main(String[] arg) {
new SwingTest().test();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -