I cant do this.Whats wrong?
Hello guys,im new to the forum!I have been trying to make a sharp appear on the screen but i cant.It says that there is no main method or something.What should i do?
Here is the code:
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();
}
}
}
Re: I cant do this.Whats wrong?
Re: I cant do this.Whats wrong?
I did all the "Hello world " lessons.I made a calculator a application form etc.Im just lost as i dont know where to go.What should i do?Thanks in advance.
Hola gente!Estoy perdido!
Hola muchachos,estoy completamente perdido,no se por donde seguir.Ya eh seguido los tutoriales de "hello world" etc,es mas,hice una calculadora y un formulario, y otros proyectos del mismo tipo.Con que deberia seguir ahora?Creo que yo como tantos otros se encuentran en esta situacion de sentirse perdidos.Estaria bueno que nos hechen una mano.Desde ya ,gracias.
Re: Hola gente!Estoy perdido!
Quote:
Originally Posted by Yahoo!BABELFISH
Hello boys, I am completely lost, not by where following. Already eh followed the tutorials of " hello world" etc, is but, I made a calculator and a form, and other projects of the same type. Whereupon deberia to follow now? I believe that I eat so many others are in this situation to feel lost. Good Estaria that they hechen a hand to us. From already, thanks.
Quote:
Originally Posted by Google Translate
Hi guys, I'm completely lost, do not know where eh seguir.Ya followed the tutorials of "hello world" etc, is more, I made a calculator and a form, and other similar projects that should follow tipo.Con now? I think I like many others are in this situation to feel good that we Hechen perdidos.Estaria a mano.Desde already, thanks.
Looks like the same question as posted earlier. Please use one thread per question: Forum Rules
I'm merging this in the other thread.
db
Re: I cant do this.Whats wrong?
I have never gotten paint() to work in a JFrame or Frame if it is not done onto a panel, but dude why do you have a run method there? you need a constructor for this JFrame class, here is a really basic example of one:
Code:
import javax.swing.*;
import java.awt.*;
public class MYFrame extends JFrame
{
JPanel base = new JPanel();
MYFrame()
{
super("MYFrame");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setContentPane(base);
setSize(500,500);
setVisible(true);
}
public static void main(String[] args)
{
MYFrame a = new MYFrame();
}
}