java - How to apply if condition in jframe constructor -


i have jframe named myframe

in constructor myframe() have if condition

myframe() {  if(condition) {  openframe(); }  } 

if condition in not true, don't want open frame. still opens blank frame.

the problem you're not checking condition until you're in process of creating new myframe. if condition false, skip openframe(), presumably adds content, myframe still there. should put if statement around whatever calling new myframe().


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -