Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Identifier(My java script wont work!)
Identifier [message #1108577] Fri, 13 September 2013 22:58 Go to next message
Chance Dande is currently offline Chance Dande
Messages: 1
Registered: September 2013
Junior Member
package Maze;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Board extends JPanel implements ActionListener{

private Timer timer;

public Board(){
timer = new Timer(25, this);}
timer.start(); <----
This timer is underlined and says "Syntax error on token "start", Identifier expected after this token"

public void actionPerformed(ActionEvent e){
repaint();


}

public void paint(Graphics g){
super.paint(g);

g.setColor(Color.red);
g.fillRect(45, 50, 32, 32);
}
}
Re: Identifier [message #1110063 is a reply to message #1108577] Mon, 16 September 2013 06:01 Go to previous message
shankha banerjee is currently offline shankha banerjee
Messages: 27
Registered: February 2013
Junior Member
Looks like you have closed the constructor before the call.

public Board(){
timer = new Timer(25, this);}
timer.start(); <----


public Board(){
timer = new Timer(25, this);
timer.start(); <----
} <--------------------
Previous Topic:Cannot resolve interfaces from superclass in non eclipse project
Next Topic:Asking for Credentials on Access to any external site
Goto Forum:
  


Current Time: Wed Apr 16 00:39:35 EDT 2014

Powered by FUDForum. Page generated in 0.01727 seconds