Chat Transcript, June 6, 8:30pm
For this chat session, we are referring to several web pages that do not show up in this transcript. Sorry ...
=> [wachsmut] joins at Fri Jun 06 20:27:30 1997 from 153.35.6.46
=> [Don] joins at Fri Jun 06 20:28:13 1997 from 206.173.45.39
wachsmut=> Hi Don, what's up ... | |
Don=> not too much, how about you? | |
wachsmut=> waiting for more people to arrive ! |
=> [Jenn] joins at Fri Jun 06 20:29:28 1997 from 199.174.141.49
Don=> yeah, but its a nice nite so probably outside | |
Don=> or watching basketball maybe??!! | |
wachsmut=> Right ... | |
wachsmut=> Hi Jenn .... |
=> [Rob] joins at Fri Jun 06 20:29:44 1997 from 128.122.209.198
Jenn=> hi | |
wachsmut=> Hi Rob, | |
wachsmut=> looks like we're gathering a crowed ! | |
Rob=> hi Jenn and Bert! | |
Rob=> and Don | |
wachsmut=> David might not make it tonight, he said, | |
wachsmut=> so we're waiting for two more people ... |
=> [Don] leaves at Fri Jun 06 20:30:48 1997
wachsmut=> let's wait for a couple of minutes, then we start | |
wachsmut=> looks like we lost Don, hope he'll be back ! |
=> [Don] joins at Fri Jun 06 20:31:14 1997 from 206.173.45.39
wachsmut=> 2 more minutes - I've something cool today, if it works ! | |
wachsmut=> quick question: everybody using Windows 95 right now ? | |
Don=> yes | |
Rob=> yes | |
wachsmut=> Jenn, I hope you too ? | |
wachsmut=> | |
wachsmut=> hmmmm .... | |
wachsmut=> | |
wachsmut=> Jenn, are you using Windows 95 right now ? | |
wachsmut=> Well ... | |
wachsmut=> hm, looks like Jenn lost her voice .... | |
wachsmut=> anyway, let's do a few questions first, | |
wachsmut=> then I'll answer some questions, if any, | |
wachsmut=> then we'll take a look at something new, but | |
wachsmut=> it will not be so overwhelming as last time .... |
=> [Jenn] leaves at Fri Jun 06 20:34:22 1997
wachsmut=> Alright, here we go ...... | |
wachsmut=> anyone who knows, just say it ... | |
wachsmut=> What's the basic class for almost every Java program ? |
=> [Jenn_] joins at Fri Jun 06 20:35:03 1997 from 199.174.147.190
wachsmut=> What's the basic class for almost any Java program ? | |
wachsmut=> I.e. which class from the awt do you start out with .... | |
Rob=> You mean the "superset" almost all classes will extend? | |
Rob=> component? | |
Don=> java.awt.Frame | |
wachsmut=> Well ... Frame is right ! | |
wachsmut=> what does GUI stand for ? | |
Don=> graphical user onterface | |
Don=> whoops | |
wachsmut=> Great, thanks .... |
=> [aisha] joins at Fri Jun 06 20:36:33 1997 from 149.150.86.4
wachsmut=> interface ... well, good enough | |
wachsmut=> give me an example of a GUI component, | |
wachsmut=> i.e. a class for it ... | |
Rob=> Can I try frame this time? | |
wachsmut=> please ... | |
wachsmut=> yes, frame, another one ? | |
Rob=> button | |
wachsmut=> good .... another one ???? | |
Don=> is TextCompnent one?? | |
wachsmut=> Right, but | |
wachsmut=> TextComponent is more abstract | |
wachsmut=> TextField and TextArea extend TextComponent, and are | |
wachsmut=> more useful .... we'll do those in the next lecture.... | |
wachsmut=> Here's another one: | |
wachsmut=> what's the name of the method to make a frame visible ? | |
wachsmut=> i.e. a frame is invisible by default, and you need to use which | |
wachsmut=> method to make it actually appear on the screen ? | |
wachsmut=> 'show()' .... did you do your readings ???????????? | |
Don=> show | |
wachsmut=> thanks .... guess you did -:) | |
wachsmut=> what's the name of the method to react to events such as a | |
wachsmut=> click on a button ..... | |
wachsmut=> or better, which method responds to a user action such as a | |
wachsmut=> click on a button ? | |
wachsmut=> well ? Anyone ? | |
Don=> ActivateEvent i think? | |
wachsmut=> too much ... | |
wachsmut=> just 'action' .... | |
wachsmut=> To review: | |
wachsmut=> To create a program, you 'extend Frame' .... | |
wachsmut=> then you add GUI components such as 'Button's .... | |
wachsmut=> Finally, the 'action' method is always part of a Frame, | |
wachsmut=> and since your class extends Frame, the action method will be | |
wachsmut=> part of your class. Therefore, what must you do in your class | |
wachsmut=> to achive your goals of your programs ? | |
wachsmut=> (Hint: your class must do something to the 'action' method) | |
Rob=> override it? | |
wachsmut=> Yes ! | |
wachsmut=> That's the basic Java program: | |
wachsmut=> extend Frame | |
wachsmut=> add GUI componets | |
wachsmut=> override 'action' | |
wachsmut=> that's all there's too it, for simple programs. | |
wachsmut=> Alright, that's my questions..... | |
wachsmut=> what aobut yours ? Any questions ? | |
Rob=> I have a few... I think mostly clarifications. | |
wachsmut=> First, please everybody say 'aye' ..... | |
Rob=> aye | |
Don=> aye | |
wachsmut=> just checking if you can 'hear me' .... | |
Jenn_=> aye | |
wachsmut=> Thanks, rob, don ... how about Aisha ? | |
wachsmut=> thanks Jenn_ | |
wachsmut=> Aisha had problems before, I know, maybe she can only | |
wachsmut=> 'see', but not answer ... that's what happened to her before.... | |
wachsmut=> oh well, so Rob, shoot ! | |
aisha=> i'm here | |
wachsmut=> YEAH !!!!! | |
Rob=> The only way we know what methods a class has it to look at the class AND | |
Rob=> all of its superclasses, right? | |
wachsmut=> Right ! | |
Rob=> Ok. | |
Rob=> Next | |
Rob=> We've just seen for the first time instantiating an object in a class that.. | |
Rob=> was not a "main" (program) class. | |
Rob=> I'm referring to TestFrame. | |
wachsmut=> Well, not really .... | |
wachsmut=> remember the 'Shape' things ? | |
wachsmut=> We instantiated Rectangles and Circles, and | |
wachsmut=> they did not contain a 'main' method ..... | |
Rob=> hmm. ok. | |
wachsmut=> It's the same with 'TestFrame', except that | |
Rob=> Last one. | |
wachsmut=> that class has zillions of methods, | |
wachsmut=> because it extends Frame which extends .... blah blah | |
wachsmut=> Alright, Rob .. | |
Rob=> Actually, I'll hold off on the last one... I think I got it. | |
wachsmut=> Great..... but, maybe somebody else had the same question, | |
wachsmut=> so .... what was it ? | |
Rob=> ok. here goes: | |
Rob=> You list some existing classes along with selected methods, for example: | |
Rob=> class java.awt.TextComponent extends java.awt.Component | |
wachsmut=> yes ... | |
Rob=> with the selected methods public String GetText(), etc. | |
Rob=> Now, what does the body of these methods look like? | |
wachsmut=> Ahhhh .... great question ! | |
wachsmut=> Actually, I don't know. | |
Rob=> I know, in general, like all other methods! | |
wachsmut=> The Java Virtual Machine is not entirely public ! | |
wachsmut=> The Component class, and the TextComponet class, and all classes | |
wachsmut=> in the awt and in the other packages comprise the JVM | |
wachsmut=> actually, to be more precise, they are all part of the JVM (Java | |
wachsmut=> Virtual Machine), and there's more. | |
wachsmut=> If you install the 'JDK', there's a 'zipped' file somewhere, called | |
Rob=> java.src? | |
wachsmut=> 'classes.zip' - that contains the 'packages', including the awt classes, but | |
wachsmut=> you can't unzip it, or JDK won't work. | |
wachsmut=> There's also a 'src' directory, and that contains the unzipped classes, | |
wachsmut=> at least many of them. You can find the method body there, | |
wachsmut=> but I have never bothered. I treat objects as 'black boxes' .... | |
wachsmut=> All I need is the header, and perhaps a brief description, and | |
wachsmut=> I don't care *how* the method works, as long as it *does* work. | |
wachsmut=> Alright, great question .... | |
wachsmut=> Don, Jenn_, Aisha, any questions ? | |
Don=> not yet | |
aisha=> not right now | |
Jenn_=> no | |
wachsmut=> Welll .... here we go, then, with something entirely new, but | |
wachsmut=> not too much (I hope). | |
wachsmut=> | |
wachsmut=> Remember, you can add 'components' to a frame, like buttons. | |
wachsmut=> The big question is: where do they go ! | |
wachsmut=> That's determined by what's called a 'layout' manager .... | |
wachsmut=> Java has 5 such layout managers, and 3 are easy. | |
wachsmut=> I will describe what the three easy ones do, | |
wachsmut=> then I'll show you examples and you have to identify | |
wachsmut=> them .... alright, read carefully: | |
wachsmut=> | |
wachsmut=> a FlowLayout Manager arranges all components in a row, | |
wachsmut=> and each one gets as much room as needed. | |
wachsmut=> | |
wachsmut=> a GidLayout arranges all components in a table-like grid with rows and | |
wachsmut=> columns, and each component gets the same size, so that the | |
wachsmut=> largest one determines the size of each other one. | |
wachsmut=> |
=> [aisha] leaves at Fri Jun 06 20:59:24 1997
wachsmut=> a BorderLayout has 5 areas: east, west, south, north, and center, and the | |
wachsmut=> 'center' area gets all 'leftover' space. | |
wachsmut=> | |
wachsmut=> Alright, there they are: FlowLayout, GidLayout, and BorderLayout. | |
wachsmut=> Now: all of you are using Windows 95, and | |
wachsmut=> the "allow show" thing above the names is checked for all ? | |
wachsmut=> Yes or no ? | |
Don=> yes | |
Jenn_=> yes | |
wachsmut=> I mean there's a little checkbox above the names of the participants... | |
wachsmut=> Make sure it's checked ! | |
Rob=> yes | |
wachsmut=> Good.... I'll now make, by magic, a new screen appear on your | |
wachsmut=> computer. Take a good look, identify the layout, close that screen, | |
wachsmut=> and tell me what it was: Flow, Border, or Grid ... | |
wachsmut=> alright, here we go ... say 'what? ' if nothing happens in a few seconds.. | |
Jenn_=> grid? | |
wachsmut=> Yes, exactly. | |
Don=> grid | |
wachsmut=> Everything had the same size ! | |
wachsmut=> and was rectangular laid out, in a table. | |
wachsmut=> Everybody back here ? Please say ' yes '.... | |
Don=> yes |
=> [Rob] leaves at Fri Jun 06 21:03:22 1997
Jenn_=> yes | |
wachsmut=> Rob ? | |
wachsmut=> Looks like we 'lost' Rob, let's hope he'll be back soon ! | |
Rob=> | |
wachsmut=> Here's another example. Take a look | |
wachsmut=> then close the screen and identify .... alright, wait a little ... | |
wachsmut=> What was it ? | |
Don=> flow | |
Jenn_=> | |
wachsmut=> Great ... why was it not a Grid with one row ? | |
wachsmut=> wanna see it again ? | |
Jenn_=> ok | |
wachsmut=> alright, here it is, one more time ... why not a 'Grid' with one row ? | |
Don=> because everything was not the same size? | |
wachsmut=> Exactly, very good ! | |
wachsmut=> alright, here's another one .... | |
wachsmut=> everybody ready ? Please say 'yep' ... or 'whatever' .... | |
Don=> yep | |
Rob=> aye | |
Rob=> aye | |
wachsmut=> let's wait for Jenn_ .... Jenn_ are you ready for another one ? | |
wachsmut=> perhaps not, we're dwindling in numbers .... | |
wachsmut=> anyhow, here's one more ! Hang on for a few seconds ..... |
=> [Jenn] leaves at Fri Jun 06 21:08:02 1997
=> [Jenny] joins at Fri Jun 06 21:08:18 1997 from 206.175.110.153
wachsmut=> Hi Jenny .... | |
Jenny=> sorry i got disconnected.... | |
wachsmut=> we just took a look at the 3rd example, | |
wachsmut=> I'll show another one soon ... | |
wachsmut=> what was example 3 ? | |
Don=> border | |
wachsmut=> sure , after all, there are only three ! | |
wachsmut=> Alright .... | |
wachsmut=> that's rather limiting, but the good news is that you can | |
wachsmut=> 'mix and match' those layouts. | |
wachsmut=> So, I'll show you another one, and that | |
wachsmut=> combines at least 2 layouts, somehow. Please identify | |
wachsmut=> both layouts ..... | |
wachsmut=> all ready ? | |
Jenny=> yes | |
Rob=> yes | |
wachsmut=> alright, here we go (I assume Don's ready, too ... -:) | |
Don=> yep | |
wachsmut=> Alright, seen it ? What was it ? Two layouts: | |
Don=> flow and grid? | |
wachsmut=> yes ! | |
wachsmut=> flow for the buttons, | |
wachsmut=> and a grid (2 by 2) for the rest ! | |
wachsmut=> But, there's one more, actually: a borderlayout | |
wachsmut=> to put the 'flow' and the 'grid' together ! | |
wachsmut=> See what I mean ? In the center is the 'grid' layout with 2 rows, 2 cols, | |
wachsmut=> and 'south' is the flowlayout, with the buttons. | |
wachsmut=> So, there's three layouts, altoghter, and that makes for a rather nice | |
wachsmut=> 'small program'. | |
wachsmut=> Two more, if you don't mind, then we're done ..... | |
wachsmut=> Alright, ready ? | |
Rob=> let 'er rip. | |
wachsmut=> got it ? What was it ? | |
wachsmut=> (sorry, this one takes a while to load, I guess) ..... | |
Rob=> looks possibly like flow across the top and grid again below that? | |
Don=> all three again | |
Don=> or what rob said | |
wachsmut=> Yes, Rob's right, and Don put'em together with a Border, but | |
wachsmut=> this time, the 'flow' is 'south' in the 'border', and the 'grid, 2 rows, 3 cols, | |
wachsmut=> is at the 'center' of the 'border' | |
wachsmut=> Opps, sorry | |
wachsmut=> 'flow' is 'North', nothing is 'South'..... | |
wachsmut=> Alright - we'll learn in the next lecture how to put | |
wachsmut=> these layouts together ..... | |
wachsmut=> The final (yes, I know, you want to go ...) example I have is this: | |
wachsmut=> well .... it's different.... | |
wachsmut=> I'll show you the source code of a Java program. Please study it | |
wachsmut=> carefully. I want to know the folllowing: | |
wachsmut=> - how many buttons | |
wachsmut=> - what layout | |
wachsmut=> - how to instantiate that class | |
wachsmut=> - what does it do .... | |
wachsmut=> So .... after I show you the code, take 5 minutes, exactly, to look at it | |
wachsmut=> to try to see what it does. Remember, you need to look for the fields, | |
wachsmut=> the constructor, and then special methods such as 'action' .... | |
wachsmut=> Ready ? Remember, five minutes exactly ! | |
wachsmut=> Ready ? please say 'yes' ..... | |
Rob=> yes | |
Don=> yes | |
Jenny=> yes | |
wachsmut=> alright, here we go ... 5 mintues.... | |
wachsmut=> Alright .... how many buttons ? | |
Don=> 3 | |
Rob=> yep | |
wachsmut=> great .... | |
wachsmut=> what layout ? Perhaps Jenny ? | |
Jenny=> flow? | |
wachsmut=> Exactly ! | |
wachsmut=> how do you instantiate that class, i.e. | |
wachsmut=> TestFrame f = new ???? | |
wachsmut=> well, the constructor of the class requires an input | |
Rob=> = new TestFrame("yadda yadda"); | |
wachsmut=> parameter of type String , so YES, THAT's CORRECT ! | |
wachsmut=> So, here's the biggy ... | |
wachsmut=> what's it do ? | |
Don=> keeps arunning total and allows the user to reset it | |
wachsmut=> Exactly ! | |
wachsmut=> So, here's the wrapup .... | |
wachsmut=> Rob suggested an example in the discussion ... | |
Rob=> I know what's coming! | |
wachsmut=> I'll expand on it, and that would be a good portfolio suggestion .... | |
wachsmut=> Also, the TestFrame from above would be okay, IF you can | |
wachsmut=> add a feature such as a 'Subtract' button, and make it work | |
wachsmut=> correctly .... | |
wachsmut=> so .... I'll formalize those, and post them soon | |
wachsmut=> Other than that, this is it for today, but one quick question : | |
wachsmut=> next chat, is Monday at 8:30 okay ? | |
Jenny=> i have a night class | |
wachsmut=> I.e. is Monday perhaps better than Sunday ? | |
Don=> I may be alittle late or have trouble or together | |
wachsmut=> I see, Jenny .... | |
Don=> on monday | |
wachsmut=> Alright, Sunday 8:00pm good then ? | |
Rob=> This week I cannot make Sunday, but if that's the only time for everyone | |
Rob=> else, so it goes. | |
Rob=> Any possibility of later Monday? | |
Don=> whatever is easiest for everybody | |
wachsmut=> who votes for Sunday, who for Monday ? | |
wachsmut=> Stand up and be counted .... | |
Jenny=> sunday is better forme... | |
Rob=> I can only make it on monday. | |
Don=> moday around 9:00 or anytime sunday | |
wachsmut=> Don, the decisive vote .... | |
wachsmut=> Jenn, Monday 9:00 ???? | |
wachsmut=> If no, then it's Sunday, 8:00 - your call. | |
Jenny=> i don't get home till 10:00 =I | |
wachsmut=> Alright, Sunday, 8:00pm (sorry, Rob -:) | |
Don=> alright, sunday 8:00 | |
wachsmut=> So, guys, hope you liked this chat .... | |
wachsmut=> and mediate over this question as you sign off: | |
wachsmut=> what layout is this 'chat' applet (after all, it's in Java, so | |
wachsmut=> it's got to be something ..... -:) | |
wachsmut=> Class over ! I'll hang around for a few minutes, | |
wachsmut=> other than that - have a great weekend, see you Sunday .... | |
Don=> you too, bye |
=> [Don] leaves at Fri Jun 06 21:32:39 1997
wachsmut=> if you have questions, go right ahead ... bye, Don ... | |
Jenny=> bye, have a good weekend! |
=> [Jenny] leaves at Fri Jun 06 21:32:42 1997
wachsmut=> bye Jenn | |
Rob=> Hmmm, I was going to ask about setup(), pack() and show()... | |
wachsmut=> Go ahead .... | |
wachsmut=> setup is actually easy - | |
Rob=> If it's a long response we can let it go for now. | |
wachsmut=> not really, here's a quick answer: | |
Rob=> I just want to knwo what they do... | |
wachsmut=> 'setup()' is easy: it's defined below. It's not overridden, nor overloaded, | |
wachsmut=> it's simply a new method used only in this particular class. | |
wachsmut=> 'setup()' does not exist by 'default', i.e. in a Frame or anything.... | |
wachsmut=> it only does what I say it does. | |
wachsmut=> 'pack()' resizes the frame so that | |
wachsmut=> all componets fit as best as possible. | |
wachsmut=> It's very handy ... the frame will automatically find its optimum | |
wachsmut=> shape and size. | |
wachsmut=> 'show()' simply makes the frame visible (since by default | |
wachsmut=> it's invisible) .... | |
Rob=> ok ,,, and validate() | |
wachsmut=> Yes ... validate() make sure that all components that | |
wachsmut=> are added are 'valid' .... tell you the truth, I don't know exactly what | |
wachsmut=> it does ... but | |
wachsmut=> | |
wachsmut=> validate(); | |
wachsmut=> pack(); | |
wachsmut=> show(); | |
wachsmut=> are the 'standard' last lines in a class that extends Frame | |
wachsmut=> if you want the frame to correctly add all components and | |
wachsmut=> give itself the best possible size .... | |
Rob=> got it... thanks! | |
wachsmut=> No problem .... | |
wachsmut=> alright, more questions ? | |
wachsmut=> did you like this 'showing' of web pages ? | |
Rob=> Yes. | |
Rob=> Very creative -- and a productive demo. | |
wachsmut=> thanks ... I liked it, too -:) | |
wachsmut=> alright, then .... anything else ? | |
Rob=> ok... sorry I can't make it on Sunday. I'll check the transcript afterwards. | |
Rob=> signing off. | |
wachsmut=> bye .... | |
Rob=> bye |
=> [Rob] leaves at Fri Jun 06 21:40:07 1997
=> [wachsmut] leaves at Fri Jun 06 21:40:10 1997