经典Java程序源代码.doc


文档分类:IT计算机 | 页数:约137页 举报非法文档有奖
1/137
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/137
文档列表 文档介绍
().*;.*;.*;lassAdderimplementsActionListener{ JFrameAdderFrame; JTextFieldTOprand1; JTextFieldTOprand2; JLabelLAdd,LSum; JButtonBAdd,BClear; JPanelJP1,JP2; publicAdder() { AdderFrame=newJFrame("AdderFrame"); TOprand1=newJTextField(""); TOprand2=newJTextField(""); LAdd=newJLabel("+"); LSum=newJLabel("="); BAdd=newJButton("Add"); BClear=newJButton("Clear"); JP1=newJPanel(); JP2=newJPanel(); (this); (newActionListener() { publicvoidactionPerformed(ActionEventevent) { (""); (""); ("="); } }); (JP1); (TOprand1); (LAdd); (TOprand2); (LSum); (JP2); (BAdd); (BClear); ().setLayout(newBorderLayout()); ().add(JP1,); ().add(JP2,); (newWindowAdapter() { publicvoidwindowClosing(WindowEventevent) { (0); } }); (); (true); (false); (250,100); } publicvoidactionPerformed(ActionEventevent) { doublesum=(double)((()).doubleValue()+(()).doubleValue()); ("="+sum); } publicstaticvoidmain(String[]args) { Adderadder=newAdder(); }}小型记事本(该java源文件由两个类构成,).*;.*;.*;.*;classmynotepadextendsJFrame{Filefile=null; Colorcolor=; mynotepad() { initTextContent(); initMenu(); initAboutDialog(); } voidinitTextContent() { getContentPane().add(newJScrollPane(content)); }JTextPanecontent=newJTextPane();JFileChooseropenfile=newJFileChooser();JColorChooseropencolor=newJColorChooser();JDialogabout=newJDialog(this);JMenuBarmenu=newJMenuBar(); //菜单栏的各个菜单项 JMenu[]menus=newJMenu[]{newJMenu("

经典Java程序源代码 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数137
  • 收藏数0 收藏
  • 顶次数0
  • 上传人bjy0415
  • 文件大小292 KB
  • 时间2019-05-28