开发者

Displaying unusual characters as button text in SWIXML

开发者 https://www.devze.com 2023-02-22 08:37 出处:网络
I have the following SWIXML code: <panel id=\"contentPanel\"> <button text=\"∂\"/> <button text=\"∆\"/>

I have the following SWIXML code:

  <panel id="contentPanel">
    <button text="∂"/>
    <button text="∆"/>
    <button text="∏"/>
    <button text="∑"/>
  </panel>

Notice the mathematical symbols that are used f开发者_高级运维or text. The symbols render fine in my Java IDE. However, when I run the code, the symbols are not displayed correctly in the Swing component. They each look like two characters, the first being an 'a' with diacritical marks and the second being some random character.

What is going on here?


YOu can use unicode char def e.g. text="\u2211" for Sum


The IDE's default encoding is probably UTF-8, while your platform is something else. Try examining the default encoding in both environments:

System.getProperty("file.encoding");
0

精彩评论

暂无评论...
验证码 换一张
取 消