Results 1 to 1 of 1
- 09-22-2009, 07:15 PM #1
Member
- Join Date
- Sep 2009
- Posts
- 6
- Rep Power
- 0
ok so i have to write a program called FourRectanglePrinter
import java.applet.*;
import java.awt.*;
public class FourRectanglePrinter extends Applet
{
public static Rectangle box;
public void init()
{
box = new Rectangle(10,10,40,40);
System.out.println(box);
box.translate(40,0);
System.out.println(box);
box.translate(0,40);
System.out.println(box);
box.translate(-40,0);
System.out.println(box);
}
public void paint(Graphics g)
{
g.drawRect((int)box.x,(int)box.y,(int)box.getWidth (),(int)box.getHeight());
g.drawRect((int)box.x+40,(int)box.y,(int)box.getWi dth(),(int)box.getHeight());
g.drawRect((int)box.x+40,(int)box.y+40,(int)box.ge tWidth(),(int)box.getHeight());
g.drawRect((int)box.x,(int)box.y+40,(int)box.getWi dth(),(int)box.getHeight());
}
}
thats what i have and i need a screenshot of it but it wont let me take a screenshot of an applet so i was wondering if there was a way to do it as a simple programm
Similar Threads
-
is it possible to write program with out thread
By makpandian in forum Threads and SynchronizationReplies: 3Last Post: 12-21-2008, 05:41 PM -
How to write interceptor program in struts2?
By vasu in forum Web FrameworksReplies: 1Last Post: 10-07-2008, 07:53 AM -
need help to write Program in JAVA
By maneibr in forum New To JavaReplies: 1Last Post: 03-13-2008, 01:28 PM -
Need to write a program to execute a list of system commands
By mdthahir in forum New To JavaReplies: 2Last Post: 08-07-2007, 07:22 PM -
Need to write a program to execute a list of system commands
By mdthahir in forum NetworkingReplies: 1Last Post: 07-27-2007, 05:46 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks