1

I want to put a copyright on my Form. I tried to write ©

private Label copyrightL = new Label("©");

but it did not work. So how to write the © symbol ?

pheromix
  • 18,213
  • 29
  • 88
  • 158

4 Answers4

11

Try with unicode symbol:

private Label copyrightL = new Label("\u00a9");

Hope this helps,

albciff
  • 18,112
  • 4
  • 64
  • 89
  • it doesnt work ! what is the key combinations to write the copyright symbol into a resource file ? – pheromix May 19 '14 at 08:42
  • To write the copyright symbol into a file try with: String copyright = "\u00a9"; FileOutputStream fos = new FileOutputStream("/tmp/unicodefile.txt"); fos.write(copyright.getBytes()); fos.close(); – albciff May 19 '14 at 10:33
1

Unicode code point number

Every character defined in Unicode has a unique integer number assigned to it.

Determine the number for your desired character. The COPYRIGHT SIGN is decimal 169, hexadecimal A9.

Create a single-character string.

int copyrightSymbolCodePoint = 169 ;
String s = Character.toString( copyrightSymbolCodePoint ) ;

Or, append using a StringBuilder.

StringBuilder sb = new StringBuilder( "Copyright symbol is " ) ;
an.appendCodePoint( copyrightSymbolCodePoint ) ;
String output = sb.toString() ;
Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
-1

Hold alt key Then press 0169 in numeric keyboard Release alt Enjoy

-2

Is it Java?, try using JLabel and use private JLabel copyrightL = new JLabel("<html><body>&copy;</body></html>");