java - how to prevent running same JInternalFrame more than once -


how can prevent jinternalframe not open more once, in application opens many times. how can make application run if there not same application running.

this code jinternalframe

private void cash_buttonactionperformed(java.awt.event.actionevent evt) {                                                  provider provider = new provider();       mainmenu.add (provider);        provider.setclosable(true);     } 

try adding condition , making provider local variable

private provider provider = new provider();  public your_class_name(){     provider.setclosable(true); }  private void cash_buttonactionperformed(java.awt.event.actionevent evt) {     if(provider.isvisible()) return;     mainmenu.add (provider); } 

Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -