开发者

Java swing components not displayed properly outside netbeans

开发者 https://www.devze.com 2023-04-11 14:41 出处:网络
I have developed a Java Swing application. When running the application in Netbeans IDE, everything works properly (see http://www.fkserv.ugent.be/vrg/tom_dierickx/Screenshot2.png for a screenshot).

I have developed a Java Swing application. When running the application in Netbeans IDE, everything works properly (see http://www.fkserv.ugent.be/vrg/tom_dierickx/Screenshot2.png for a screenshot).

After building the project to .jar and running it in command line, the application window a开发者_C百科ppears but the components are not displayed properly (See http://www.fkserv.ugent.be/vrg/tom_dierickx/Screenshot1.png for a screenshot).

Does anyone have experienced this before and may have a solution to this problem?


As the thread points out, this seems to be a Ubuntu-related problem. I experienced no trouble when running the application on a windows system.

Some threads on the web contribute the defect to Compiz or Beryl. However, I never installed these graphic-tools. However, I ran a line of code I found on the net for uninstalling Compiz. It seemed that Compiz was installed by default. Unfortunately, the problem remains. Beryl doesn't seem to be installed.

The threads also note to add export AWT_TOOLKIT="MToolkit", but this doesn't seem to work either.

No runtime errors where generated on the command line.

Any suggestions?


After some testing, I came to following conclusions:

  • The application runs on Windows, but not on Ubuntu.
  • Some Swing applications run on Ubuntu, while others don't.

Hence it seems like the problem is due to one or a few Swing components which do not work in Ubuntu. I think it's best for now to avoid these components by testing what works and what does not.

0

精彩评论

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

关注公众号