Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,143,192 members, 7,780,322 topics. Date: Thursday, 28 March 2024 at 12:23 PM

Can Someone Help Me Run This Java Code (java Programmers) - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Can Someone Help Me Run This Java Code (java Programmers) (801 Views)

How Long Did It Take You Guys To Become Strong Java Programmers / Improve The Speed Of This Java Code. (2) (3) (4)

(1) (Reply)

Can Someone Help Me Run This Java Code (java Programmers) by buster(m): 5:45pm On Dec 30, 2014
Hi
Can someone help me run this java code. am getting an error message of main class not found

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Font;

import javax.swing.JFrame;

public class guiexample extends JFrame {
public static void main(String args[]) {
guiexample f = new guiexample();
f.setSize(300, 300);
f.setVisible(true);

}

public void pain(Graphics g) {
g.setColor(Color.yellow);
g.fillOval(50, 50, 200, 200);
g.setColor(Color.black);
g.drawArc(75, 60, 150, 150, -25, -125);
g.fillOval(100,100, 25, 25);
g.fillOval(175, 100, 25, 25);
g.setColor(Color.blue);
g.setFont(new Font("Serif", Font.BOLD, 18));
g.drawString("Hello my name is Alim Bidmus", 35, 275);

}
}
Re: Can Someone Help Me Run This Java Code (java Programmers) by bot101(m): 4:54pm On Jan 02, 2015
You Can't Create An Object From Within Its Class, Please Remove Your Main Method From That Class Declaration.

(1) (Reply)

Tech Startup Empowerment / What Is The Meaning Of Hacked By A.l.t On Www.funmiquadrionline.com? / Cloud Apm

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 8
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.