Solution to java awt Chinese garbled code: First, right-click on the project and select Run Configuration; then select the Arguments tab and enter [-Dfile.encoding=GB18030] in the VM arguments box.
java awt Chinese garbled solution:
is a problem with the running settings of eclipse, you can make the following settings :
1. Right-click the project and select Run Configuration:
2. Select the Arguments tab and enter: -Dfile in the VM arguments: box below. After encoding=GB18030
#, Chinese can be displayed normally. It is recommended to use swing to write java graphical interface as much as possible.
Related learning recommendations: java basic tutorial
The above is the detailed content of How to deal with garbled Chinese characters in java awt. For more information, please follow other related articles on the PHP Chinese website!