If you are running that class you will want the class to be the same as the file name, and probably should make the class public. That is not the problem though. Your class is named JPanel, and these is a library class in the javax.swing package named JPanel, you should not name your class the same.

Bingo! I just deleted my JPanel.class file and now the "my.java" file compiles. The output of the program is just showing the JFrame. I want the Buttons, Texts, Labels, ComboBox inside the JPanel and then show the JPanel in the JFrame.