If you were expecting to be able to learn how to use a complex class like JPanel just by reading the API documentation, you are right, that is a very difficult thing to do. However if you start reading at the very beginning,
The API documentation wrote:For examples and task-oriented documentation for JPanel, see How to Use Panels, a section in The Java Tutorial.
So there's a link to a tutorial. Reading that tutorial is a much more practical way to learn. And you will find that most of the major Swing classes have an associated tutorial. I recommend reading them. And downloading their example code and fiddling around with it to see what you can do.