added package for dialog windows. Tutorial:
private <CLASSNAME> variable name = new <CLASSNAME>(this, false); //in MainWindow

variable.pack();
variable.setVisible(true);