|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
JAVA是一种可以撰写跨平台应用软件的面向对象的程序设计语言,由升阳(SunMicrosystems)公司的詹姆斯·高斯林(JamesGosling)等人于1990年代初开发。1).条件(condition)+jedit4.2final+jdk1.42).步骤(steps)1.addthisatorg.gjt.sp.jedit.textarea.TextAreaPainterinmethodpaintComponent(...)after:extensionMgr.paintScreenLineRange(textArea,gfx,firstInvalid,lastInvalid,y,height);add:{//paintwallpaperafterallthatshouldbepaintRectanglerect=this.getVisibleRect();Wallpaper.paintWallpaper(gfx,rect.x,rect.y,rect.width,rect.width,this);}2.addinorg.gjt.sp.jedit.textarea.JEditTextArea//{{{changeWallpaperDialog()method//forchangethewallpaper/***DisplaysthechangeWallpaperDialogdialogbox.*@authorneoedmund*/publicvoidchangeWallpaperDialog(){if(Wallpaper.changeWallpaper(this)){repaint();}}//}}}3.addnewclassorg.gjt.sp.jedit.textarea.Wallpaper/**Createdon2005-3-26*/packageorg.gjt.sp.jedit.textarea;importjava.awt.AlphaComposite;importjava.awt.Composite;importjava.awt.Graphics2D;importjava.awt.image.BufferedImage;importjava.io.File;importjava.io.FileInputStream;importjava.io.IOException;importjava.io.InputStream;importjavax.imageio.ImageIO;importjavax.swing.JComponent;importjavax.swing.JFileChooser;/***@authorneoe*/publicclassWallpaper{staticBufferedImagepic;privatestaticfinalStringDEFALUT_IMG="org/gjt/sp/jedit/icons/wallpaper.jpg";static{System.out.println("helloWallpaper");loadPic(ClassLoader.getSystemResourceAsStream(DEFALUT_IMG));}staticAlphaCompositealpha=AlphaComposite.getInstance(AlphaComposite.SRC_OVER,0.2f);/***@paramgfx*@paramwidth*@paramheight*/publicstaticvoidpaintWallpaper(Graphics2Dg,intcx,intcy,intwidth,intheight,JComponentview){if(pic==null){return;}inty=0;intw=pic.getWidth();inth=pic.getHeight();Compositeold=g.getComposite();g.setComposite(alpha);while(true){intx=0;while(true){g.drawImage(pic,cx+x,cy+y,view);x+=w;if(w<=0||x>=width){break;}}y+=h;if(h<=0||y>=height){break;}}g.setComposite(old);}/***@paramin*/privatestaticvoidloadPic(InputStreamin){try{pic=ImageIO.read(in);}catch(IOExceptione){e.printStackTrace();}}staticFilef;/****/publicstaticbooleanchangeWallpaper(JComponentparent){JFileChooserjfc=newJFileChooser(f);intreturnVal=jfc.showOpenDialog(parent);if(returnVal==JFileChooser.APPROVE_OPTION){f=jfc.getSelectedFile();try{loadPic(newFileInputStream(f));returntrue;}catch(IOExceptione1){e1.printStackTrace();}}returnfalse;}}4.copydefaultwallpaperwhateveryoulikeintoorg/gjt/sp/jedit/icons/wallpaper.jpg5.addthisintoorggjtpjeditactions.xml<ACTIONNAME="change-wallpaper"><CODE>textArea.changeWallpaperDialog();</CODE></ACTION>6.changeorggjtpjeditjedit_gui.props,add"change-wallpaper"intoolbar#{{{Toolbarview.toolbar=new-fileopen-fileclose-buffersave-printpage-setup-undoredocutcopypaste-findfind-next-new-viewunsplitsplit-horizontalsplit-vertical-buffer-optionsglobal-options-plugin-manager-help-change-wallpaper.........change-wallpaper.icon=Help.png........change-wallpaper.label=Change$Wallpaper7.laststep,rebuildsource,restartjedit,havefun.notes:Idon`tknowifitissomethingslowdown,butIlikeit:)
有了这样一个呼声:让java代替C语言成为基本语言。这些足以说明java简单易学的这个优点。其次,java的功能强大,前面我也提到了,EJB3.0的推出使java成为了大型项目的首选。 |
|