Create a Maze class and extend it from JComponent. Than override paintComponent(Graphics) method and paint it using Graphics passed as an argument.