Code fails to compile for Panel Object
posted 9 months 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"?