I looked at the error messages and noticed the word "thread" in many of the messages. Do you have to make two separate threads when you are doing what I am trying to do?
Thank you. I have a question about the pack method
The pack method sizes the frame so that all its contents are at or above their preferred sizes. An alternative to pack is to establish a frame's size explicitly by calling setSize or setBounds (which also sets the frame's location). In general, using pack is preferable to calling setSize, since pack leaves the frame's layout manager in charge of the frame's size, and layout managers are good at adjusting to platform dependencies and other factors that affect component size.
...set the frame's location .. it's easy to do so using either the setLocationRelativeTo or setLocation method. For example, the following code centers a frame onscreen:
setVisible method of the frame object
Then I added buttons to the panel. But when I ran the program the buttons did not appear. But when I changed the size of the window, the buttons appeared.