Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JEditorPane code functions unpredictably  RSS feed

Matthew Alesi
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am writing a very simple GUI program to take txt output from a scientific data-collecting app and transform it into a decent looking table. My program reads the txt file, writes a new temporary HTML file based on the txt data, and opens this HTML file in a JEditorPane, where it is rendered correctly and can easily be printed using editorPane.print(). The code that adds the print button is shown below:

The problem is that this program works perfectly on the machine on which I coded it, but fails to bring up a print dialog on the other Windows machines I want to use it with, and on my PowerBook as well. No PrinterException is thrown or anything; the print dialog just never comes up, and the event operation completes, as is indicated by the Print button becoming immediately available once again.

Can any Swing people tell me what might be wrong with my code? To anybody who has sat through this long explanation, I really appreciate it and thanks very much!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!