![]() |
Re: printing textarea & removing \n
Kyle Walz wrote:
> > What should I replace \n with when printing a textarea? Want to > remove or replace [] (the box representing \n) with whatever tells the > printer to go to the next line. The app uses Swing and I use JB7 with > 1.3.1. > > String texttoprint = ta.getText(); > texttoprint.replace('\n',' '); // <-- need improvement here > g2.setPaint(Color.black); > g2.drawString(texttoprint, 96, 144); Try \r\n. I think \n should work too, but it probably depends on your printer. |
Re: printing textarea & removing \n
Daniel Sjöblom wrote:
> > Kyle Walz wrote: > > > > What should I replace \n with when printing a textarea? Want to > > remove or replace [] (the box representing \n) with whatever tells the > > printer to go to the next line. The app uses Swing and I use JB7 with > > 1.3.1. > > > > String texttoprint = ta.getText(); > > texttoprint.replace('\n',' '); // <-- need improvement here > > g2.setPaint(Color.black); > > g2.drawString(texttoprint, 96, 144); > > Try \r\n. I think \n should work too, but it probably depends on your > printer. Oh, and you probably want to use the replaceAll method instead of replace. |
Re: printing textarea & removing \n
Thanks for the tips. :)
I'll try my own replace method. Haven't checked if JBuilder 8 is free yet--no money to spend. |
| All times are GMT. The time now is 02:29 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.