Recently a problem has popped up in my program, it comes whiletrying to set a JFrame to visible. How exactly can just settingit to visible cause an IllegalArgumentException?Container being added to itself is the general message beingdelivered
The method ispublic void setVisible(boolean b)so you need to specify the parameter (whether true or false) in the methodsetVisible.For your case, it will besetVisible(true);