applet方式实现TSC打印条码功能。
applet方式打印实现复杂,最大的优点就是不用注册 dll 控件,不过现在最新的浏览器已经不支持java了,不建议使用,以下内容仅供参考。
说明:
1、applet使用复杂,不建议使用。
2、需要浏览器支持java,也就是支持jre即可。
3、js的实现方式见另一篇文章。
4、TSC applet和js打印测试包(包含打印机驱动、打印插件、applet和js调试代码),https://www.xinac.com/article/223.html
5、有问题请尽量发邮件,10513276@qq.com
JButton button;
String image_path = "/images/img.jpg";
private String title = "xxxxxxxxxxxxxx";
public void init() {
ImageIcon image = new ImageIcon(this.getClass().getResource(this.image_path));
button = new JButton(image);
button.addActionListener(this);
this.getContentPane().add(button);
}
@Override
public void actionPerformed(ActionEvent arg