package tut;
import java.awt.Graphics;
import javax.swing.JFrame;
public class javaconcepts extends JFrame
{
public void paint(Graphics g)
{
g.drawOval(100,50,50,50);
}
public javaconcepts()
{
setSize(600,400);
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
public static void main(String[] args)
{
javaconcepts guiWindow = new javaconcepts();
guiWindow.setVisible(true);
}
}
Sorry for the very newbie, but I saw the code in a tutorial that I don't understand. The version in the text editor created an emoticon, but I just played the program to display a simple circle instead. I would really appreciate your help.
If I change the name "public javaconcepts ()" to something else, it gives me an error that says to make it type void. Changing it to enter void leads to the fact that the program does not execute what is in the brackets of "public javaconcepts ()".
I teach myself, so I don’t have a teacher to ask. Thank.
source
share