- I have a simple JFrame
- I create a JPanel called 'ContentPane'
Expand|Select|Wrap|Line Numbers
- contentPane = new JPanel();
- contentPane.setBackground(SystemColor.window);
- contentPane.setBorder(new LineBorder(SystemColor.inactiveCaption));
- contentPane.setLayout(null);
- setContentPane(contentPane);
- The JMenuItem has a MouseListener and a override to 'mouseReleased'
- Inside mouseReleased i call
Expand|Select|Wrap|Line Numbers
- TestPanel p = new TestPanel(null, new Vector2(12, 12));
- contentPane.add(p);
- 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.