dispose JPanel
Hi, I created JPanel and I created instance of this JPanel, like this
MyForm my = new MyForm();
my.setFunction.......
JFrame frame = new JFrame("MyChildrenForm");
frame.setContentPane(my);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.pack();
frame.setVisible(true);
I put JButton on my JPanel and created action listener for key down and mouse click and I called my private function setEnd()
I need dispose this form. I have a problem, if I wrote this. (this + dot) - in my private function setEnd(), I didn't see functions this.dispose and this.setVisible . How I can dispose my form? Thank you for help me.
Please sign in to leave a comment.
Hello Aldik,
Sorry, but this forum is not a place for asking general Java development
questions which don't have anything to do with IntelliJ IDEA's features.
(dispose() is a method of JFrame, so you can't call it via an instance of
MyForm)
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"