#e6

e647. 处理鼠标移动事件

component.addMouseMotionListener(newMyMouseMotionListener());publicclassMyMouseMotionListenerextendsMouseMotionAdapter{publicvoidmouseMoved(MouseEventevt){//Pro...

e646. 处理鼠标点击事件

component.addMouseListener(newMyMouseListener());publicclassMyMouseListenerextendsMouseAdapter{publicvoidmouseClicked(MouseEventevt){if((evt.getModifiers()&...

e645. 处理键盘事件

Youcangetthekeythatwaspressedeitherasakeycharacter(whichisaUnicodecharacter)orasakeycode(aspecialvaluerepresentingaparticularkeyonthekeyboard).component.addKeyL...
代码星球 ·2021-02-11

e650. 激活事件

AnobjectwishingtofireitemeventsmustimplementItemSelectable.Thisexampleshowstypicalcodethatanobjectmustimplementtofireitemevents.Whenanitemeventistobefired,fireI...
代码星球 ·2021-02-11

e643. 以匿名类处理事件

Ifaneventhandlerisspecifictoacomponent(thatis,notsharedbyothercomponents),thereisnoneedtodeclareaclasstohandletheevent.Theeventhandlercanbeimplementedusinganano...
代码星球 ·2021-02-11

e649. 处理焦点改变事件

component.addFocusListener(newMyFocusListener());publicclassMyFocusListenerextendsFocusAdapter{publicvoidfocusGained(FocusEventevt){//Thecomponentgainedthefocus...

e644. 处理Action事件

ActioneventsarefiredbysubclassesofAbstractButtonandincludesbuttons,checkboxes,andmenus.AbstractButtonbutton=newJButton("OK");button.addActionListener(newMyActio...
代码星球 ·2021-02-11

e641. 使一个组件成为拖放目标

publicclassDropTargetComponentextendsJComponentimplementsDropTargetListener{publicDropTargetComponent(){newDropTarget(this,this);}publicvoiddragEnter(DropTarget...

e642. 处理拖放事件

ThedroptargetinthisexampleonlyacceptsdroppedStringobjects.AdroptargetmustimplementDropTargetListenerandsupplyanimplementationfordrop().publicvoiddrop(DropTarget...
代码星球 ·2021-02-11

e640. 使一个组件可拖动

Thisexampledemonstratesthecodeneededtomakeacomponentdraggable.Theobjectbeingtransferredinthisexampleisastring.publicclassDraggableComponentextendsJComponentimpl...
代码星球 ·2021-02-11

e638. 向剪切板获取和粘贴图像

//Ifanimageisonthesystemclipboard,thismethodreturnsit;//otherwiseitreturnsnull.publicstaticImagegetClipboard(){Transferablet=Toolkit.getDefaultToolkit().getSyst...

e637. 向剪切板获取和粘贴文本

Thisexamplesdefinesmethodsforgettingandsettingtextonthesystemclipboard.//Ifastringisonthesystemclipboard,thismethodreturnsit;//otherwiseitreturnsnull.publicstat...

python3.x中如何使用base64、base32、base16编码解码

一、base64加密解密加密:[python] viewplain copy  print?>>> import base64  >>> encode = base64.b6...

玩下base64的PHP图片处理

玩下base64的php图片处理publicfunctiontestimg(){$img_dir='../public/1.jpg';//源图片路径$base64_string=$this->imgToBase64($img_dir);//把图片给base64一下echo'<imgsrc="'.$base6...

base64对文件进行加密

https://stackoverflow.com/questions/475421/base64-encode-a-pdf-in-cUseFile.ReadAllBytestoloadthePDFfile,andthenencodethebytearrayasnormalusingConvert.ToBase64St...
代码星球 ·2021-02-08
首页上一页...45678...下一页尾页