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
Post a Comment