Log in

View Full Version : Help!!



Gaston7eze
05-26-2012, 12:54 PM
I dont know what's wrong with this !I have been trying and trying,but i dont know why it doesnt work,it says that it doesnt have a main type or something like that;
code:
package asd;

import javax.swing.JFrame;
import java.awt.*;
import java.awt.geom.*;


@SuppressWarnings("serial")
public class Lama extends JFrame {
public void run{




public void paint( Graphics g )
{


Graphics2D to = ( Graphics2D ) g;


to.setPaint( new GradientPaint( 5, 30, Color.BLUE, 35, 100,
Color.YELLOW, true ) );
to.fill( new Ellipse2D.Double( 5, 30, 65, 100 ) );
to.getColor();


}
}
}

Justin
05-26-2012, 01:37 PM
This looks like java. Simba uses Pascal. I think you are using the wrong client mate

Gaston7eze
05-26-2012, 01:44 PM
ustin;1030995']This looks like java. Simba uses Pascal. I think you are using the wrong client mate

Im doing Java.With Eclipse.

Justin
05-26-2012, 01:45 PM
Im doing Java.With Eclipse.

You might get a better response on a Java forum to be honest.

zmon
05-26-2012, 04:45 PM
Every program requires entry point.

In pascal it is defined with keywords Program, Begin, End.

in C/C++ and Java it is defined by method called main

if you do not define main, the compiled binaries are not executable i.e. they act as library only

you need something like:


public static void main(String [ ] args)
{
MyClassType myclass = new MyClassType(whatever params constructor has);
// call my class function
myclass.DoSomething(with parameters);
}

Gaston7eze
05-26-2012, 06:02 PM
I need such an example to understand the form.I dont understand why this is bad.I understand what you said , but i dont know how to fix it.Can someone tell me?