文件名称:Lab5-3
介绍说明--下载内容均来自于网络,请自行研究使用
创建一个绘图应用程序,随机地绘制线条、矩形和椭圆。
创建一组“灵活的”形状类。如果为这些类提供一个Graphics对象,将绘制位置告诉他们,他们就知道如何绘制自身。这些类的名字应为MyLine,MyRect和MyOval(提示:可有共同的父类MyShape)。使用随机数来挑选形状类型和形状的位置。
随机地创建20个MyLine,MyOval和MyRect类的对象,然后调用该图形的draw方法把它显示出来。-Create a drawing application, randomly draw lines, rectangles and ellipses.
Create a set of flexible shape classes. If you provide a Graphics object for these classes, the drawing position to tell them, they will know how to draw itself. The class name should be MyLine, MyRect and MyOval (Tip: You can have a common parent class MyShape). Using a random number to the position and shape of the shape type.
Randomly create 20 MyLine, MyOval and MyRect class object, and then call the draw method of the graphic display it.
创建一组“灵活的”形状类。如果为这些类提供一个Graphics对象,将绘制位置告诉他们,他们就知道如何绘制自身。这些类的名字应为MyLine,MyRect和MyOval(提示:可有共同的父类MyShape)。使用随机数来挑选形状类型和形状的位置。
随机地创建20个MyLine,MyOval和MyRect类的对象,然后调用该图形的draw方法把它显示出来。-Create a drawing application, randomly draw lines, rectangles and ellipses.
Create a set of flexible shape classes. If you provide a Graphics object for these classes, the drawing position to tell them, they will know how to draw itself. The class name should be MyLine, MyRect and MyOval (Tip: You can have a common parent class MyShape). Using a random number to the position and shape of the shape type.
Randomly create 20 MyLine, MyOval and MyRect class object, and then call the draw method of the graphic display it.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Lab5-3\.classpath
......\.project
......\bin\lab5_3\MainClass.class
......\...\......\MyLine.class
......\...\......\MyOval.class
......\...\......\MyPanel.class
......\...\......\MyRect.class
......\...\......\MyShape.class
......\lab5-3.jar
......\src\lab5_3\MainClass.java
......\...\......\MyLine.java
......\...\......\MyOval.java
......\...\......\MyPanel.java
......\...\......\MyRect.java
......\...\......\MyShape.java
......\bin\lab5_3
......\src\lab5_3
......\bin
......\src
Lab5-3