Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
|
J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 21st, 2005, 04:23 PM
Registered User
 
Join Date: Aug 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default bluewhiteapplet

the compiler is complaining about gradientpaint. iwant my applet to display a thick line that blue and white

import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.Line2D;

public class BlueWhiteLineApplet extends Applet
{
public void paint(Graphics g)
{
// recover Graphics2D

Graphics2D g2 = (Graphics2D)g;

GradientPaint bluetowhiteVert = new GradientPaint(150,20,Color.blue,150,70,Color.white );
g2.setPaint(bluetowhiteVert);
g2.draw(new Line2D.Double(150,20,250,70));
}
}










Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.