You are not logged in.
I'm currently creating a java application and it makes use of JFrames with JPanels drawn directly onto it. I know this works on other machines but on my Arch Linux machine the JFrame is just blank.
I'm currently using the official oracle jdk and jre, but I've tried with openjdk as well. Everything is up to date and I'm using xmonad as my window manager.
Thanks for any help you can give, and let me know if you need any more information.
EDIT:
Here's an example of what type of code isn't functioning properly:
import java.awt*;
import javax.swing.*;public class JFrameTester {
public static void main(String[] args) {
JFrame f = new JFrame("A JFrame");
f.setSize(250, 250);
f.setLocation(300,200);
f.getContentPane().add(BorderLayout.CENTER, new JTextArea(10, 40));
f.getContentPane().add(new JLabel("Testing"));
f.setVisible(true);
}
}
Last edited by gadget3000 (2012-11-25 14:01:30)
Offline
import java.awt.*;
import javax.swing.*;
public class JFrameTester {
public static void main(String[] args) {
JFrame f = new JFrame("A JFrame");
f.setSize(250, 250);
f.setLocation(300,200);
f.getContentPane().add(BorderLayout.CENTER, new JTextArea(10, 40));
f.getContentPane().add(BorderLayout.NORTH,new JLabel("Testing"));
f.setVisible(true);
}
}
Works for me.
EDIT: Just a thought, did you set java to use a different theme such as your GTK/KDE theme or anything like that? Perhaps everything is there but you can't see it because of your theme. Try change the look and feel to nimbus or something.
Last edited by biltong (2012-11-25 14:28:11)
Offline
Offline
I had this problem too with jdk-openjdk and jre-openjdk (but using bspwm and not xmonad). I was able to fix it by setting
export _JAVA_AWT_WM_NONREPARENTING=1
which was mentioned in the wiki article that Nepherte linked. It's also mentioned on the Arch Wiki at https://wiki.archlinux.org/title/Java#G … ly_closing .
Last edited by sucralose (2022-12-21 21:21:37)
Offline