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] Sat, 14 September 2013 02:58 Go to next message
Chance Dande is currently offline Chance DandeFriend
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 10:01 Go to previous message
shankha banerjee is currently offline shankha banerjeeFriend
Messages: 40
Registered: February 2013
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 Nov 26 09:24:40 GMT 2014

Powered by FUDForum. Page generated in 0.02666 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software