• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

rectangle class

 
Ranch Hand
Posts: 641
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i,am new to applets . Have not really coded much in applets . Trying to use the rectangle class in the shape interace . How do i draw this rectangle ?
thanks
regards
raghav mathur
[ April 30, 2002: Message edited by: raghav mathur ]
[ April 30, 2002: Message edited by: raghav mathur ]
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wouldn't it be great, if given a Rectangle r, one could just do something like Graphics::drawRect(r) ?
But no, we can't do this. We have to do it the hard way:
Graphics::drawRect(r.x, r.y, r.width, r.height)
One thing to note: You will discover that Graphics::drawRect(int, int, int, int) and Graphics::fillRect(int, int, int, int) don't use the exact same area to display the rectangle. One of them is 1 pixel larger vertically and horizontally.
Good Luck.
[ May 01, 2002: Message edited by: Dirk Schreckmann ]
 
Raghav Mathur
Ranch Hand
Posts: 641
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic