<p>Does anyone knows how to detect printable characters in java?</p>

<p>After a while ( trial/error ) I get to this method:</p>

<pre><code>    public boolean isPrintableChar( char c ) {
        Character.UnicodeBlock block = Character.UnicodeBlock.of( c );
        return (!Character.isISOControl(c)) &amp;&amp;
                c != KeyEvent.CHAR_UNDEFINED &amp;&amp;
                block != null &amp;&amp;
                block != Character.UnicodeBlock.SPECIALS;
    }
</code></pre>

<p>I'm getting the input via KeyListener and come Ctr-'key' printed an square. With this function seems fairly enough. </p>

<p>Am I missing some char here?</p>

I'm not perfectly sure whether I understand your problem. But if you want detect if character can be drawn to Graphics object, and if not print some placeholder char you might find usefull:
```
```
Font.canDisplay(int)
```
```
It will check whether font can display specific codepoint (it is more that check whether font is displayable at all -- since there are chars that are displayable - like ą - but some fonts cant display them.