SRL Archive - Help

Help!!


Gaston7eze

2012-05-26 08:54:12

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

2012-05-26 09:37:25

This looks like java. Simba uses Pascal. I think you are using the wrong client mate

Gaston7eze

2012-05-26 09:44:26

From: [J]ustin
This looks like java. Simba uses Pascal. I think you are using the wrong client mate


Im doing Java.With Eclipse.

Justin

2012-05-26 09:45:43

From: Gaston7eze
Im doing Java.With Eclipse.


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

zmon

2012-05-26 12:45:08

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

2012-05-26 14:02:49

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?