and when I add in my main class Keypad kp = new Keypad(); both windows appear and I want to see my main window and Keypad to be inside the main class gui
–
knowbodyFeb 21 '13 at 16:09

1

If you don't want the KeyPadWork instance to be in a separate window, then you shouldn't make it a JFrame. If you want it inside another window, extend JPanel instead and add the KeyPadWork instance to some other JFrame using the normal AWT Container.add(Component) method.
–
AlderathFeb 21 '13 at 16:12

1 Answer
1

If you don't want the KeyPadWork instance to be in a separate window, then you shouldn't make it a JFrame. If you want it inside another window, extend JPanel instead and add the KeyPadWork instance to some other JFrame using the normal AWT Container.add(Component) method.