0% found this document useful (0 votes)
144 views44 pages

Advance Programming in Java Pokhara University Solved Answers

Solved Answers ( Advance Programming in Java ) of Pokhara University.

Uploaded by

aditi.adhikari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
144 views44 pages

Advance Programming in Java Pokhara University Solved Answers

Solved Answers ( Advance Programming in Java ) of Pokhara University.

Uploaded by

aditi.adhikari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 44
\ 2016 - Fall == 0) Ame various windows \fovdanental areii( put) \Y WmPonent iy uataimey iy Panel union Window: li vy Fame. Sad Bi vy Quva uw hy " " s Diolog vox Wohwe iisparsmall ‘aropntcal Window) nat displays A mesioge to tne wen BY veg west’ input: Two dialog, boxes t Aolog: a diotog Ox -matdue plays A her age Sapud Alaloa,: a dalon vox nal ‘Prompts Goud, Ae wren for bvent Mistaney in Davao desiqued dp woam some Kind of event- ft Bilstenes' for av event eur as awrerd mouse dickod ora Key premsyand men it wespowds .) accorollualin, And WO Ken, ewing forhunw in'dava ane: Swing vemponenis me Noy wefgnt and dowit velw Ov peers. Lwin, su@Povts A plvagniole look an feet. Scanned with CamScanner E Cul Slawel ; Slabel is Anss e| swing . Slabel te me. b Alsplay aA _svort Sst¥ina oran inage Teron. Stoel an Ateplons bok textiand “tmneae, S Lass lum: The uass imageiven te an om entation ef tne fom, intents! tat paivis ivan from imagen Pavam“nins wan pe Mssed ® au applet fyom. — A HTMA page. Pavawntheis——nre—presek—ner — To pass ane. parame j2sitd the applet we — need 2 wre) param) arbibute of » a data tier Three lanes tr tme tured || rien _avusttecore ane as follows: Ty Ufent layer Bvswors oer oka loner K is alse called Presentation layer wytdr wmtains UI ponk of Ow op plicatton- IWis aver 1s wped for desfgn purpose ‘we dain is\ presented toduo urti_ov input te daKon frown. fuser . Fo .+exk box, Lawet button etc: Business layer + Ln mis lane al wesivwys lopte writtaw hke valida’ ct data, calulotian, daraiincertion ett. thks acks Gp imierbace beboeom Okork Lower ank data lay {wis lamer js): 0490, called tne sIntermedanm 1ar Wepe tOMAKO. | Lvommuniuation Faster pemwtan ont and data lower. Anis wacked» datalo ane, Loney In ne \ _ Dakn accom layer comiaing mekwods ott lugdQXh , ddlite aA pet, dakp Qyown _abenvo-ow Scanned with CamScanner don own input data. 1 AOE application . = Mineo, Hen avohiitedne . mols he steps fev" writing a Soviet are: Create a ass -nat ‘extends HUpSeaviet ay Define 3 metuon: v Wit), doGert) and do Post) yl Tere ra an avlek- Mee Ave Alled a3 callback a tb IMé | wo iner ji heal avtot Senvie’: Scanned with CamScanner for a | me. GET nog wssts, Ane weld umiainer imvoKes Ane .° Ao Gebl) meted and fov 005 T mequocts in Wwokes te doPesty) mestnod - ud wir tb phys y 4 és ' ! “ - t iu \ phew ! i er 1 Lp by Hat 7 1 totes bet 2 i \ ny 4 let 4 t ; ' f \ ’ ii 24 Lat yi (vb ; } a Scanned with CamScanner on Qi soec stands Oat vit a vonida 1s a technology twat alles. Java application, & dn: ! i ~llintenget with nelational datavase =| exeutt. Sq. —queniea_againsk datababes __— Qin tne Sava Platform, Gatien prise edition a depieyes—- zent_deacripree _Aeacribes ov a temaponent, ~~ Compile me Opelek _Sarvee ode using javac Open ue Whi fie in me web wrowbser “owing Is built in Awt" pecause: Swing lempourents one right wetgnt- = aa i swing supports pluggable. look. av feel initt) metnod ef Servlet geks called wnen tne wach svovid initialiae voriavles. Scanned with CamScanner e=d The advantages of ssa SSP one: Tse Page —ANe dynamically uanpiled._ivatp servlet ‘eellione (ta\se) method, we can wake Buy acias, iw Sava swing. text feild nem editable. a "Seatiohet fg a pie of Sava _vode saat represents 4p aenerate and display the procnrsing loode dunamic _vewient when nerdedin the page . i Sywtax : objett oriented SP 0006 ve provedueal — Scanned with CamScanner =o Wea Ube SOBC in any 6ywe can Use OD Bo ive — plakfor vm Only wy dows ————_ 2u i platform: Inwoduced by SUM Mino zy Antrodurea by Syptams Ty 1997. Minosoft In 199 +h ot Sy oBBC wines neguinve manuel insiallation, + manual inerallation - Sy TOBE fo seumed is ST OMSE Is lens Secureot:- qnl steps ‘to \wnnect © dataloare iw xaw ane: 3 Register me driver clacs .— Wsing foyNamel) method Create tne _connectfon wolojecti. get “imnechion () memy of OiverManagnr dass io wred Sue scp (uate me! statement Ob\ect + Creates iatement() mackncd of cennectton Jutemface is) wed. Grete me Quny.= exetuke Quorn () WRIN Od. Of Statement jintertace ie week A0Ee Ne LUMuettion Proj eck * dO2() metred af umneiion _intevface is uned Scanned with CamScanner ~Qmols* a Say Re | S266 appliation servers: Unlike simple java programs , we dow 't wre —java__uemmand to exresuke tne Jace }—applicatious, we ure epectal program. Alea - Howey we wre sno same old jame — - vemvnand, to wempile Me appiiahons - Paneer 1 - 4 Ts A_earvt S266 - _apylicattow'. Tis te ie pug mat rons E Aner enterpribe application on me intemget - a S26E Ap pivation Server 1s weadwyads. | istica p : + will ne. r yYOUiall me: REE uapalicachion 3 ~ Thre ane: eevonl free and vemmenctal appli'catfons servers available in-me wwarket today mat cone developed wn many well Khoon _ what is _dme__punpase of Aawe lopiva tne Sa senvers? lope, Sonminoseft first fee ee ame votonef _ TAGE plarform mat can be med to lonfid tne — eine Lente py ise ears ta Sava Scanned with CamScanner Bere _-~n. eR _recnviolo, nce om NW tank lost onus: | ! ication. \uild tne t : T2EE Nealon. Senver o 4) WnIdn Means MA be bs Scanned with CamScanner as i Panel ySs anit 1 2 | frome _is an AWT componnnt. wll Is an_Awt weich's o bp level window Represents a single. wit wordler ana title. Container +nwak aw : aba of (422 ompony 3) fame to a subunss of 9 Panel ba subclass window - ‘heel ‘ st umiainn. Laterfor ane: LY Ke vote be ay pubic ed Event. 3y|_public absiouk as wo, ednagebn ge] 3.|| A seaviet fs a serven stole Java progroun amok procure HHP nequenk and gencnatis Up _neopouse - ane Ano types of apple ang; doch apelek de iy Remote “applet: Scanned with CamScanner G29 Brent: Source : Bvemt source _ is an ovjeck onwhidn an event ours» Tk is nesponsible fer providing in formation about occured event to [ts nandler. Event Aistencr: Evenntdistener im Sava fo Aesiqned to prowys some ina. event ~ Pit “Iistens" fox an erent Sun 0s str — wouse Wicked OY Kentupeol - and +nen it nesponds | accordingly. uy window usi ror ur _cmatret witwin a windsw by using _ J semae_kind. 4 |_alagoritum- The Jaanouk WAVaQ 2» Jo sek vous 6okdosacuk () nattnod - pa fae ea io : } GET ! Pos T Oulu ASCII cnavacters allowed 2 no nesmiivon In date type, Viva data Is auUowed - Dakaisvisiole bo everrpnd 2 Oaka 16 not Usp layeé | InuRL T4 URL. Scanned with CamScanner tr |_A scriptter 15 a plect ef jovavede” nak! 0 ~T [ts _nopresonts pyoctasiinay Leah. tp genenaieiand *_ Ms vlan " dynamle “veténts | whon necdesk - tA _4né page: lio i a } L ‘BY | two Kan feahines cnt vic bam eer 1p] Sving vemponents’ ane Wantwelgnt ay Swing supporis Q pluggable “100k. ard feel 10 iar ae eas aa aioe YasHpu one: d } G sf aie Alf i fi it Qutonis ty) 1 foagle boHon 2 A single. 9. FB toggle buHon Naw + olate: two states pushed one. | woe iA _or MOE pusnadlin Scanned with CamScanner (ised) : frais i) \ Sarted i fev 13 a i Sain “ ere i ys ine _-me following metnoo’ ano befing calle d in, sequence: Wed: the init) metvod fs me fvat metnod beiug called: This.is me, step where we snovid Initialize me variable tis metnod io allied Oulvy pce dAuving vuhme of an applet: Stayt) ithe stavtl) metvod is me seuma step of an applet. tt is called +p vestot an_appiet afte? 4 was been stopped: while vit) io called | one time wren applet te [oaded- spytO: io walled can re aw Scanned with CamScanner == applet HIML Oumont Se_dleplayed av sinew WM padat()- The palit) method 1s called each” shine wren Aw bared applets output yvst be yedvawn. The paiint() wemnod 4 . As ove _paparnere> _¢1 have dvapufcs YI Stopl)- The stof) method io called when a wn® Wel: browser kaves me _utml doaurent voutaining applets When 1} goes to anotner page for example diotroyl)~ The. destroy) metnodl is uaed wher ‘me enlornment _aéteemines ‘mak. your apple: must be removed _vomplete/y fon Me memory . impoyt. java. apple’ . Appleby Junpov yao. aund.—Grapiades j ____ 4 (i! e¢applet: code = “wre Param .Uass'! ywidt.£"300 * heiqnt ="300 " (etpavovnnames: “msg |! valne eHello Applee't> | Scanned with CamScanner an = ST = _T jop-SetPrapenhy = tulis action ay. ownt sipgests ts used” | to populake wwe pean ovopeptieain ne | Spectfled. supe. Syntax foy chats action | =<429: Set Propecty noun = a |__=“\propenty nawag valre = uli for example if we veed to_populate a lean whose property's fiysttmme wim a Value Sohn we use dtnis autPon ads svown beso: n jsp: Set Property naumg = Yuus!' prepentys \namse Jalwe = “'Sown"/ ace Mis standavd action fo wredlit? vestyiene 2 speckfied, erOperk, von a pean Wa. Specifies wade peta $ awis adton: prsuing Scanned with CamScanner Oz==0 . dont hota. 5 q A L a Lanroko 8. A server Side womponront aoe aia Xe bean wit all te information iELA__seansst or Sexson. the sop wl ten meriene ne bean and displays “ine Mformation © Uient. (Qde + QO\6 - 4, et ou eleation, taole, Ren Lo LO >in web lorowser using $SP~ x. @ page carentgonel Bost apo” pagee vitodki SUTe-8" hey <1L@ page isbn 5 Saas jave-vH ® 5 yave genvlek Bil). 2 f | Ooctupe nimi7 el AtwAl

You might also like