Jump to content
Forums in Read-Only Mode - Please use Reddit ×
  • 0

Java components doesn't show up on the screen


nigga-china

Question

Some Java components as JLabel, JButton and many others is not showing up on the JFrame. If I set a text to a button, it doesn't appear in the screen. I suspected that this issue is because the default font used by Java is not installed so I tried to change the font used in the components but once again it didn't show up anything. I checked if it was due to bad code or something like this but was not the case, also I used codes from the internet and none worked.

I really don't have another idea of how to solve this and I'm worried because I need to practice Java UI due to I'm studying an OOP subject in the college. If someone help me I'd really appreciate.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 1

I remember running into this a few years ago. There is an environment variable that can be set that sometimes works:

https://wiki.archlinux.org/index.php/Dwm#Fixing_misbehaving_Java_applications

_JAVA_AWT_WM_NONREPARENTING=1

This is supposed to tell AWT to behave under a non-reparenting WM, such as dwm. Drop that into a file under /etc/env.d, and then run env-update.

Link to comment
Share on other sites

  • 0
21 hours ago, klipkyle said:

I remember running into this a few years ago. There is an environment variable that can be set that sometimes works:

https://wiki.archlinux.org/index.php/Dwm#Fixing_misbehaving_Java_applications


_JAVA_AWT_WM_NONREPARENTING=1

This is supposed to tell AWT to behave under a non-reparenting WM, such as dwm. Drop that into a file under /etc/env.d, and then run env-update.

Thank you! It solved my issue. :><33

Link to comment
Share on other sites

×
×
  • Create New...