Results 1 to 10 of 10
Thread: Help with debug
- 11-22-2009, 04:01 AM #1
Help with debug
I get like 6 errors 5 of them on line 14(public void paint...) and 1 more on public class screen.drawLine:mad:
Can anyone help debug
all help is appreciated
Java Code:import java.awt.event.*; import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; public class screen.drawLine { public static void main(String[] args){ { Window win= new Window(); win.setSize(800,600); } public void paint(Graphics g){ { screen.drawLine(300,250,725,650); screen.drawLine(400,400,400,800); } } } }Are you suggesting that Cocunuts migrate?!! -Monty Python
-
You may want to rename this class.Java Code:public class screen.drawLine // ????
-
Sorry to be brutally blunt, but this code looks like it was put together by blind monkeys. You can't just randomly type in code and expect it to work mathemagically. Instead, you should plan your code before you type it.Java Code:public static void main(String[] args){ { Window win= new Window(); // what the heck is a Window object and why are you using it? win.setSize(800,600); } public void paint(Graphics g){ { screen.drawLine(300,250,725,650); // why are you drawing with "screen"??? screen.drawLine(400,400,400,800); } }
- 11-22-2009, 04:11 AM #4
So i renamed it now im just getting errors in the line of code
(public void paint...)
Any idea?Are you suggesting that Cocunuts migrate?!! -Monty Python
-
- 11-22-2009, 04:14 AM #6
I actually got this code from my computer science teacher
Are you suggesting that Cocunuts migrate?!! -Monty Python
-
- 11-22-2009, 04:34 AM #8
Any ideas on new code that does the same thing
Are you suggesting that Cocunuts migrate?!! -Monty Python
-
If you want to see code that actually does screen graphics, you'll find lots at the Sun Swing tutorials. That's likely your best bet since it will contain both working code samples and tutorials so you can understand what your coding and adapt it to your desires (and be able to fix errors that come up too). Much luck.
-
Some links that might help:
Performing Custom Painting in Swing
2D Graphics Tutorial
Painting in AWT and Swing
Similar Threads
-
error debug
By stid in forum EclipseReplies: 2Last Post: 10-16-2009, 07:44 PM -
How to debug javaScript?
By kishan in forum Advanced JavaReplies: 2Last Post: 07-24-2009, 09:16 AM -
Debug challenge: how do you debug a Java program?
By CJSLMAN in forum New To JavaReplies: 60Last Post: 07-04-2009, 10:28 AM -
Cannot debug on Eclipse.. and other IDE
By pexlee in forum EclipseReplies: 0Last Post: 09-26-2008, 05:07 PM -
Cannot debug in NetBeans as well as other IDE
By pexlee in forum NetBeansReplies: 0Last Post: 09-26-2008, 04:45 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks