I have a simple java gui (code below) which for some reason when displayed, will "jump" back to it's original position the first time I try to move or resize it. So basically I will have to move the gui twice to get it to move once because as soon as I release the mouse the first time it snaps back to where it originally came up.
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(new JTextArea(10, 40));
//f.pack();
f.setVisible(true);
//f.validate();
}
}
I am running on GNU Linux with java 1.6. I am exporting the display back to my Windows machine and wondering if it has something to do with the X11 forwarding because it does not show this behavior when I run the gui in Windows. However, when I run this gui on a Fedora Linux box (with java 1.7) it does not show this behavior at all - whether exporting the display or not.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…