The layout of your windowPanel is set to null, so your button is probably not being placed correctly until you set its bounds. I would encourage you to use layout managers (Using Layout Managers (The...