Results 1 to 2 of 2
- 01-16-2012, 09:34 PM #1
Member
- Join Date
- Dec 2011
- Posts
- 1
- Rep Power
- 0
What is wrong in this code of java
import javax.swing.*;
public class shape
{
public static void main(String[] args)
{
JFrame f=new JFrame("hi");
f.setSize(300,200);
f.setDefaultCloseOperation(JFrame.EX…
f.setVisible(true);
draw ob1=new draw();
f.add(ob1);
}
}
/*************************************…
import java.awt.*;
//import java.awt.color.*;
public class draw extends JFrame
{
public void paint(Graphics g)
{
g.drawOval(10, 10, 50, 50);
g.fillOval(5, 5, 10, 10);
}
}
- 01-16-2012, 09:41 PM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,545
- Rep Power
- 11
Re: What is wrong in this code of java
Hi kank635, welcome to the forums!
If you find a problem with the code it might be a good idea if *you* said what it is. Specifically, does the code compile? If not and you can't understand the compiler's messages post them and someone is sure to explain what they mean.
Or does the code compile but you find it does not do what you expect or intend when you run it? In that case describe what the program *does* do (including any runtime errors) as well as what you expected or intended it would do.
Also, please format code. The idea is you put [code] at the start of the code and [/code] at the end. That way the code will be nicely formatted and readable when it appears here.
Similar Threads
-
What is wrong with my code????
By maneatingbaby in forum New To JavaReplies: 2Last Post: 12-31-2010, 06:06 PM -
What is wrong with my code?
By loosemember in forum New To JavaReplies: 1Last Post: 12-03-2010, 01:20 AM -
Please look at my java code and tell me what's wrong
By xcointoss in forum Advanced JavaReplies: 3Last Post: 10-22-2010, 04:15 AM -
what wrong with my java code
By MAXZZXAM in forum New To JavaReplies: 3Last Post: 11-19-2009, 09:38 AM -
what's wrong with my code? please help me...
By lovely23 in forum Java AppletsReplies: 2Last Post: 03-01-2009, 01:33 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks