public static void main(String[] args)
{
tempcon myTempWindowInstance = new tempcon();
myTempWindowInstance.tempwindow();
}
You never initialize a tempcon. Your constructor must have the same name as the class, so I recommend the following changes instead:
Replace
public tempwindow()
withpublic tempcon()
to correct the constructor.public tempcon() { setTitle("Temurture convertion"); setSize(WINDOW_WIDTH, WINDOW_HEIGHT); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); buildPanel(); add(panel); setVisible(true); }
create an instance of tempcon using
new
, which calls the constructor:public static void main(String[] args) { tempcon myTempWindowInstance = new tempcon(); }