I am trying to print through java on dot matrix printer with custom page size height 10 inches by 6 inches width. It is working fine on laser printer, but on dot matrix printer after printing 10 inches next page gets skipped around 3 inches more.
Asked
Active
Viewed 723 times
0
-
21- Make sure that your `setDefaultCloseOperation` isn't set to `JFrame.EXIT_ON_CLOSE`, `HIDE_ON_CLOSE` would be more appropritate. From there, simply call `setVisible(false)` on the frame to hide it. – MadProgrammer Apr 12 '13 at 06:18
-
There is no such thing as a jform. Please copy/paste these things instead of making them up. – Andrew Thompson Apr 12 '13 at 06:31
-
@MadProgrammer *"`HIDE_ON_CLOSE` would be more appropritate"* Or `DISPOSE_ON_CLOSE` as seen [here](http://stackoverflow.com/questions/7143287/how-to-best-position-swing-guis/7143398#7143398). But see also [The Use of Multiple JFrames, Good/Bad Practice?](http://stackoverflow.com/a/9554657/418556) – Andrew Thompson Apr 12 '13 at 06:44
-
@AndrewThompson It's difficult to ascertain what the intentions of the OP actually is, but yes `DISPOSE_ON_CLOSE` would also be a valid option. – MadProgrammer Apr 12 '13 at 06:47
-
On click at jbutton action is performed. i am calling system.exit(0) in this button action performed. i dont want to close my application. i want to jst hide that form. – Chaitanya Gadam Apr 12 '13 at 07:09
-
*"..i am calling system.exit(0) in this button action performed."* Did you read the JavaDocs for [`System.exit(n)`](http://docs.oracle.com/javase/7/docs/api/java/lang/System.html#exit%28int%29)? *"Terminates the currently running Java Virtual Machine.."* Don't you think you should remove that line of code?!? For better help sooner, post an [SSCCE](http://sscce.org/). – Andrew Thompson Apr 12 '13 at 07:26
-
@AndrewThompson i removed it. but i want to hide it after task is performed. How do i do that? – Chaitanya Gadam Apr 12 '13 at 09:06
-
*For better help sooner, post an [SSCCE](http://sscce.org/).* – Andrew Thompson Apr 12 '13 at 09:43