登录
首页 » 其他 » Java绘图:绘制虚线与实线

Java绘图:绘制虚线与实线

于 2022-01-28 发布 文件大小:3.46 kB
0 205
下载积分: 2 下载次数: 1

代码说明:

Java绘图:绘制虚线与实线   public LineDemo(){    super("实线与虚线"); //调用父类构造函数    setSize(300,200); //设置窗口尺寸    setVisible(true); //设置窗口可视    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //关闭窗口时退出程序   }   public void paint(Graphics g){ //绘制组件方法    Graphics2D g2=(Graphics2D)g; //得到2D图形    Dimension dim = this.getSize(); //得到组件尺寸    g2.setColor(Color.white); //设置绘制颜色为白色    g2.fillRect(0, 0, dim.width, dim.height); //填充整个组件    g2.setColor(Color.black); //设置绘制颜色    g2.drawLine(40,160,280,160); //绘制实线    g2.drawLine(40,160,40,40);    g2.drawString("0",30,165); //绘制字符串    g2.drawString("100",16,50);    g2.drawString("200",270,175);    float[] dash={5,5}; //短划线图案    BasicStroke bs = new BasicStroke(1,BasicStroke.CAP_BUTT,BasicStroke.JOIN_MITER, 10.0f,dash,0.0f); //实例化新画刷    g2.setStroke(bs); //设置新的画刷    g2.drawLine(40,160,100,120); //用新的画刷绘制虚线

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

发表评论

0 个回复

  • proposed and developed a new type of power system transient fault simulation and...
    提出并研制了一种新型电力系统暂态故障模拟再现系统。该系统通过将系统发生故障时故障录波器录下的数据转换为符合IEEE的COMTRADE格式文件,经数据处理软件进行分析后由电脑并口送入多功能继电保护测试仪,最终由测试仪还原成故障时的PT、CT二次侧电压、电流信号。该系统对继电保护装置参数整定、事故原因查找及分析等有辅助作用。-proposed and developed a new type of power system transient fault simulation and reconstruction system.IEEECOMTRADE. The system of relay device parameter setting, the cause of the accident investigation and analysis of a supporting role.
    2022-09-11 21:10:03下载
    积分:1
  • I2C读写24c系列存储器,不需修改可以直接使用。单片机为51系列。...
    I2C读写24c系列存储器,不需修改可以直接使用。单片机为51系列。-i2c
    2022-08-07 10:08:34下载
    积分:1
  • E罗四方块用VC++编写的游戏
    俄罗斯方块 VC++实现 希望可以帮助到大家-e luo si fang kuai Game programed by VC++
    2023-07-15 14:05:05下载
    积分:1
  • 功能说明: 1.支持UBB 2.支持版主回复. 3.支持留言删除. 4.支持管理密码修改. 5.管理员可查看留言网友IP地址. 6.过滤...
    功能说明: 1.支持UBB 2.支持版主回复. 3.支持留言删除. 4.支持管理密码修改. 5.管理员可查看留言网友IP地址. 6.过滤""字符带来的安全隐患. 后台登陆:mofei_login.asp 用户名和密码为mofei -Function Description: 1. Support UBB2. Support Moderators Reply .3. Support message delete .4. To support the management of the password modify .5. Administrators can view the message User IP Address .6.
    2022-08-25 21:27:35下载
    积分:1
  • 参加运动会的n个学校编号为l~n。比赛分成m个男子项目和w个女子项目, 项目编号分别为l~m和m+1~m+w。由于各项目参加人数差别较大,有些项目 取前...
    参加运动会的n个学校编号为l~n。比赛分成m个男子项目和w个女子项目, 项目编号分别为l~m和m+1~m+w。由于各项目参加人数差别较大,有些项目 取前五名,得分顺序为7,5,3,2,1;还有些项目只取前三名,得分顺序为5, 3,2。设计一个统计系统按名次产生各种成绩单、得分报表。 -To participate in the Games n school numbered l ~ n. Competition is divided into m men and a woman w projects numbered l ~ m and m 1 ~ m w. As a result of differences in the number of participants larger projects, some projects from the top five scores in order of 7,5,3,2,1 also some of the items, only the top three scores in order of 5,3,2. Design a statistical system rankings produced by a variety of report card, scoring statements.
    2022-01-23 10:22:43下载
    积分:1
  • 点击放大的Flash相册
    点击放大的Flash相册,每次刷新页面自动打散图片,以缩略图方式显示,随意点击一张图片,在当前放大显示,双击返回缩略图。带有Flash源文件。
    2022-03-19 15:23:41下载
    积分:1
  • MoAspEnginer ASP MVC开发框架 v3.1.1.382
    MoAspEnginer ASP MVC开发框架,一款基于JScript的ASP开源MVC框架。模板编译ASP代码,让ASP代码和程序真正分离,单文件入口,支持类库扩展以及模板自定义标签扩展,支持多数据库操作,支持表单验证,提供HttpRequest,HttpUpload,Soap,OAUTH2.0等模块,提供AES/DES/RC4/Rabbit/pbkdf2/ripemd160等算法,内置Json解析和多种路由方式,支持类库缓存,编译缓存,HTML缓存,数据库Model缓存等。。。让您换一种方式开发ASP应用。   
    2022-05-13 13:02:04下载
    积分:1
  • C# XML序列化源码
    C# XML序列化源码-C# XML serialization FOSS
    2022-01-25 20:53:03下载
    积分:1
  • 如果ATL组件称为阴极射线管
    如果在 ATL 组件程序中调用了 CRT 的运行时刻库函数,比如开平方 sqrt() ,那么编译的时候可能会报错“error LNK2001: unresolved external symbol _main”。怎么办?下面方法中的任何一个都可以纠正这个错误:-If the ATL component called the CRT-program run-time library functions, such as the square root sqrt (), then the compiler will complain when possible " error LNK2001: unresolved external symbol _main" . How to do? Any one of the following methods can rectify this error:
    2022-02-12 21:47:56下载
    积分:1
  • 用户输入0
    用户输入0-127之间的数,输出其对应的ascii码的符号-user input between the 0-127 number, the output of their counterparts ascii code symbols
    2022-08-18 18:19:21下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载