home *** CD-ROM | disk | FTP | other *** search
/ Sams Teach Yourself C in 21 Days (6th Edition) / STYC216E.ISO / mac / Examples / Day27 / PopUpDemo.java < prev    next >
MacBinary  |  2002-05-26  |  1.5 KB  |  [TEXT/LMAN]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Sun May 26 12:46:12 2002, modified Sun May 26 12:46:12 2002, creator 'LMAN', type ASCII, 987 bytes "PopUpDemo.java" , at 0x45b 286 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[LMAN]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0e 50 6f 70 55 70 44 | 65 6d 6f 2e 6a 61 76 61 |..PopUpD|emo.java|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4c 4d 41 | 4e 00 00 ff ff ff ff 00 |.TEXTLMA|N.......|
|00000050| 00 00 00 00 00 03 db 00 | 00 01 1e b9 16 c1 d4 b9 |........|........|
|00000060| 16 c1 d4 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 1f c6 00 00 |........|........|
|00000080| 69 6d 70 6f 72 74 20 6a | 61 76 61 2e 6c 61 6e 67 |import j|ava.lang|
|00000090| 2e 53 79 73 74 65 6d 2e | 2a 3b 0d 0a 69 6d 70 6f |.System.|*;..impo|
|000000a0| 72 74 20 6a 61 76 61 2e | 61 77 74 2e 2a 3b 0d 0a |rt java.|awt.*;..|
|000000b0| 0d 0a 70 75 62 6c 69 63 | 20 63 6c 61 73 73 20 50 |..public| class P|
|000000c0| 6f 70 55 70 57 69 6e 64 | 6f 77 44 65 6d 6f 20 65 |opUpWind|owDemo e|
|000000d0| 78 74 65 6e 64 73 20 46 | 72 61 6d 65 20 7b 0d 0a |xtends F|rame {..|
|000000e0| 0d 0a 20 20 20 42 75 74 | 74 6f 6e 20 6f 70 65 6e |.. But|ton open|
|000000f0| 2c 20 71 75 69 74 3b 0d | 0a 20 20 20 46 72 61 6d |, quit;.|. Fram|
|00000100| 65 20 70 6f 70 75 70 20 | 3d 20 6e 65 77 20 50 6f |e popup |= new Po|
|00000110| 70 55 70 57 69 6e 64 6f | 77 28 22 49 20 61 6d 20 |pUpWindo|w("I am |
|00000120| 61 20 70 6f 70 75 70 20 | 77 69 6e 64 6f 77 22 29 |a popup |window")|
|00000130| 3b 0d 0a 20 20 20 46 6c | 6f 77 4c 61 79 6f 75 74 |;.. Fl|owLayout|
|00000140| 20 6c 6d 20 3d 20 6e 65 | 77 20 46 6c 6f 77 4c 61 | lm = ne|w FlowLa|
|00000150| 79 6f 75 74 28 46 6c 6f | 77 4c 61 79 6f 75 74 2e |yout(Flo|wLayout.|
|00000160| 43 45 4e 54 45 52 29 3b | 0d 0a 0d 0a 20 20 20 70 |CENTER);|.... p|
|00000170| 75 62 6c 69 63 20 50 6f | 70 55 70 57 69 6e 64 6f |ublic Po|pUpWindo|
|00000180| 77 44 65 6d 6f 20 28 53 | 74 72 69 6e 67 20 74 69 |wDemo (S|tring ti|
|00000190| 74 6c 65 29 20 7b 0d 0a | 20 20 20 20 20 20 73 75 |tle) {..| su|
|000001a0| 70 65 72 28 74 69 74 6c | 65 29 3b 0d 0a 20 20 20 |per(titl|e);.. |
|000001b0| 20 20 20 73 65 74 4c 61 | 79 6f 75 74 28 6c 6d 29 | setLa|yout(lm)|
|000001c0| 3b 0d 0a 20 20 20 20 20 | 20 73 65 74 53 69 7a 65 |;.. | setSize|
|000001d0| 28 34 30 30 2c 20 32 35 | 30 29 3b 0d 0a 20 20 20 |(400, 25|0);.. |
|000001e0| 20 20 20 6f 70 65 6e 20 | 3d 20 6e 65 77 20 42 75 | open |= new Bu|
|000001f0| 74 74 6f 6e 28 22 53 68 | 6f 77 20 70 6f 70 2d 75 |tton("Sh|ow pop-u|
|00000200| 70 20 77 69 6e 64 6f 77 | 22 29 3b 0d 0a 20 20 20 |p window|");.. |
|00000210| 20 20 20 61 64 64 28 6f | 70 65 6e 29 3b 0d 0a 20 | add(o|pen);.. |
|00000220| 20 20 20 20 20 71 75 69 | 74 20 3d 20 6e 65 77 20 | qui|t = new |
|00000230| 42 75 74 74 6f 6e 28 22 | 51 75 69 74 20 70 72 6f |Button("|Quit pro|
|00000240| 67 72 61 6d 22 29 3b 0d | 0a 20 20 20 20 20 20 61 |gram");.|. a|
|00000250| 64 64 28 71 75 69 74 29 | 3b 0d 0a 20 20 20 7d 0d |dd(quit)|;.. }.|
|00000260| 0a 20 20 20 70 75 62 6c | 69 63 20 73 74 61 74 69 |. publ|ic stati|
|00000270| 63 20 76 6f 69 64 20 6d | 61 69 6e 28 53 74 72 69 |c void m|ain(Stri|
|00000280| 6e 67 20 61 72 67 73 5b | 5d 29 20 7b 0d 0a 20 20 |ng args[|]) {.. |
|00000290| 20 20 20 20 50 6f 70 55 | 70 57 69 6e 64 6f 77 44 | PopU|pWindowD|
|000002a0| 65 6d 6f 20 61 70 70 20 | 3d 20 6e 65 77 20 50 6f |emo app |= new Po|
|000002b0| 70 55 70 57 69 6e 64 6f | 77 44 65 6d 6f 20 28 22 |pUpWindo|wDemo ("|
|000002c0| 50 6f 70 2d 75 70 20 77 | 69 6e 64 6f 77 20 64 65 |Pop-up w|indow de|
|000002d0| 6d 6f 22 29 3b 0d 0a 20 | 20 20 20 20 20 61 70 70 |mo");.. | app|
|000002e0| 2e 73 68 6f 77 28 29 3b | 0d 0a 20 20 20 7d 0d 0a |.show();|.. }..|
|000002f0| 0d 0a 20 20 20 70 75 62 | 6c 69 63 20 62 6f 6f 6c |.. pub|lic bool|
|00000300| 65 61 6e 20 61 63 74 69 | 6f 6e 28 45 76 65 6e 74 |ean acti|on(Event|
|00000310| 20 65 76 74 2c 20 4f 62 | 6a 65 63 74 20 61 72 67 | evt, Ob|ject arg|
|00000320| 29 20 7b 0d 0a 20 20 20 | 20 20 20 69 66 20 28 65 |) {.. | if (e|
|00000330| 76 74 2e 74 61 72 67 65 | 74 20 69 6e 73 74 61 6e |vt.targe|t instan|
|00000340| 63 65 6f 66 20 42 75 74 | 74 6f 6e 29 20 7b 0d 0a |ceof But|ton) {..|
|00000350| 20 20 20 20 20 20 20 20 | 20 53 74 72 69 6e 67 20 | | String |
|00000360| 6c 61 62 65 6c 20 3d 20 | 28 53 74 72 69 6e 67 29 |label = |(String)|
|00000370| 61 72 67 3b 0d 0a 20 20 | 20 20 20 20 20 20 20 69 |arg;.. | i|
|00000380| 66 20 28 6c 61 62 65 6c | 2e 65 71 75 61 6c 73 28 |f (label|.equals(|
|00000390| 22 53 68 6f 77 20 70 6f | 70 2d 75 70 20 77 69 6e |"Show po|p-up win|
|000003a0| 64 6f 77 22 29 29 20 7b | 0d 0a 20 20 20 20 20 20 |dow")) {|.. |
|000003b0| 20 20 20 20 20 20 69 66 | 20 28 21 70 6f 70 75 70 | if| (!popup|
|000003c0| 2e 69 73 53 68 6f 77 69 | 6e 67 28 29 29 0d 0a 20 |.isShowi|ng()).. |
|000003d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 70 | | p|
|000003e0| 6f 70 75 70 2e 73 68 6f | 77 28 29 3b 0d 0a 20 20 |opup.sho|w();.. |
|000003f0| 20 20 20 20 20 20 20 7d | 0d 0a 20 20 20 20 20 20 | }|.. |
|00000400| 20 20 20 65 6c 73 65 20 | 7b 0d 0a 20 20 20 20 20 | else |{.. |
|00000410| 20 20 20 20 20 20 20 20 | 53 79 73 74 65 6d 2e 65 | |System.e|
|00000420| 78 69 74 28 30 29 3b 0d | 0a 20 20 20 20 20 20 20 |xit(0);.|. |
|00000430| 20 20 7d 0d 0a 20 20 20 | 20 20 20 7d 0d 0a 20 20 | }.. | }.. |
|00000440| 20 20 20 20 72 65 74 75 | 72 6e 20 74 72 75 65 3b | retu|rn true;|
|00000450| 0d 0a 20 20 20 7d 0d 0a | 7d 0d 0a 00 00 00 00 00 |.. }..|}.......|
|00000460| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000470| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000480| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00000490| 54 68 69 73 20 72 65 73 | 6f 75 72 63 65 20 66 6f |This res|ource fo|
|000004a0| 72 6b 20 69 6e 74 65 6e | 74 69 6f 6e 61 6c 6c 79 |rk inten|tionally|
|000004b0| 20 6c 65 66 74 20 62 6c | 61 6e 6b 20 20 20 00 00 | left bl|ank ..|
|000004c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000500| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000510| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000520| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000540| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000580| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00000590| 00 00 00 00 00 00 00 00 | 00 1c 00 1e ff ff 00 00 |........|........|
|000005a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+