打印按钮监听事件
printBut.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
printerImage();
}
});
// 打印图片
private void printerImage() {
int row = filenametable.getSelectedRow();
if (row >= 0) {
WDBImageRadar imagstatel = contenes.get(row);
byte[] congtent = imagstatel.getContent();
if (congtent != null) {
Image image = null;
image = imagePane.getImage();
BufferedImage bufferedImage = convertImageToBuffer(image);
if (bufferedImage != null) {
PrintImage printImage = new PrintImage(bufferedImage);
}
}
}
}