printing in java; missing spaces
I'm trying to print a swing component to paper. It's basically an extended JPanel which hosts (among other things) multiple JTextFields. These fields look correct when viewed on the screen, but when printed to paper, the text in the fields is not printed correctly... in some fields, the spaces in between words is quite large, in other fields, it is like there are no spaces at all; every word is jammed right beside the previous word.
I've checked and double / triple checked the component, and the fields all definitely have spaces in them... looks 100% correct when viewed on the screen, just prints incorrectly.
I've played with the FRACTIONALMETRICS hints in the Graphics class, as well as antialiasing and a few other rendering hints, and nothing has any effect on what I'm seeing.
Printing to other printers also has no effect, and this problem appears on Sun's JVM in both windows + linux. Switching fonts will just shuffle which textfields the problem occurs in, but doesn't actually solve the problem.
Re: printing in java; missing spaces
Can you post a short snippet of code that reproduces the problem? Never encountered this problem, but I am guessing this might have to do with the width of each component and the printing trying to jam all those words into a small space. A small self contained example might help test this