I was trying to start a frame GUI (desktop window) without creating it from an Applet
object.
I got a compile error.
My question is, the only way to create a desktop gui frame is with a main method, like desktop application?
Or is there a way to create a frame like creating an applet with the init()
, start()
, paint()
, etc… methods?
my code:
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
class PilotinoGui extends Frame {
PilotinoGui(String title) {
super(title);
}
public void paint(Graphics g) {
g.drawString("This is stringggg", 10, 40);
}
}
Error message:
Error: Main method not found in class
zetariemann.com.pilotino.PilotinoGui, please define the main method as:
public static void main(String[] args)