Welcome to the forum! Thanks for taking the time to learn how to post code correctly. If you haven't already, please read
this topic to learn other useful info for new members.
Please observe Java's naming conventions which call for class names to begin with capital letters.
You also have a typo at line 30:
if(e.getSorce()==firstButton)
Update:
AND, this statement has a purpose:
emptyWindow.pack();
You should read the API to understand its purpose, and you may also then see that its purpose is only realized AFTER components have been added. Order often matters.