登录
首页 » Java » Mypicture

Mypicture

于 2021-04-14 发布 文件大小:13KB
0 332
下载积分: 1 下载次数: 1

代码说明:

  定义4个类,MyShape、MyLine、MyRectangle和MyOval,其中MyShape是其他三个类的父类。MyShape为抽象类,包括图形位置的四个坐标;一个无参的构造方法,将所有的坐标设置为0;一个带参的构造函数,将所有的坐标设置为相应值;每个坐标的设置和读取方法;abstract void draw(Graphics g)方法。MyLine类负责画直线,实现父类的draw方法;MyRectangle负责画矩形,实现父类的draw方法;MyOval负责画椭圆,实现父类的draw方法。编写一个应用程序,使用上面定义的类,随机选取位置和形状,绘制20个图形。(Defines four classes, MyShape, MyLine, MyRectangle and MyOval, which MyShape the other three parent class. MyShape is an abstract class, including graphics position four coordinates a no-argument constructor, all the coordinates are set to 0 a parameterized constructor, all the coordinates is set to the corresponding values each coordinate set and reading method abstract void draw (Graphics g) method. MyLine class is responsible for drawing straight lines, to achieve the draw method of the parent class MyRectangle responsible for drawing rectangles, to achieve the parent class draw method MyOval responsible painted oval, draw method to achieve the parent class. Write an application that uses the class defined above, randomly selected location and shape, draw 20 graphics.)

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • Programming-questions
    Programming questions for every one
    2020-10-25 15:10:00下载
    积分:1
  • 此示例将向您展示如何使用WebBrowser控件和如何禁用R.
    This sample will show you how to use the WebBrowser Control and how to disable right click context menu for browser s window. Requires installed Internet Explorer 3.xx or Internet Explorer 4.xx. Works with both versions. This sample works with All version of VB5.
    2023-06-04 03:15:03下载
    积分:1
  • AviPlayer
    Avi Player is a Visual C++ application intended to show Video Handling Capabilities of OpenCV : Playing an avi file, capturing from usb cameras,snapshot and use of codecs
    2005-06-16 16:01:41下载
    积分:1
  • JAVA
    有关Java的程序,可以实现火车票预订,订票,退票(you can afford ticket in advance)
    2013-04-21 20:02:09下载
    积分:1
  • auction-lap-master
    说明:  拍卖算法,可以用来学习分布式拍卖算法,了解原理,希望对大家有帮助(this is the distributed auction algorithm developed by Java, hope help anyone who need it!)
    2020-03-24 20:33:19下载
    积分:1
  • SyslogGather
    SyslogGather.exe其实就是一款测试SYSLOG的绿色版软件。可以设置默认端口,默认是514,可以设置是否保存日志。如果你选择了这个选项,则日志在SyslogGather.exe同目录下的logfiles目录中。为纯文本格式。   可能你会说SyslogGather.exe功能并不强大,但是作为一个基本的SYSLOG接收器,倒是也非常轻便。平时做测试的时候,还是非常方便的。 (SyslogGather.exe SYSLOG is actually a green version of the software testing. You can set the default port, the default is 514, you can set whether to save the log. If you choose this option, then log in SyslogGather.exe same directory logfiles directory. To plain text format. You might say SyslogGather.exe function is not strong, but as a basic SYSLOG receiver touches are also very lightweight. Usually do testing, is very convenient.)
    2013-11-16 15:41:22下载
    积分:1
  • vb开发的经典irc客户端源代码,功能齐全,很好的
    vb开发的经典irc客户端源代码,功能齐全,很好的程序-vb development classic irc client source code, full-featured, very good procedures
    2022-05-27 19:31:20下载
    积分:1
  • this an example of Http proxyServer.
    this an example of Http proxyServer.
    2022-02-26 16:23:52下载
    积分:1
  • android-BluetoothSPP
    蓝牙串口程序,实现蓝牙模块与手机连接。。。(android bluetooth uart)
    2014-11-28 20:07:27下载
    积分:1
  • ctor_streambuf
    A 2nd hodograph is the second derivative curve.
    2015-10-09 16:10:23下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载