HELP

0 Shaheedul Islam · August 11, 2015
ERROR: Syntax error, insert "}" to complete ClassBody
ERROR AT LINE 18.
WHY DO I GET THIS ERROR

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

public class Peach extends JPanel{
public void paintComponent(Graphics g){

super.paintComponent(g);
this.setBackground(Color.WHITE);

g.setColor(Color.BLUE);
g.fillRect(25, 25, 100, 30);

g.setColor(new Color(190, 81, 215));
g.fillRect(25, 65, 100, 30);

g.setColor(Color.RED);
g.drawString("This is some text", 25, 120);
}



}


Post a Reply

Replies

Oldest  Newest  Rating
0 Shaheedul Islam · August 11, 2015
Wait, I just copied and pasted the code into another java file and it seems to work.
Thanks anyway
0 Shaheedul Islam · August 11, 2015
i am using eclipse
0 Shaheedul Islam · August 11, 2015
I have already checked that and all my braces are matched up, in a pair.
  • 1

Java / Android Development

107,293 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator