codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  whats wrong with my drawLine method....it looks correct to me!  alainap21 at 14:43 on Monday, February 13, 2006
 

im drawing 2 lines. One vertical and one horizontal...my vertical line shows no error but my horizontal line shows error...this is my code...by the way the horizontal line is animated with a timer class. im just showing code for whats producing my error.

private final int width=400,height=200;
private final int Vertical_X=160;
private int Start_X,Start_Y;
private int length_line_seg;
private int MoveX,MoveY;
private Timer timer;
private final int DELAY=20;

public MovingSegmentPanel() {
length_line_seg = 40;
Start_X=50;
Start_Y=40;



public void paintComponent(Graphics page)
{ super.paintComponent(page);
page.drawLine(Vertical_X,0,Vertical_X,height); //no errors

page.drawLine(Start_X,Start_Y,Start_X-lenght_line_seg,Start_X,Start_Y) //error here...can't apply int to graphics, but why does it work for my vertical line??

  Re: whats wrong with my drawLine method....it looks correct to me!  crwood at 16:18 on Monday, February 13, 2006
 

The drawLine method takes four int arguments. The second/last call to drawLine has five arguments.

  Re: whats wrong with my drawLine method....it looks correct to me!  alainap21 at 19:06 on Tuesday, February 14, 2006
 

thanks!








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  How do I write a while-loop javascript using rgb(..., ..., ...)?
•  Resizable Image
•  Re: Help !
•  Hi all ,Please send me the code for log in to a page using JSP
•  building a DLL
•  Open New Window according to Taskbar
•  Re: need help
•  What VBA code can I use to extract the IP Address
•  Re: I NEED HELP!!!!!!!!


Recent Articles
What is a pointer in C?
Multiple submit buttons with form validation
Understanding Hibernate ORM for Java/J2EE
HTTP screen-scraping and caching
a javascript calculator
A simple way to JTable
Java Native Interface (JNI)
Parsing Dynamic Layouts
MagicGrid
Caching With ASP.Net


© Copyright codetoad.com 2001-2006