简体   繁体   English

Java 访问修饰符关键字(私有、默认、受保护、公共或最终,static 等)自动隐藏在 eclipse 中,但显示在源文件中

[英]Java Access Modifiers keyword (private, default, protected, public or final, static etc..) automatically hide in eclipse but show in source file

When I write code that time automatically hide some java keyword in eclipse but display in.java file from directory.当我编写代码时,会自动在 eclipse 中隐藏一些 java 关键字,但会显示在目录中的.java 文件中。

Eclipse editor screen shot: Eclipse 编辑器屏幕截图:

在 Eclipse 中这样显示

.java file screen shot: .java 文件截图:

.java 文件代码

Please help me !!请帮我 !!

The fact that the complete code can be copied proves that the characters exist but are not displayed.可以复制完整代码的事实证明字符存在但不显示。

If in Window > Preferences: Java > Editor > Syntax Coloring deactivating bold for Java > Keywords excluding 'return' make them visible in the Java editor again, only characters in bold are affected. If in Window > Preferences: Java > Editor > Syntax Coloring deactivating bold for Java > Keywords excluding 'return' make them visible in the Java editor again, only characters in bold are affected. In this case choosing a different font at least for the Java editor might be the solution:在这种情况下,至少为 Java 编辑器选择不同的字体可能是解决方案:

  1. In Window > Preferences: General > Appearance > Colors and Fonts choose a different font for Java > Java Editor Text Font In Window > Preferences: General > Appearance > Colors and Fonts choose a different font for Java > Java Editor Text Font

I like Source Code Pro as a font for coding, which has to be installed in the operating system to use it in Eclipse.我喜欢Source Code Pro作为编码字体,必须安装在操作系统中才能在 Eclipse 中使用。

Make also sure not using an outdated Java and Eclipse IDE version.还要确保不要使用过时的 Java 和 Eclipse IDE 版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM