• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable character Encoding

 
David Avrami
Ranch Hand
Posts: 30
C++ Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am writing GUI in hebrew language in netbeans,
all the components displaying the characters as they should except the JTable.
i tried :

its not working, it shows squares in the table,
but in the console it shows it correctly(when printing the cell content from the table).

how can i set the character set in the JTable in hebrew?
thanks.
 
Paul Clapham
Sheriff
Posts: 21892
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Character encoding and character set don't apply to Java code; all Java characters and Strings are Unicode and are not encoded (except in UTF-16).

If you are seeing square boxes in your GUI instead of characters, then you are using a font which can't represent the characters you are giving it. So probably the font is your problem. The other possible problem is that you are taking characters and applying a data-mangling transformation before displaying them, so perhaps you are generating characters which are a lot different than what you expected. So I would get rid of that code with the weird hacks and replace it by code which uses known characters, at least for testing.
 
David Avrami
Ranch Hand
Posts: 30
C++ Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks..

the font was the problem!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!