switching from Canvas to JPanel