View Single Post
  #1 (permalink)  
Old 07-10-2007, 06:08 PM
Godzilla Godzilla is offline
Member
 
Join Date: Jul 2007
Posts: 3
Godzilla is on a distinguished road
Rectangle expands with applet frame
Hello,

I've been trying to get this program to work that when I expand the applet frame the rectangle will expand with it. Any ideas on how I can fix it or any good sources worth reading. Thanks for any help.

Code:
import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Rectangle; import java.applet.Applet; import java.awt.*; public class blueRectangle extends Applet { public void paint(Graphics g) { Graphics2D g2 = (Graphics2D)g; Rectangle box = new Rectangle(0, 0, 200, 100); g2.draw(box); Color BLUE = new Color(0.0F, 0.0F, 1.0F); g2.setColor(Color.blue); g2.fill(box); } }
Reply With Quote
Sponsored Links