import java.awt.*; import java.awt.geom.*; import javax.swing.*; public class G2Proov1 extends JPanel{ public void paintComponent(Graphics g0){ super.paintComponent(g0); Graphics2D g=(Graphics2D)g0; GradientPaint gp1=new GradientPaint(100, 0, Color.yellow, 200, 100, Color.red); Shape paike=new Ellipse2D.Double(100, 0, 100, 100); g.setPaint(gp1); g.fill(paike); /* Katsetage Graphics 2D vőimalusi ning pange kokku üks ilus ja huvitav pilt. */ } public static void main(String[] arg){ JFrame f=new JFrame("Graphics 2D proov"); f.setSize(300, 300); f.add(new G2Proov1()); f.setVisible(true); } }