Java

How to Open only one JFrame form instance at a time in JAVA using NetBeansIDE



How to Open only one JFrame form instance at a time in JAVA using NetBeansIDE

Suppose I want to open JFrame2 after clicking on JFrame1 JButton

1. Open NetBeansIDE

2. Create a JFrame1 and JFrame2 forms in a project

3. Create a JButton in JFrame1

4. Add this Code for JButton ActionPerformed:

JFrame2.getObj().setVisible(true);

5. Add this code in JFrame2 class:

private static JFrame2 obj=null;

6. Change the default constructor access modifier to private

7. Make a public static method…

Similar Posts

13 thoughts on “How to Open only one JFrame form instance at a time in JAVA using NetBeansIDE
  1. Thanks. Solved my problem. This made since to me logically before I found this tutorial but I did not know how to implement it. Maybe you should do some explaining for beginners though.

Leave a Reply

Your email address will not be published. Required fields are marked *