Hi, I am trying a method of creating a
Java program by putting components on a JFrame instead of on a JPanel and putting the JPanel on the JFrame. I found the following code, which adds a JButton to a JFrame and displays it, in an old Java book:
This code works fine but the button expands to fill the window even when I give it a size altough the book's picture of the program shows the button at proper size.
What is going on? How can I fix this?