Results 1 to 2 of 2
- 10-16-2011, 07:34 PM #1
Member
- Join Date
- Nov 2010
- Posts
- 75
- Rep Power
- 0
Please help me fix this error: invalid method declaration
java:13: invalid method declaration; return type required
public SimpleShape()
Java Code:import javax.swing.*; import java.awt.*; import java.awt.geom.*; import java.util.*; public class Graphics2D { public static void main (String[] args) { new SimpleShape(); } public SimpleShape() { this.setSize(300, 300); this.setTitle("A simple shape program"); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.add(new PaintSurface(), BorderLayout.CENTER); this.setVisible(true); } private class PaintSurface extends JComponent { public void Paint (Graphics g) { Graphics2D g2 = (Graphics) g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON); Shape s = new Ellipse2D.Float(20, 50, 250, 150); g2.setPaint(Color.BLACK); g2.draw(s); } } }
- 10-17-2011, 11:45 AM #2
Member
- Join Date
- Aug 2011
- Location
- INDIA
- Posts
- 64
- Rep Power
- 0
Similar Threads
-
invalid method declaration
By mcfer in forum New To JavaReplies: 8Last Post: 09-22-2012, 01:26 PM -
Error: invalid method declaration; return type required
By silvia in forum AWT / SwingReplies: 3Last Post: 06-05-2010, 08:05 PM -
invalid method declaration error
By bsarules in forum Java AppletsReplies: 7Last Post: 05-25-2010, 06:06 PM -
BubbleSorting Problem: invalid method declaration
By SwEeTAcTioN in forum New To JavaReplies: 6Last Post: 12-02-2009, 03:47 AM -
Error: invalid method declaration
By silvia in forum New To JavaReplies: 1Last Post: 07-27-2007, 12:10 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks