JTextArea - invisible characters

Hi together,
how can I make invisible characters like "carriage return", "line feed" or "tab" in JTextArea visible?
Some text editors can enable a feature, like
tab will be displayed as ->
carriage return will be displayed as CR
line feed will be displayed as LF
A.

RSyntaxTextArea has a method that toggles visibility of whitespace (spaces and tabs) but not newlines. You can make newlines "visible" by the code suggested above, but note that it inserts a real character at the end of each line. That means that it's really only a good solution for read-only documents.
The following should work:
textArea.setWhitespaceVisible(true);
textArea.setText(textArea.getText().replaceAll("\n", "\u00b6\n"));Note that the code snippet above must be done after the call to textArea.setSyntaxEditingStyle("whatever").

Similar Messages

  • How to show/hide invisible characters in Mac Keynote 6?

    How can I show/hide the invisible characters in Mac Keynote 6?

    we call them non printing characters
    this cant be displayed in Keynote, Keynote is a video based presentation application and does not have many typographic tools.
    The sister application to Keynote is Pages which can show non printing characters so you should use that;
    View > show > invisibles

  • Printing Invisible Characters...

    Good Morning:
    For training purposes, Is there a way to print the invisible characters in an InDesign document?
    I need to be able to show what characters are being used to demonstrate things like using the tab character, right indent tab character, indent to here, space, em space, etc...
    Please and thanks!
    Theresa

    Yes, Peter, you are correct. I need to be able to show examples of "good" and "less good" methods of typesetting. The screen capture works, but I was hoping to avoid taking all the screen shots. I would love to be able to print out a copy of the document with all of the invisible characters showing that I could demonstrate to our designers where the methods used could be improved. See example below:
    This is an example of a hanging indent being done using a "less than productive" method...
    Notice the manual line breaks followed by a tab character to create the indent on the next line. (GRRRRRR....)
    This is an example of a hanging indent being done using a “cleaned-up” method...
    By using the “Indent to Here” character after the first tab, all of the remaining lines in the paragraph will line up with that space
    regardless of the length of the line of text.
    This is just one of MANY examples that I have of mind-numbing methods that have been used.
    I know that in the Export to PDF dialog there is an option to include visible guides and baseline grids. I was hoping there was an option for "Print Invisible Characters".
    Thanks for all your help!!
    Theresa

  • CS4 Indesign: Invisible Characters...

    Hi
    I just updated my Suitcase Fusion 2 and I noticed my invisible characters are now a cross instead of a dot. Does anyone know if this is a preference checked that I can uncheck? Or does it have something to do with my current Suitcase Fusion 2?
    It just is annoying to view. Should I reinstall Suitcase Fusion 2?
    Thanks!

    Indent to here maybe?
    If not, indesignsecrets.com has a great (and free) guide of special characters in indesign. Site seems to be down right now but I guess adress is
    http://indesignsecrets.com/free-guide-to-indesign-special-characters.php

  • Unwanted Invisible Characters that muck up my HTML

    My problem is a bit tricky to describe so bare with me if I use the wrong terminology or am somewhat vague: I design an email, hand off the .psd file to my developer who codes my design into CSS and HTML. When we paste this code into our email deployment software we get an error message preventing us from pasting our code.
    We've located the problem: invisible characters hidden in the text inserted by Photoshop which my developer inadvertently copies when he copies and pastes text from the .psd file to the HTML file.
    We then have to fix this problem tediously to get the code cleaned up. Does anyone have any suggestions or experience with this issue?
    Thanks for the help!

    No, I will not 'bare' [sic] with you, as I'm not much for shared communal nudity; but I will gladly bear with you. 
    We'd need to see a sample file and your alleged extraneous characters, as well as examine whatever font(s) you are using.  Due to the current unavailability of clairvoyants and mind-readers in the forum, we respectfully request you supply sensible, complete details.
    BOILERPLATE TEXT:
    Note that this is boilerplate text.
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CS6", but something like CS6v.13.0.6) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    A screen shot of your settings or of the image could be very helpful too,
    etc.,
    someone may be able to help you (not necessarily this poster, who is not a Windows user).
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • Invisible characters going crazy!

    I have a problem that doesn’t go away, I am working happily in my InDesign document when suddenly all the invisible characters go crazy (see  BEFORE), the only solution that I have found is to restart InDesign and the invisible characters go back to normal (see AFTER), have any of you encounter this problem before?
    This happened in any document, being new, converted from an old version or re-open. I have deleted the preference of InDesign and it is still with me. I had snow leopard and it used to happened also, I went back to leopard (for other reasons) and it is still here. I am working with CS4 with the latest update (it happened from the start of CS4 6.0)
    Thank you for any advise
    BEFORE
    AFTER

    hi there
    thank you for the advice, unfortunately the problem is still happening, I work with suitcase fusion 2 so this could be the problem.
    I donwloaded the Onyx application and deleted the font cache and the problem was still happening so I tried this other method to delete the font cahe:
    "To clear the current user’s font cache, first quit all running applications (otherwise, you may see font oddities after using the command), then open Terminal (in Applications -> Utilities) and run this command:
    atsutil databases -removeUser
    If you want to remove the font cache for all users, use this command, and provide your admin password when asked:
    sudo atsutil databases -remove
    Once you’ve cleared the caches, you should stop and restart the ATS server with these commands:
    $ atsutil server -shutdown
    $ atsutil server -ping
    It will take a second or two for the server to restart, but when it does, you should be good to go. If anything still looks odd, a logout and login should take care of any lingering issues."
    the problem stopped for almost 2 weeks, I thought this was it but it started to happen again.
    Definitely, it is a problem with the cache, maybe it got corrupted again.
    thank you again for your help.

  • Invisible characters

    Hi,
       My client doesn't want to clean the data, there are invisible characters(eg. ASCII code 01,08,09 ...) in the data, can I setup something in BI 7.0 and allow these characters into ODS and activate it?
      Thanks.

    Hi,
    The invisible characters which are nothing but the hex codes can not be allowed into the BW system. However you can avoid the error by checking them in the transfer routine and replacing them with an allowed character...
    Read the SDN blogs below which will give you as idea about what can be allowed & waht can not be:
    Invalid characters in SAP BW 3.x: Myths and Reality. Part 2.
    Invalid characters in SAP BW 3.x: Myths and Reality. Part 1.
    Regards,
    Shilpa

  • In Pages, how to search and replace text involving invisible characters?

    In Pages documents, how to search and replace text involving invisible characters, colors and font sizes—a task which is so easy in Mircosoft Word?

    I read that an older version of Pages allowed users to enter special characters in the search/replace fields, but this did not work for me.
    Here: http://www.macworld.com/article/1156533/pagesspecialcharacters.html
    I still am looking for a way to do this.

  • How do I make a JTextArea invisible to the mouse?

    Consider the applet below. There is a small JTextArea sitting in the glass pane. There are 3 JButtons sitting in a JPanel that is sitting in the content pane. One is completely under the JTextArea, one is half in and half out, & the last is completely outside it (at least I hope thats what it looks like on your machine.) The idea is when you click the disable button the JTextArea is disabled and you can click on the button that's underneath it.
    But it doesn't work that way. even when the JTextArea is disabled the mouse still cant click through it.
    Is there some way to make the JTextArea completely invisible to the mouse so I can click through it? I know setVisible(false) on the glass panel will work but I only want it to be invisible to the mouse, not my eyes.
    Thanks.
    /*  <applet code="MyTest14" width="400" height="100"></applet>  */
    // testing glass panes
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import javax.swing.*;
    public class MyTest14 extends JApplet implements MouseListener
    TextPanel textPanel;
    JPanel buttonPanel;
    JButton underButton, enableButton, disableButton;
    JTextArea jta;
    public void init()
      Container contentPane = getContentPane();
      contentPane.setLayout(new FlowLayout());
      contentPane.setBackground(Color.WHITE);
      underButton = new JButton("Under textarea");
      underButton.addMouseListener(this);
      enableButton = new JButton("Enable textarea");
      enableButton.addMouseListener(this);
      disableButton  = new JButton("Disable textarea");
      disableButton.addMouseListener(this);
      buttonPanel = new JPanel(new BorderLayout());
      buttonPanel.add(underButton, "West");
      buttonPanel.add(enableButton, "Center");
      buttonPanel.add(disableButton, "East");
      jta = new JTextArea();
      jta.setPreferredSize(new Dimension(200,80));
      jta.setOpaque(false);
      jta.setLineWrap(true);
      jta.setWrapStyleWord(true);
      textPanel = new TextPanel();
      textPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
      textPanel.add(jta);
      jta.setBorder(BorderFactory.createLineBorder(Color.black));
      contentPane.add(buttonPanel);
      setGlassPane(textPanel);
      textPanel.setVisible(true);
    public void mouseClicked(MouseEvent e)
      if (e.getSource() == enableButton) { jta.setEnabled(true); }
      else if (e.getSource() == disableButton) { jta.setEnabled(false); }
      else if (e.getSource() == underButton) { System.out.println("You reached the under button!"); }
    public void mouseExited(MouseEvent e) {}
    public void mouseEntered(MouseEvent e) {}
    public void mouseReleased(MouseEvent e) {}
    public void mousePressed(MouseEvent e) {}
    class TextPanel extends JPanel
      public TextPanel()
       super();
       setOpaque(false);
      public void paintComponent(Graphics g) { super.paintComponent(g); }
    }

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Test extends JFrame {
      Container content = getContentPane();
      JButton jb = new JButton("Press"), disenable = new JButton("Enable");
      JTextArea jta = new JTextArea("Now is the time for all google men to come to the aid of their browser");
      public Test() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JPanel jp = new JPanel();
        content.add(jp, BorderLayout.CENTER);
        jp.add(jb);
        jb.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent ae) { System.out.println("Click!"); }
        jta.setLineWrap(true);
        jta.setWrapStyleWord(true);
        jta.setOpaque(false);
        jta.setEnabled(false);
        JScrollPane jsp = new JScrollPane(jta);
        jsp.setOpaque(false);
        jsp.getViewport().setOpaque(false);
        jsp.setPreferredSize(new Dimension(130,130));
        JPanel glass = (JPanel)getGlassPane();
        glass.add(jsp);
        glass.setVisible(true);
        jta.addMouseListener(new MouseListener() {
          public void mouseReleased(MouseEvent me) { mousy(me); }
          public void mouseClicked(MouseEvent me) { mousy(me); }
          public void mouseEntered(MouseEvent me) { mousy(me); }
          public void mouseExited(MouseEvent me) { mousy(me); }
          public void mousePressed(MouseEvent me) { mousy(me); }
        content.add(disenable, BorderLayout.SOUTH);
        disenable.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent ae) {
            jta.setEnabled(!jta.isEnabled());
            disenable.setText(jta.isEnabled()?"Disable":"Enable");
        setSize(200,200);
        setVisible(true);
      void mousy(MouseEvent me) {
        if (jta.isEnabled()) return;
        Point p = SwingUtilities.convertPoint((Component)me.getSource(), me.getPoint(), content);
        Component c = content.findComponentAt(p);
        if (p!=null) c.dispatchEvent(SwingUtilities.convertMouseEvent((Component)me.getSource(), me, c));
      public static void main(String[] args) { new Test(); }
    }

  • Changing invisible characters in password fields for Chromium

    This really may sound trivial, but I like those big dots instead of the regular tiny ones, and I'm annoyed by the fact that I've managed to do it for Firefox, unlike Chromium, by putting these lines inside of my .gtkrc-2.0.
    style "entry"
    GtkEntry::invisible-char = 0x2B24
    class "GtkEntry" style "entry"
    So, where does Chromium look for its character set definitions?
    Thanks!
    Last edited by abraxyz (2013-07-27 11:36:11)

    Great suggestion! I've just tried, but not sure if it's possible to target (switch) those very characters with css. Something like:
    input[type="password"] {
    color: red;
    works just fine. But how do I enter the big dots (black circles)?

  • Show invisible characters?

    There is no option to show invisibles as far as I can see. Why is this?
    I am re-designing a website. The client has no text to supply so I'm having to copy and paste the text from his old website. To be able to show invisibles would be good.

    we call them non printing characters
    this cant be displayed in Keynote, Keynote is a video based presentation application and does not have many typographic tools.
    The sister application to Keynote is Pages which can show non printing characters so you should use that;
    View > show > invisibles

  • Invisible characters on webpages

    Since upgrading to Snow Leopard, I've noticed a couple of pages where some random text is invisible. It's there because I can select it and paste it somewhere else and then see it. It's not white on white because I can't see it when I highlight it. Here's a screenshot of what I'm talking about. I circled the problem in red:
    http://homepage.mac.com/abramr/Sites/missingtextscreenshot.jpg
    Also, while I'm posting screenshots, I've had a double search field box on this page (Apple Discussions) for a long time. Anyone know why?
    Here's a picture:
    http://homepage.mac.com/abramr/Sites/doubletextbox.jpg
    Thanks,
    Rob

    Here's another example. It's from mathforum.org. The letters aren't just missing, they're only certain letters, but not the real letters. I copied and pasted most of the page to text edit and it looks fine.
    webpage: http://homepage.mac.com/abramr/Sites/mathforumdotorg.jpg
    text file: http://homepage.mac.com/abramr/Sites/mathforumdotorg.txt
    screenshot from textedit: http://homepage.mac.com/abramr/Sites/mathforumdotorgtxt.jpg
    I posted the text file, but when I view it in my browser, it looks the same as the webpage did. The screenshot shows what I see in text edit. This is really weird.
    Thanks for helping,
    Rob

  • Font characters not displaying in certain contexts?

    I'm using this free font called 'Love Ya Like A Sister' to make a nature calendar. I'm including brief descriptions of the animals in the calendar, and when I typed 'Copperband Butterflyfish' for the last description, the 'fl' and 'fi' in 'Butterflyfish' just... disappeared.
    It's not like the characters just turned transparent, because the space where the characters should be is not wide enough for the characters if they were there.
    I thought it might be some kind of contextual alternate thing with Opentype, because the f characters showed up fine until I typed the next character (i.e. the 'l' and the 'i'), but the font isn't an Opentype font and I deselected 'contextual alternates' anyway and the problem still occurred.
    It's not like it's a rule for all characters following an 'f' either, because I've tried typing other characters after the f's and they show up like they should.
    This led me to think it could be a problem with the font itself, considering it was free. But I went to the webpage I downloaded it from and used their sample generator to generate 'Butterflyfish' and all of the characters showed up fine in the generated image.
    Here is a screenshot of my InDesign document with the missing characters, and a link to the page I downloaded the font from. I've used 'next style' with the three paragraph styles shown, if that might have contributed to my problem. If I highlight the invisible characters and change the font, the characters show up.
    Any help is much appreciated
    http://www.dafont.com/love-ya-like-a-sister.font

    the font isn't an Opentype font and I deselected 'contextual alternates' anyway ...
    The use of ligatures (as 'fi' and 'fl' are called officially) is not limited to OpenType fonts. InDesign is smart enough to recognize 'fi' and 'fl' glyphs (character images) in other font types. In essence, it just looks for a character named "fi" or "fl" (in a Type 1 font), and/or in the Unicode position of the two characters (U+FB01 and U+FB02, if memory serves) in the character map (in a TrueType font). However, it blindly assumes that if there is something there, the image is the right character -- and it can do no more than that. So it seems the font designer included blank glyphs for those two characters.
    Contextual alternates are only available in true OpenType fonts. Since this font is not an OTF type, these characters fall under 'ligatures'; and, indeed, if you disable ligatures instead, you will see your effs and ees return.

  • How do I correct invisibles? They are all showing up as squares

    All of a sudden Pages displays squares that are not aligned with the text instead of the normal invisible characters. I have deleted all the plist files, and that didn't fix it.
    Apple is chasing iCloud butterflies and it is obvious from their neglect of Pages that they have scheduled it for the guillotine in favor of iCloud Pages Jr., which is trendy but has a stunted feature set.  I use Pages daily to prepare printed documents, so I am already in mourning for my favorite word processor, whose absence diminishes the usefulness of my Mac. So I appeal to my fellow orphans for help.

    Could you supply a screenshot of the document?

  • Weird characters appear after write to a file

    Here is my story:
    I open a file using RandomAccessFile to replace some characters inside it. Let's say I have in the file string 4000, I replace it by string 400. It works fine.
    Now if I replace this number by string 40000, when I check the text file, some weird characters like ^M appear everywhere at the end of lines.
    What's the reason and how to solve it? I believe there is some invisible characters at the end of string 4000 that causes the problem.
    Note that I use function writeBytes to write strings into the file.

    public static void changeFileRAF(String sFile, String paramName, String paramValue) {
    try {
    RandomAccessFile rf = new RandomAccessFile(sFile, "rws");
    String currentLine;
    long pos;
    while (true) {
    pos = rf.getFilePointer();
    currentLine = rf.readLine();
    if (currentLine == null)
    break;
    if (currentLine.trim().startsWith(paramName)) {
    rf.seek(pos);
    char[] replaceLine = currentLine.toCharArray();
    char[] value = paramValue.toCharArray();
    int i = 0;
    //pass all white space characters
    while (i < replaceLine.length && Character.isWhitespace(replaceLine)) {
    i++;
    //pass all characters representing tag name
    while (i < replaceLine.length && !Character.isWhitespace(replaceLine[i])) {
    i++;
    //again, pass all white space characters
    while (i < replaceLine.length && Character.isWhitespace(replaceLine[i])) {
    i++;
    if (i == replaceLine.length) {//no value, do nothing                                                           
    return;
    int oldValueLength = replaceLine.length - i;
    String newLine = System.getProperty("line.separator");
    if (oldValueLength >= value.length) {
    System.out.println("different: " + (oldValueLength - value.length));
    for (int j = 0; j < value.length; j++)
    replaceLine[j + i] = value[j];
    for (int j = value.length; j < oldValueLength; j++)
    replaceLine[j + i] = ' ';
    rf.writeBytes(String.copyValueOf(replaceLine));
    else {
    System.out.println("old value length: " + oldValueLength);
    System.out.println("new value length: " + value.length);
    char[] compensation = new char[value.length - oldValueLength];
    for (int j = 0; j < oldValueLength; j++)
    replaceLine[j + i] = value[j];
    for (int j = oldValueLength; j < value.length; j++)
    compensation[j - oldValueLength] = value[j];
    System.out.println("it is " + String.copyValueOf(replaceLine) + String.copyValueOf(compensation));
    rf.writeBytes(String.copyValueOf(replaceLine) + String.copyValueOf(compensation));
    break;
    rf.close();
    } catch (IOException e) {
    System.out.println(e.getMessage());
    I hope it's not too long.

Maybe you are looking for