// Java Applet to draw radials - x axis, y axis// import java.applet.Applet; import java.awt.*; public class Radial extends Applet { public void paint (Graphics g) { int x = 0, y = 0; // x axis, y axis //g.setColor(Color.blue); // not used g.drawRect(0, 0, 100, 100); //g.fillRect(80, 80, 200, 200); // not used // draw radials to vertical for (x = 0; x <= 100; x += 10){ g.drawLine(50, 50, x, y); if (x == 100){ for (x = 100 ; x >= 0; x -= 10){ g.drawLine(50, 50, x, y + 100); // set y to next horizontal } x = 100; // now end if }} // 2 horizontal loops end x = 0; // Reset x to zero for first vertical // now draw radials to vertical for (y = 0; y <= 100; y += 10){ g.drawLine(50, 50, x, y); if (y == 100){ for (y = 100 ; y >= 0; y -= 10){ g.drawLine(50, 50, x + 100, y); // set x to next vertical } y = 100; // now end if }} // 2 vertical loops end g.drawString("Radials of a box", 100, 150); } }