Hi all, here's a kinda bullet-pointy explanation of what i have
- I have a simple JFrame
- I create a JPanel called 'ContentPane'
contentPane = new JPanel();
contentPane.setBackground(SystemColor.window);
contentPane.setBorder(new LineBorder(SystemColor.inactiveCaption));
contentPane.setLayout(null);
setContentPane(contentPane);
- the JFrame has a
JMenuBar -> JMenuBar -> JMenuItem
- The JMenuItem has a MouseListener and a override to 'mouseReleased'
- Inside mouseReleased i call
TestPanel p = new TestPanel(null, new Vector2(12, 12));
contentPane.add(p);
- TestPanel extends a JPanel, and ha some simple text boxes and labels in it which are created in its constructor, super(); is called.
- When the event is fired it creates a TestPanel but it is tiny, about an inch long and 5 mm in height, it should be much much bigger.
- If I move the call to instance the TestPanel outside of the event (so the TestPanel is instanced on load) it is drawn fine.
Why does the event effect it in this way ?
Thanks,
Stu.