0

Let's say I have a JFrame that is created through a singleton pattern like this :

private static Dist2PuncteFrame instance = null;

public static Dist2PuncteFrame getInstance() {

    if (instance == null)
        instance = new Dist2PuncteFrame();
    return instance;
}

I call it through a JMenuItem like this:

dist2PcteItem.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {

            dist2PcteFrame = Dist2PuncteFrame.getInstance();
            dist2PcteFrame.setSomeParameters(blablabla);
            dist2PcteFrame.init();
        }
    });

Nothing complicated. The problem occurs when I open the window the second time.
My close button and the 2 input labels seem to move (labels left/right, button up/down).

I have frames that are called the exact same way and they don't have this problem.
Anyone knows what seems to be the problem? I am using NetBeans 7.1.

4

0 回答 0