Publicité
Write a program that uses the DrawingPanel to produces the following f.docx
Write a program that uses the DrawingPanel to produces the following f.docx
Prochain SlideShare
Write a SIMPLE java program to print out the numbers from 100 to 1- wi.docxWrite a SIMPLE java program to print out the numbers from 100 to 1- wi.docx
Chargement dans ... 3
1 sur 2
Publicité

Contenu connexe

Plus de drosa1(20)

Publicité

Write a program that uses the DrawingPanel to produces the following f.docx

  1. Write a program that uses the DrawingPanel to produces the following figure. Solution import java.awt.*; public class DrawingEx { public static void main(String [] args) { DrawingPanel panel= new DrawingPanel(500,400); Graphics g = panel.getGraphics(); g.setFont(new Font ("Monospaced",Font.Bold,14)); Scanner s=new Scanner(System.in); System.out.println("enter number of lines"); int n= Integer.parseInt(s.readLine()); int m=n; for(int i=0;i<n;i++) { for(int j=0;j<m-1;j++) {
  2. System.out.println(" "); g.drawLine(m-1,0,m,n) m--; n--; } } }
Publicité