Skip to content
Advertisement

OOP Hello World in Java [closed]

This is My 1st OOP app
I Import all the bellow things but When I try to call a class of try01 package It didn’t Work. Can anyone guide me to do this thing correctly?

package try01;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

Advertisement

Answer

There is no class with Try01.class, so the compiler won’t be able to identify new try01() here Frame.setContentPane(new Try01().panelMain); Also, the panelMain is not defined.

Change it to this – Frame.setContentPane(new try001());

Hope this helps.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement