• Post Reply Bookmark Topic Watch Topic
  • New Topic

Openning JDialogs multiple times in an Application

 
Barry Brashear
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If a JDialog will be openned multiple times during the lifespan of an application, should it be created once and then shown each time it is needed, or is it ok to just create it new each time it is needed?

Thanks.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You probably could go either way. And you'll probably hear valid arguments for both. My preference is to just have the app create a new one each time. I have no specific reason for this though. Just seems easier for me. I'd imagine it could be less buggy as well since you don't have to worry about left over data existing in the original object.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!