Jump to content
  • 0

Java components doesn't show up on the screen


nigga-china
 Share

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 an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...