ImageVerifierCode 换一换
格式:DOCX , 页数:68 ,大小:26.97KB ,
资源ID:22431228      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/22431228.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(java案例Word文档格式.docx)为本站会员(b****8)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

java案例Word文档格式.docx

1、import java.util.*;import java.io.*;/运动会类public class Sports implements Serializable public String sportsdate;/举行时间 public String sportsplace;/举行地点 public String name;/运动会名称 public Player player;/该运动会所有选手 public ProgramStyle style;/该运动会的所有花样动作 public Play play;/该运动会的赛程表 public Sports(String name,Str

2、ing date,String place) sportsdate=date; sportsplace=place; this.name=name; public Sports(String name) this(name,); public Sports() this( private void setPlayerNumber(int number) if(number=player.length) return; if(number=0) player=null; return; Player temp; temp=player; player=new Playernumber; int

3、len=numbertemp.length?number:temp.length; System.arraycopy(temp,0,player,0,len); public void addPlayer(Player s) if(player=null) player=new Player1; player0=s; setPlayerNumber(player.length +1); playerplayer.length-1=s; public void deletePlayer(int index) if(index=player.length) return; for(int i=in

4、dex;i=play.length) return;play.length-1; playi=playi+1; setPlayNumber(play.length-1); private void setProgramStyleNumber(int number) if(number=style.length) return; style=null; ProgramStyle temp; temp=style; style=new ProgramStylenumber; System.arraycopy(temp,0,style,0,len); public void addProgramSt

5、yle(ProgramStyle s) if(style=null) style=new ProgramStyle1; style0=s; setProgramStyleNumber(style.length +1); stylestyle.length-1=s; public void deleteProgramStyle(int index)0|style=null|index=style.length) return;style.length-1; stylei=stylei+1; setProgramStyleNumber(style.length-1);/ScoreDlg.java/

6、修改比赛赛程项中各裁判给各选手打分的Dialog类public class ScoreDlg extends Dialog implements ActionListener Object data; Object head; Play play; JTable table; JPanel main; JScrollPane sp; public void actionPerformed( ActionEvent e ) if(e.getActionCommand().equalsIgnoreCase(取消) dispose(); else if(e.getActionCommand().eq

7、ualsIgnoreCase(添加选手 if(data=null) return; Object temp=data; data=new Objecttemp.length; for(int i=0; datai=new Objecttempi.length+1; System.arraycopy(tempi,0,datai,0,tempi.length); showTable(); show();删除选手 String no=JOptionPane.showInputDialog(请输入要删除的选手代号 if(no=null) return; data=new Objecttemp.leng

8、thtemp0.length-1; if(no.equalsIgnoreCase( System.arraycopy(tempi,0,datai,0,tempi.length-1); for(int i=1;temp0.length; if(temp0i.toString().equalsIgnoreCase(no) for(int j=0;jj+) int k; for(k=0;ki;k+) datajk=tempjk; for(k=i;tempj.length-1; datajk=tempjk+1; break;添加裁判 data=new Objecttemp.length+1temp0.

9、length; System.arraycopy(temp,0,data,0,temp.length);删除裁判请输入要删除的裁判名称 data=new Objecttemp.length-1temp0.length; System.arraycopy(temp,0,data,0,temp.length-1); if(tempi0.toString().equalsIgnoreCase(no) System.arraycopy(temp,0,data,0,i); System.arraycopy(temp,i+1,data,i,temp.length-i-1);确定 if(play=null|

10、table=null) JOptionPane.showMessageDialog(this,请确保数据不为空! int m,n; m=table.getRowCount(); n=table.getColumnCount(); play.player=null;n; String name=table.getValueAt(0,i).toString(); if(!name.equalsIgnoreCase() play.addPlayer(name); play.referee=null;m; String name=table.getValueAt(i,0).toString();) p

11、lay.addReferee(name); score=null; score=new doublem-1n-1; for(int j=1; String name=table.getValueAt(i,j).toString(); scorei-1j-1=Double.parseDouble(name); public void showTable() if(sp! main.remove(sp); if(data! head=new Objectdata0.length; head0=裁判名单;data0.length; headi=选手+(new Integer(i).toString(

12、); table=new JTable(data,head); table.setValueAt(new String(裁判选手),0,0); sp=new JScrollPane(table); main.add(sp,BorderLayout.CENTER); public ScoreDlg(Frame frame,Object d,Play p) ScoreDlg.this.dispose(); play=p; head=null; main=new JPanel(new BorderLayout(); add(main,BorderLayout.CENTER); / Box msout

13、h=Box.createHorizontalBox(); main.add(msouth,BorderLayout.SOUTH); msouth.add(Box.createHorizontalGlue(); JButton addplayer=new JButton( msouth.add(addplayer); addplayer.addActionListener(this); JButton deleteplayer=new JButton( msouth.add(deleteplayer); deleteplayer.addActionListener(this); JButton

14、addreferee=new JButton( msouth.add(addreferee); addreferee.addActionListener(this); JButton deletereferee=new JButton( msouth.add(deletereferee); deletereferee.addActionListener(this); / Box south=Box.createHorizontalBox(); add(south,BorderLayout.SOUTH); south.add(Box.createHorizontalGlue(); JButton

15、 ok=new JButton( south.add(ok); ok.addActionListener(this); JButton cancel=new JButton( south.add(cancel); cancel.addActionListener(this); this.setModal(true); this.setTitle(当前赛项的裁判给选手打分的情况/ ProgramStyle.java/花样类public class ProgramStyle implements Serializable/花样名称 public double hardfactor;/难度系数 pu

16、blic String depiction;/花样简述 public ProgramStyle(String name,double hardfactor,String depiction) this.hardfactor=hardfactor; this.depiction=depiction; public ProgramStyle(String name,double hardfactor) this(name,hardfactor, public ProgramStyle(String name) this(name,0); public ProgramStyle()/Player.j

17、ava/选手即比赛者类public class Player implements Serializable/选手名称 public int age;/年龄 public String address;/住址 public String phonenumber;/电话号码 public String no;/选手代号/选手个人简历 public Player(String no,String name,int age,String address,String phonenumber,String depiction) this.no=no; this.age=age; this.addres

18、s=address; this.phonenumber=phonenumber; public Player(String no,String name,int age) this(no,name,age, public Player(String no,String name) this(no,name,20); public Player(String no) this(no, public Player()/Play.java/比赛赛程项类public class Play implements Serializable public String program;/比赛项目名称 pub

19、lic String date;/开始日期 public String style; public String place;/比赛地点 public String player;/所参加的选手 public String referee;/所参加的裁判 public double netscore;/各裁判给各选手的打分(净得分) public Play() public Play(String name,String s) this(name,s, public Play(String name,String s,String p,String d) program=name; style=s; place=p

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1