Skip to content

Commit

Permalink
included finally for dispose handling
Browse files Browse the repository at this point in the history
Corrected to space standard with Tab,
Applied finally sentence since dispose and clear action are required in
any case
  • Loading branch information
mmadrigalac committed Oct 30, 2014
1 parent 7530633 commit a50a44d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions qz-print/src/qz/PrintHTML.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ private String[] getHTMLDataArray() {
// return super.getText();
//}

public void print() throws PrinterException {
public void print() throws PrinterException {
JFrame j = new JFrame(jobName.get());
j.setUndecorated(true);
j.setLayout(new FlowLayout());
this.setBorder(null);

try{
for (String s : getHTMLDataArray()) {
this.setText(s + "</html>");
Expand All @@ -113,14 +113,14 @@ public void print() throws PrinterException {
job.print(attr);
j.setVisible(false);
}
}
catch(PrinterException e){
throw e;
}

finally{
j.dispose();
clear();
}
catch(Exception e){
j.dispose();
clear();

throw new PrinterException(e.toString());
}
}

Expand Down

0 comments on commit a50a44d

Please sign in to comment.