0

In my java program, I have various JFrame windows.

My main frame can open all the other frames. I want to be able to run only one instance each frame. I want also to be able to pass arguments to the frame.

Should I use Singleton to initiate the class and then pass the arguments? Or is there a better way?

HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47
uses134
  • 25
  • 6

1 Answers1

-1

Since this is not really a coding problem it is difficult to give you a precise answer to your problem.

Since you specifically say I want to be able to run only one instance of each Jframe, I would always advise on using singletons. They are very easy to code and will allow you to access the JFrames from within multiple classes.

ThomasS
  • 705
  • 1
  • 11
  • 30