How to hide the Form Feed char in JTextArea

10-11  Source: Network gathering  Views:3 

Advertisement
We have reports (written in C) that are being displayed in a JTextArea.
In our old app, the Form Feed character (ASCII 12) was invisible naturally without having to code around it. In a JTextArea, it appears as a "[]" character. Does anyone know how to make this character invisible to the JTextArea? Removing it is not an option, as it is needed for it's print routine.
I've been searching these forums and the web all morning with no luck.
Not sure how the Form Feed character worksIt lets the printer know that a new page is to be started at that point.
Does it always appear with the New Line character?Usually but not always.
Thanks for the reply. It's more involved than just printing standard lines of text, so perhaps I should have been more clear.
The C report already has pagination built in from when it was run from our legacy GUI. In other words, each report knows how many chars wide and how many lines down each page will be. It is different for each report, but they all hover around 150 chars wide and 60 lines down per page, since they are all presented to the user (and printed) in landscape.
In the C code: at the end of each report line a "\n" is appended. At the end of each page, an ASCII 12 character is appended. A header is at the top of each page (different for each report, but usually 2 or 3 lines) that shows the page # and other info.
So, as you are viewing the report, you would see page 1 header, some report content, page 2 header, some more report content, page 3 header, etc. as you scroll down.
So now if you view it in Java: if the user wishes to print, the report is sent to our ReportPrinter class, who tokenizes the report based on "\f" and makes a ReportPage object (implements Printable) for each token. Each ReportPage is then appened to a java.awt.print.Book object, who in turn is sent to the PrinterJob.
Given that the report already has his pages figured out and has a form feed char at the end of each page, the report comes in to the JTextArea with [] chars preceding each page header (approximately every 60th line, depending on the report).
I tried using a JTextPane, but no luck. It was also much slower reading in the report. I just want the textpane to not display the non-printable characters ("\f" in this case).
Related articles
  • How to hide the Form Feed char in JTextArea 10-11

    We have reports (written in C) that are being displayed in a JTextArea. In our old app, the Form Feed character (ASCII 12) was invisible naturally without having to code around it. In a JTextArea, it appears as a "[]" character. Does anyone know

  • How to get the first 4 chars form a var ? 10-11

    Hi guys, How to get the first 4 chars form a var ? i.e  temp type num20 value '00000000000012345678'. how to move the first 4 chars to another var? thx in advance.hi use OFFESTS.. example: var1 = '12345678'. var2 = var1+0(4). now var2 conatins '1234'

  • How to Hide the Parameter field at run time.... 11-30

    Hi, I have a parameter field which behaves differently depending on the User logged in. It has the LOV coming from following SQL. SELECT customer_name FROM Cust_mast; If the user = 'INTERNAL' then the Where clause will be WHERE cust_id in('DELL', 'SB

  • How to hide the fileds 11-30

    how to hide the fileds in a form for one activity and how to display the same fields to another activity? in the same process Edited by: jaya on Aug 9, 2010 10:07 PM Edited by: jaya on Aug 9, 2010 10:40 PMInside of the screenflow, you can determine t

  • How to hide the pricing conditions specified in pricing procedure of sd. 10-11

    dear friends, my situation is to hide the conditions specified in the pricing procedure. so that it is not viewed by the some users.can you please tell me how to hide the conditions. so some of the persons, who are having authorization to see the con

  • Question on how to Hide the User Name, Password, and Domain fields in the MDT Wizard 10-11

    MDT 2012 U1 Deploying Windows 7 via Offline Media (ISO) to MS Virtual PC's I am looking on how to Hide the User Name, Password, and Domain fields which are prepopulated in the MDT wizard via the CS.ini (Not so concerned about the Domain field as I am

  • How to run the form that is only installed on a PC and not using a server? 10-11

    Hi I am new to Oracle and have taken the forms class. But I do not understand how to run the form from my PC using XP windows. (Do not have access to a server). I have started the OC4J, made sure the listener was started, compiled the form and then w

  • How to hide the data in particular table in oracle 10g 10-11

    How to hide the data in particular table in oracle 10g i want stepsIf its on Report u can  always hide the column - Keyfigure or Selection - Display - Hide......y do u want to have it on the report if it is to be hided in the first place?Read other 4

  • How to put the form in Query mode 10-11

    Hello Please let me know how to put the form or block in Query mode , so that when i run the form it should be in Query mode . I have seen properties of SET_FORM_PROPERTY and SET_BLOCK_PROPERTY but cannot find one ThanksQUERY mode? Did you mean, that

  • How to hide the field from the view in the webdynpro application? 10-11

    Hi Gurus, I got a requirement where in which ,default layout has the field name Time.......To......... which is (2 input box ) and one lable assigned to the container......... Now my requirement is to hide this field from the layout for all cases of

  • How to get the form reference in .js page from .jsp page 10-11

    hi i have written one form in jsp page omething like:- <html:form action="/shopping" onsubmit="return false;"> can anybody tell me,how to get the form reference in .js page from .jsp page , i have tried:- var formRef = document.f

  • How to populate the form bean object for multiselect box in struts 10-11

    hi, i am using two multi select boxes,one to populate the data by getting from the data base and another to fill the items selected from the first select box to store the values in the database..i need the information (how to declare the select boxes

  • How to hide the view latest instance option for the reports in XIR3 10-11

    Created an access level and denied the rights "view document instances" and "view document instances that the user owns" in the access level. Applied this access level for a particular group on a particular folder. Login to Infoview an

  • How to hide the select-options fields on radiobutton select in webdynpro 10-11

    hi Could you please help how to hide the select-option fields in webdynpro there are four radio buttons for every radiobutton there is corresponding the select_option filed is associated to it user as only provision select  one radio button and reset

  • How to hide the PORT NUMBER from the URL 10-11

    Hi, We have Application on Node 1 and Database on Node 2 Apps Version: 11.5.10.2 DB: 9.2.0.6 We recently added a new node to act as web server for iSupport. Now we are able to access the url using public Ip-address which looks like http://<Internet I

  • How to hide the menus in Weblogic Portal? 10-11

    I have to develop a page in Weblogic Portal 10.0 that uses a portlet for the UI presentation. I have a requirement that the page is hidden by default. When I navigate to the page by selecting a link, I have to display the contents in that page. While

  • How to hide the file name (the bizarre number assigned by the camera) when exporting an image version in aperture from an album. Pl understand I want to keep the file name in the project library version. 10-11

    how to hide the file name (the bizarre number assigned by the camera) when exporting an image version in aperture from an album. Pl understand I want to keep the file name in the project library version.Within Aperture you have Images, which are cons

  • How to check the form name in S_P00_07000134 10-11

    hi all, could you please tell me how to check the form name when get the print preview using T-code S_P00_07000134. i tried to active SE71, but when executing S_P00_07000134, click on print preview, it doesn't go to debugging. please help me with the

  • How-to hide the portal file shares on Windows 10-11

    Hi, Does anybody know how to hide the default file shares created by SAP NW 04 in windows? In other words: what I'm trying to accomplish is renaming the sapmnt share and saploc share (both on the E:\usr\sap\ folder) to sapmnt$ and saploc$. I know how

  • How to hide the title of a region or a region without a title? 10-11

    Hi All, I am desperate to align 4 regions on a report page in my Apex app. I need 4 empty HTML regions, I am creating a table (please refer to this tutorial http://www.apex-blog.com/oracle-apex/how-to-align-regions-on-a-page-10.html). I don't know ho