posted 1 year ago
If I replace "JPanel panel panel = new JPanel(); ----- (1)" with "JPanel panel = new JPanel();" the code does compiile for me. It doesn't throw a runtime exception either if I add an empty public static void main method and execute it. What error does the compiler return? Do you get an error if you compile the code without the duplicate "panel"?