put
this presentation is delivered by the stanford center for professional
development
study questions
about anything we've done so far and last and what you've got and foreign
experts topic
before we dive in particular topic
feeling okay
one of things that we sort of gone the whole time in this class we use these
things called a cm librarians
and they sam libraries are set of libraries contractually created by a
task force people they say the association for community really talked
about them at the very beginning of the christ we talked about these libraries
who put together some nice libraries have stopped at a really useful for
teaching which is actually why we use them
and so today i want to do it left a little bit underneath the hood and talk
a little bit about standard java
which is what you would get if you didn't use the aclu libraries and
you just use the standard java libros now i have no reason why you can't
continue to use the a c white recap of the class
that's another set of libraries that were written by a group of people that
you're certainly welcome to use
so there's no reason why you
should stop using them
but i just want to give you a little bit there's a couple important issues relate
to standard java that now is a time when we can find a lift the covers and it's
time for you to know
so the first thing that's related to thinking about standards outlined
you know when you're running your programs in uganda clips and you do your
you click on the little running guide to compile your programs and then it gives
you a list attention we ob
classes you actually might want to run sometimes if you only have one project
images only get one twice
but i think i think about it a maryland like in the game show for program i
actually have like four or five different classes
how can always knew which class to run acknowledged his name sir for class was
the class and i actually should run
right i had a bunch of classes and their anyone wanna venture a guess
it's only class wounded orion which is barry related to
and underlying issue which is that it's the only class that actually was
extending program
and so wanted extended program what actually was happening underneath the
hood of the atm_ libros is you are getting a method
and maine is actually the place now your total old enough to see main
maine is actually the method at which java classes actually start running
and so i think you should think now as you get a little distributor like and i
never wrote method called me
i never saw a method called main you're telling me that's where java programs
actually start running
yeah in fact it is
and it's because programs
provided this main method for you and with his main method in the program
was essentially get the rest of your program running by getting a few things
set up a ninety cannot cure runner
so you didn't actually need to worry about this
but now you're sort of old enough
to actually see what that means after dissolve about
so if we think about what this means that the guys and though hope for the
main method is also kind of where this part of a reason why we never showed you
the main method before
the head of hair for the main method is actually public
static
poorly
team but we're not done yet me and actually have some arguments
it has been a rehab stream
called pardons
as arguments and then something here happens inside of me
and we showed that you're on the first day we would have to go through and
explain what all these words man
before we explain what main even wise before we explained you how do you
writer first program
that would have been a pain
but now we can just tell you right public means is a public method you know
that if i call the other public methods you've written
static means that this is actually eight
method that belongs to the class
it's it instead it's not something that you would actually call on a particular
object right
so you never have some project like yours mine object action i call acts dot
main
maine is just something that gets called
class method as opposed to being a method that gets called on an instant
and avoid means just returns nothing
what it's getting passed in here is an array of strings you might say it was
that array of strings coming from that's actually harks back to the days of your
when computers weren't all nice in graphical when everything
and when people actually well programs they wrote a program and then they were
typing on what's called the command line they wrote the name of the program out
the actually typed it
and then they typed a bunch of things that they want to be passed into the
program
as sort of like initial information to start that program
though the national thanks hope you had some program like names are for
you might actually start off by giving the name of the program
and then happening separate you might give it some other people think that you
might give the name of the data file
like leader dot correct
anybody given it some other things as well but were separated by spaces
and this list of stop is essentially what gets passed in here is arguments
there just rings
and this is how the program would actually know what came in on what we
refer to as the command line when the program is kicked off a mighty
from our job is not that although the language right exotic came around really
sagging popularity in nineteen ninety five
people aren't doing a lot of nineteen ninety five like i already have like my
mouth and i have my folders and i have all this other stuff
even if you were like six years old
you probably already dead right and you like i never typed this stop
so why do i care about at the reason why you care about is actually java derived
from another language called seat which
and as a variation called c_ plus plus
that was created when people writing programs in the days of your and the
whole notion of maine and having some arguments they get passed to me kind of
came along with sort of the baggage of
actually having a program language becomes the sort of matches the c
stop programming languages when they did do this
so a lot of the times in a row java program these days there aren't really
any argument regarding mister some system parameters something like that
we don't usually worry about them
okay but just so
when you go and look at some other java program is that you can be a scam
library can you see this main thing in your wondering what's it all about
this is you don't think i mean analogously toronto
it's just won't give you know the whole time you've been thinking of running for
your execution starts
maine is really were executions
that you think about
okay execution actually started in maine so how did this thing actually kick off
my runescape
now you're short old enough to see that's you
so what it actually did like let's say this was the main method in a program
like
named surf
so somewhere
inside of eight op program inside the ec and libraries for program we have
this main method
they figured out what the name of your class was essentially it had a one-liner
renewed
that would have been approval incidents
new name surfer
and started
departed
start to wonder why
and now
you know what this means what was actually doing what it means you would
main started note
object exist in the world like at the static method
so there's no object that you're you know giving them a message to your just
main just kind of starts off wakes up says hey i mean what am i going to do
why don't i create
some object of this particular tightening surfer which happens
instantiate an object which is your program
and then remember your program as we can talk about implements the run method and
actually a program underneath the hood
implements the run double interface that we talked about last time remember with
threads we talked about the run a bowl interface
lol programs and plant or animal interface and how you kick off something
that's run double use a start
so what it basically did was created an object of your class which was named
surfer
and told at the start and it happened to start pass along these arguments
but you never needed to see those arguments the matter fact you never did
see them because
when your articles instantiated it didn't expect any arguments
so the argument actually got pass this thing called stock we just ignored them
basically
and then started to run method to kick everything off
and last summer we talked about start we talked about this in the context of
thread so we said hello you create a new thread
and that are the object that you're gonna start running we put inside of
thread we take the thread off with start
in this case we're not actually creating a new thread
we're just saying i want to start executing basically decided that bag is
created it implements run of course they'll start running from the method
run
but i'm not creating a new thread so this thing is going to execute in the
same thread of execution
as the entire
so i don't suddenly kick off something that's running in parallel with this guy
it's actually just sequentially going to start name surfer
and that's the last thing that this guy does which is based on a valuable
sam questions about that
kind of a funky concept but that's basically what's going on you should see
it
we're creating an instance of your program and then just kicking it off
and that's why this whole time we have this thing called the run method that
had to be public
because is implementing the rundle interface but now you've seen any
and the only reason you know you kind of mca
added meaning your program to begin with and include all the score the only
reason we didn't put it in there before
it because will want to planing to stop
in week two of the class like right after kalra lower like all the dancing
provide on right
artillery by turning around the world i think java
public static void main string args like
what is going on right we hadn't done a raise
then done classes with
fingering about static we certainly and methods then demand bremer past
so we just wait until the end of ninety cm now you know what's going on
now that we have a bad idea
now we can think about okay if this is kind of like the standard javaworld days
let me think about taking this idea and using its help me take my existing
programs that i've written and pack them up into a form so i can share them with
family and friends
so that's what we're going to do next
the basic concept of doing this as something that's called a jar file
and you've actually seen jar files before because you've been working with
something this whole time in your product projects
called pcm dot jar
this was just eight jar file
they contained all the atm_ libraries
so basically college are pile is where to get its name is not because it's like
i did a big mason jar although you can think of it like that
it stands for a job loc
archive
that's where the name comes
and the basically behind a jar file as this thing can contain a bunch of
different stuff most the time when it contains is a bunch of classes in job
and you could think of this is the compiled version of the classes
you can actually put source code inside of a jar if you want but most the time
when you get a jock
it doesn't have the source code associate with it it just has the actual
dot class five to the compiled version of the files
so you could put source pausing here if you want it
you complete data files in here if you want to put a bunch things in here if
you want
what we're really going to focus on the case of putting classes
so one of these already existed for you with a cm dot jar
and want to figure out how to actually create some of these ourselves
and use them because they could actually think of them as something that's
wonderful
were executed like ships and not confuse ramblings
so click on the computer
here's name sir
and then a natural working version of nameserver so i'm not going to show
press the files in case you're going to make this
but all the code in here and for the first thing i didn't mean surfer program
if i thought about me i want to think of this and the standard javaworld now even
though i'm do you still using the atm_ libraries
when i want to build this jar i want to build the joint away the sort of makes
maximally portable like i can give it to someone who's over here on the species
i've never here on the snack
and they don't need to have a klutz or anything like that they can just one of
the whole point
so the first thing to do
if the introduced my friend the main method
and so basically i put in the car that you just opt out at a method public
static void main as this array of strings called arc that sits parameters
that's just the way maine is always defined to be
and what it's going to do is create a new name sir project
and kick it off
and that's the only thing i need to add to my program so anywhere you had some
class
extended program
you would add these three lines of code
so basically get us sort of compliant with standard job
once we do that now we need to create this thing called the jar file which is
thing the racks would be able to x
one thing you might be saying to yourself this maryland you told me the
aclu libras already sort of provide this for me so why my putting it
explicitly in there is a matter of fact it's not super required to be in their
explicitly
the real reason why we put in their explicitly is to try to maximize
portability because even though java spoke at this property were like
uh... we would like the java code want to make a run on pcs in run on maxim
ic ron you know this time tiger and not for adults other stuff
in reality personal differences between these operating systems
and so little problems creep up here in there every once in while you actually
saw fuck you does in class on occasion
so your experience them in the letter
by putting in this one explicitly robin kind of relying on the code it in the a
c l_ libros exactly doing a bunch more complicated stuff right because
itni in for what the name of your class wise right you never told that
explicitly gracie i'm library
yeah i need a new one of these guys actually there's job as a story called
reflection reckon actually go in safe
i'll let me take a moment to reflect i'm going to go and look at the names of
your classes
and then do something actually generate some code based on the names of your
classes which is what it was doing
that kind of stuff going down a little bit coffee so we're just gonna say aid a
cm don't worry about it i'm just given it to you i'm a i'm a nice guy
say he's put this in to make it exposes our maximizes portability main reason
so how do we create a thing called a dropout what we're doing here
steps are all in excruciating detail on your hand out they don't need to worry
about scribbling down notes quickly but what we're gonna do is you first click
as the death multiple by the whole thing
you select the project that you wanna create the jobs are from so nameserver
and then we've got a farm and you and we pick export
to this whole time you were to imports when you are bringing stuff in and now
it's finally time for you to give something back to the world in the form
of export
so what you want to be when you click export is
it brings up a little dialogue box sometimes the sand clothes sometimes
it's open if it's not a big givers closed
an inside job when you click on jar products which you want to bring about
sniper and jar like on there for a permanent star if i can act
cams can take you through all the steps
we need to specify couple things your first we need to specify with in the jar
file salmon open up names are for and what i want to put inside the job cause
i don't want to have all of name surfer and the jar file it turns out
if you throw everything in there including the stuff called dot project
not classpath
it actually gets a little bit confused to some of those things are not germane
to what we want to pack up and our jar there just kind of other
uh... administrative information what we really want to have his everything
inside the default pack
so i just click on before package i can double click on this to make sure that
all of my java files are
that's what i want to my job i want basically all of my job file for the
compiled version of all blanco ob
job files
and make sure that this is click but by the father just make sure export
generated class files and resources
so what it's going to do is compiled those java files into that corresponding
class files
and that's what it's going to put in a jar
there are other options like i got export the java source file taiwan it
right then i get some of the actual source code
most the time you don't want to do this if you don't want people like sort of
sniffing for your source code just like there take the compiled by these are my
brethren give you the first timers like thirty days and my birth a good point
but we've got a given you this works
so once we have this
waiter now specified where do we want to save this jar file so that's what this
you know select the export destination what they should have a status
what you want to say that
that the export destination so where we want to say that we can browse around
where we want to save it is based on hard created a folder that has all my
name surfer code in it over here
i'm just gonna save the jar found that same folder so this is just in the same
folder for my project called names or for that has all of my class files in it
you don't put out wherever you want just don't forget where you quit that's kind
of the key
so this is why i'm going to say that so that's kind of sad
up and you don't need to worry about the options down here the options down here
just you know
they're fine faults that there are
then you come here to this point it seems like
olney what's going on export file compile errors of compile warnings yet
which one export everything we don't care
stories click
and then we come here this is the most interesting part of the whole thing
what we want to do when we actually create this jar file and this is
something we only need to do when we have other jar file but the a c ally
brief need to worry about
wait for what's known as generate a manifest file
basically all the manifest file is it's a complicated name manifest in backup
investors out forms like all what has been you know it sounds like you're on a
boat doesn't like to have the cruise director and i like all words the
passenger manifest
wrote a column manifested austin emphathize like two month long and then
you add one lines when it becomes three lines one
it's basically just a little bit of administrative information that's capt
around with your jar file
so knows all what kinda stuff for you using with this jar file that's really
all it is
so what we want to do is generate the manifest file we make sure save the
manifest in the workspaces check which it should be if you click generate and
test file
and then you need to specify where you want to save the manifest file
and the place i want to say that is basically in the same folder for my name
sir for project in the name manifests are usually the name you give it a good
browse around if you want to
but usually the name you give it is the name of the folder that all your project
stuff sent and then the name manifest destiny than actual name
answer any questions about that
manifest off
the other thing you need to do when you're specifying a georgia george just
a bunch of classes
it needs to know in some sense
if someone can that running this chart with you actually you'll see that in
fact you can run a jar
where should it start which class is the one
of which i should call its main
and that's what you specify here select the class of the application entry
points
is kind of a very formal way of saying
where should i start running
so the place i want to start running is it lists you all of the classes
that have a main method for those are all the ones and start running some
names are for the only one i click up and so it says the main classes name sir
and now there's no more next buttons now i can do is put finish
and i just created a juror
and you like are you guys got doubleclick doubleclick
or not there yet
now there's two things that you'll notice if you look over here in the
package explorer
you'll notice now we have something called a manifest fark is that's why i
saved it
and i also have names surfer jot dot jar the jar file i just created they were
both put in the same folder with my other
you know files that's why i want to save them so they have michelle from the
package explore now you're the funky things
even though we created this manifest in created this jar they don't have quite
the right information that we want to what we do is we double click on the
manifest file to open it up
here's the whole manifest file
it's got a version which is one point no
and it's not the main class which is named surf why does it know the main
classes nameserver
cuz i told it right that the application entry point just forward
letting me know that i told it
that's why the application starts
now there's one other thing i need
besides ducking for cover one can you get started
what i need to do it i need to say hey you know what
names are free and i think it's time
but you also need to use the aclu libraries and it says
how yet you didn't tell me about the same i've written you say well now i'm
going to add
the coveted third mondale and talked about in the manifest fosamax modify the
manifest file
at something called the classpath
and all of class that is it's actually looks just like this capital c dash
capital p
classpath just tells basically
uh... the application
what other stuff for using are there other jar files that you're using and so
what you specify here
is the name of any jar files that you're going to be using as part of your
program separated by space
some unease pcm dodge are here is a cm najjar overhear has
i'm way you'd be a cm libraries no drawn some jar file
and i'm also going to use the jar file i just created name surfer dot jar
if i had three or four more jar file that list them on the same line so if
you were going to write an application someday where you're like
hey i got this drop off my friend here the job by downloaded from the web which
i wouldn't encourage you to do
and hear the sardar falcon somewhere else his list of all your space in
between
and then you save the file that's the problem most difficult thing that people
forget it saved the fosse save the manifesto
and now what exactly do all this
created jawahar all over again placard
wife it's just like misaddressed
here and i was going to work
he recommended a little bit different if i'm robin dong a file maneuvering export
i'm going to take the advanced ports i'm going to write
like on the project name pick export
just says that brings up exactly same window
i'm going to export a jar file
i come over here why do i want to export sorry abt all this crap eunice again
what i want to export is not all the stuff i just want to export everything
in my default
why do i want to say that i want to save it in the same place i had before you
might say but now im
aren't going to replace the one that already exists
i need to replace the one that already exist updated my manifest i need say hey
buddy it's not just about you anymore
now it also involves a cm judge our like okay okay you can replace the old
so i'm going to put it in the uk
places before
now a quick next here's the thing about export warning export baritone karen
export
here is the only place where things are different
the second time i go through this whole thing i don't want to generate another
manifest file
cuz i generated a manifest file the first time and then i modified
what i want to do is use that modified to manifest file so i say use existing
manifest from workspace
which is again just a formal way of saying
yeah use the manifest part are you there
asked me where they manifest on strangely enough if you look
this is exactly the same tax this year
yang belgrade's it it's like
while real broader trapping the suns out everyone singin in the streets
that's you know you just say that that's the one you want to use its going to be
the same name
and now i noticed this
which class of the entry point is great out
it's great acts like a little bit before your entry point is named surfer
that's in the manifest file if that's already in a manifest on using it
doesn't need to know what again so it doesn't even like me specified again
so you know that's different
and then i click finish
and give me one last warning you sure you want to over i got last drop on he
was your friend he was hanging out with you since the beginning about
three minutes ago and i say yes long way
we we know each other that long thanks for playing
now i've created this drop on your life
primary
what you do now
i come over here and i said
or the jar file displayed
one thing i can do it the drop by the n_ double click on it
and by double click on the jar file
it just starts kicking off the names are propagation
right i don't need a clips anymore to go and ron and have little run big compile
i have a lap haitian unlike our yeah bob how popular it right now bob kind of
alfono means on that some other interesting ones are going to be the
other night off
six after the sixties
dawn done deal thanks for playing
so can you name your children vermont make a comeback
and so he interpret just kinda running here and it's fun it's just a little
stand-alone application
now if you want to pack it to the sop and send it to a friend of yours what
you would actually do he wouldn't just sending surfer about dot jar
what you would do is you would say hey you know what i want to do
i want to create
i'll i'll just do it in here
some new folder
so i'm going to create some new folder and all call this my programmer whatever
you want to call him talking to call it mean surfer again ferreting out for the
call mister my program
and want to put my program
that folder
if the jar
of my program
also going to put in the jar obviously enlai break as i also need that kind of
separate
and i also need in here and he gave the files like names dot data and not names
dash data reading about all the data to get reading on the program starts it's
not like magically that's just going to be very down right it's not going to go
in try to find out file
so i need to put all this stuff here
and now this folder or something i could zip up and sent to a friend of mine on
my friend get so they would be like all
nature provides our
and then they go
so now you can package up any program that you've written in this class
remember to put in maine
you got to go through started this to part
create the jar exporter process modify the manifest great other jar put it out
there again
but you're going to go
face any questions about that
now you can package up in and share with friends
now what's even cooler than sharing with friends that you could email stuff too
is share with friends on the web
as you just have mike you know millions of fans on the web most of the leaders
don't know about but they're probably you know in the late hours of the night
looking at your web page that exist
and you can actually take
anne
files that you crave your like jar files and make them available in a web browser
now there's one other thing i should mention the scandal thing before you
send now you go
credo messed up and send it off your mom or dad died monday i break our book why
it's a good time
in order for them to run your job clouds they need to have the java runtime
environment install
i remember on like the second week of class when we said although it is just
one oh six website
you need to download eclipse there's a thing called the jr you also need to
download
if you have a map
the jerry in most cases already installed if you have windows it's not
installed
they need to go and down you can actually sent into the cfo_ six pages
a day download the gary here is a copy of my cannot five
go ahead and install it
and then they can run your programs because your program can't run if you're
poor if the computer doesn't have a job or write it's a bunch of stuff is going
to execute java bytecode
if you'd like
what java bytecode allen told me were java bytecode is
i don't know what to do with it and so i won't run into any of the java runtime
environment
now assuming of johnson's summer have the java runtime environment
they could go to take a web page
and you might put some page on the web
yeah allows you to load your applicant your ap lit is just in web applied
version of your program
and so here
all look it's running inside a web browser right this is of the actual
application this is my web browser or cuz i could like from here go to
you know
i don't know some search engine
right i'm sittin in the web browser
i'm not just running a regular application
on my desktop but this guy's actually running in my web browser
how did i make that happen
here's how i make it
i create a web page
if you don't know about age ten on creating web pages
unfortunately i can explain that to you and five minutes
but what i can show you is basically what this bosnia look like so if you
know a little bit of html or you just want to essentially copy and paste this
idea
this'll work for you
so all you do as you say i want to decipher the entire page that generates
that allows your applicant run
usse this page's html state is all things called pat
the name of that page is named surfer an acquittal table on the cradle border
around my applications but i want to business
what's my application my whole updation is right here
i have a catholic
what's the name of the archive
which is a java archive the contains my applicants name surfer dot jar
code is what's the entry point right this time no longer have the manifest
file available to it so it does what's my entry point
named jeffrey dot class that's where you start running felt that i want to go to
nature for dot class fine with me now if i start running
and the space i'm going to give you are running on the screen is five hundred
seven hundred by five hundred
and that little snippet of code
is what goes on whatever web surfer this webserver this is sitting on
looks for those job clouds
slaps them into the page and then someone good to go to running for java
program inside of us
just wondered how many people know html
you folks are over summer some number folks that this might be reasonable
thing to do if not you just don't need to worry about it it's not a big deal
just send the application your friends
the one i can use you know if you create a little webpage
is that when something is running on the web page it does not have access to the
rest of the files
what that means is
if i actually happened to be over here notice i have index dot html i have name
surfer dodge are not have a cm dot rar
what happened to my name's dash datafile
yet it doesn't exist
why doesn't exist 'cause i couldn't really anyway 'cause once i'm running on
the web browser for security reasons it doesn't let you get going to pull stuff
out of your files
okay 'cause evaded people could you really bad things your computer
what you need to do if you're like a mountain where is that data you you
minus running show from the web what'd you do
yours fears the dirty little secret
actually created giant array that had all the data in it
and made a part of the program
so sometimes you can do stuff like that if you don't want to actually read from
a file
the other thing you can do is you can take those files and include them in the
jar file
to the jar copy not only have compiled class in the cars have data files about
another way of doing if you want to do it
but we just don't have time to talk about the decals those kind of the same
process
and when you're exporting stuff the dropped by use of something data files
so that's clearly executed
now i know that we know all this funky stuff about all acts to go back put on a
web page if i want to just like you know feel unhappy i'm going to go
it's time to come back to our friend
standard job as a standard java what kind of allowed us to all you know think
about doing to stop as we learned about me
and i want to show you a couple examples of program could actually don't use the
aclu libraries at all
to show you why we use the a c my brisket one thing you might be wondering
if
why weren't we just doing the standard java thing the whole time
and part of the reason is
things are just so much easier and cooler when you have the same way myself
we go back over to a close
we're coming down with names are for an office manifesto
here's a program that's written in standard java rights at hello world on
the screen
this is something you could down in the first class by saying public last hello
world extends console program imprint lane
hello world out to the screen and you would have gotten it in the consul
so what's different here what's different here is we have public last
hello world
and it doesn't extend anything it doesn't extend program doesn't extend
concord program
there's no imports for the a c l_ libraries we're not using any defense
so we don't have a console program we don't have a nice little consul
but we white stuff out to this displays a nice little window
while we do have a something called the system output consul and if we want to
put stuff on back it looks real seller to what you had before we'd use print
land which is why we made the method that you use call prints match theirs
but weeks a systemic dot out dot println text one print out
again here i have a meaner it might mean that they can have whatever i want and
that's just for execution starts
so if i compiled list
and running
let me just compile and run to show you why
hello world in kind of this world is not all that cool
careful our world
it just ran
and they're like partner and i don't see anything
cuz you don't get a call we know that comes up is like a lower over here i am
on this window for a budget act
you have what's called the system console
the system console like you happen to be using a development in violent like a
klutz or something else
is basically just a window in that development environment that shows
messages that you print out
if you happen to be in the bad old days but i think i raised over here where you
have command-line text we actually type stuff in
because i would just be that same window where the text would appear where you
can't
so if you don't get it in a separate we know it is not all that will get a lot
of times would notify closed anyway so you don't see a
now if we want to pick up a notch it's a token on yahoo so wide use the consul
one i do something graphical so here's graphical hello world
and so what we want to do is
we want to create a window
a new window that is going to have some title associated with it and we're going
to put the text hello world in that window
why we need to do what we get worse to excuse respectively
we need to create something called a j three in which you never have to worry
about before
what they gave frame it's actually a frame that's going to pull the window
so it's actually one week run we're going to start running rapidshare
it's going to create a little window force that we can display stuffing
well we're going to put in that window
we're going to put a label j labeled you've seen before this is just like
you've seen before
we're going to create a j label that's called hello world
and we want this label to be centered justified as opposed to left just
fighter rightist five tiny stage a label dot center to center justified
if i don't give a destination it'll by default be left justified looked kind of
because one attacker
and then i grabbed this label to my frame
so similar to the idea cabinet can listen adding stuff to the candice's
exactly analogous right we want to make it just as easily when you saw standard
java
all the same concept applied
here were just adding the j label which as you know now is a g component in the
big java hierarchy
and j components can be added to ge frames
so we have a jail able to get at a twenty three
i set aside tragic frame which is five hundred by three hundred that tells me
how big the windows going to be when it starts
and then there's the other crafty stuff but i need to do that just you would
think alike
why do i need to do that right it's just doesn't make any sense
that i would not otherwise want to have it this way what you're going to do
if someone clicks close on the window a little x the top of the screen to close
the window
i need to say hey
if son click that then you need to close yourself otherwise the window by the way
the application keeps running
which seems odd but we need to have that they're pretty optician stop running
and then we think
window yeah i know i created un everything
you need to make yourself visible
otherwise no one will be able to see you
why when i pray that we know that i was i going to make a visible
that's how we use the a c l_ libraries
so we need to make sure that this guy visibility is true
and appear on this
you're a graphical hello so after all the squawk to write
yours graphical lovro
we do have one and all of that explain to you so that you could get hello world
bring your like
somewhere in the social now work in a corner need to worry about how the world
in the middle of my screen
that's cuz you have this new hybrid
so like okay let's let's keep it up even one more not shit you know i couple
right what are those now stopping interaction like that should be
something that maybe you know i get some benefit from having to stand for java so
out of interactive version of hello
through the interactive version of lalo na some of the stop should begin to get
a little bit more
repetitive in the sense that you have your main you have your j frame the
frame is called interactive flow that's the title of that window
what we're going to add to this day play with a new
class that we're going to create called a moving label
and i'll show you what a moving label doesn't just second but we need to set
aside the window
again set default close operation exit on clothes
and set visibility to true so baseball this does is create this window or
particular size
and if you add this thing called a moving label to it and moving label just
another class i create what's a movie label
a moving label is a j component
it needs to be a gay component because i want to add a tool for
and to display something to frame i what i can only display components knapp
brings this can extend component
and it's going to implement our friend of mouse listener
because it's going to listen for the past year what all i remember mouths
listener that's why like the mouse got click and drag at all that stuff sans
act the same
so i have my construct ojai constructor had to have some starting texas label
and starting x and y location
thatcher what kind of familiar to you
anti based i guess tore off the tax expert yet to like
and this guy wants the lesson from out of that
so ted adam else listeners and it needs to say
if you get some out of that
send them to me to send them debits switches
so this a little bit different than what you've written in your programs before
where you just said you know adam alice was knowing you didn't you just had an
open print close pronounced 'cause we kind of poop
naturally by things get a little bit funky
the difference between this and thinking about having some sort of label that you
just display on the campus right some taxes just put up on your canvas and it
just sits there and it's fun
is that this guy i know i have to worry about what's known as painting itself
which means it needs to draw itself on the screen your like but when i have
labeled before they just knew how to draw themselves
yeah that's because we gave you a label does a little bit smarter knew that it
was a label that should rockville
this guy needs to be told you're going to draw yourself
though that they call paying component that gets called whenever this guy
should get displayed on the screen or some other thread that's going to call
the for you automatically
and it says here is the graphics
context in which a dryer self
safely within our graphics contact somebody draw some strength
and that's a method name everything is not important here i just showed you
those extra craft you need to worry about right which is why we didn't want
to do all the stuff began
now this booking steamy or whatever the mountains clicked i get the new acts
wire location
and i repeat
what is repaint meaning to redraw yourself
and i'm going to redraw myself at this new xy location because when i call
repaint
someone comes along and says hey to repaint this area
i'm going to call dual pane component method so you can read paint yourself
you like
well this is really we are now in like almost we're here i get a mouse click
and i know that i want to drop my sri drama itself but rather than telling
myself directly to redraw myself
i don't tell the system paid i'll need to get repainted in the systems as
possible
uh... as the sort of like
you know that java high allison arafat happiness are pointed you want to know
like you need tear
someday if you act like they were anti-war
we won't get in
units i can breed on partner
other hot
you know i think i need to repay my topic how to fix that those are ok you
need repairs are four one i'm ready for you to repeat yourself
all call your pain components method
until then no no you don't repeat itself
and saturday that's other stuff in the system to worry about all yall in there
with you you have to get repainted
okay now call your pain component you come a long thick
all cable nominee promised off the new act violently
so kinda convoluted the whole notion of like
you're doing something here and you're asking someone else to do something for
you and i'm going to call you back to do what you were julian sands
now makes a little bit more sounds after we talked about directed at you've seen
all the stuff
thurday class not so hot
so if we were on this
this is called up interactive hello
base but where does it just brings up the article that sixty s by six a rocks
in the middle of the straight and not everytime i click them
mouse button right because this is the mouth with the bank over here
everytime i click the mouse button
the x_ y_ location of the mouse becomes the new base point
for the tax they get stronger
and so i just moved to rounds
any questions about that
so there's a standard java
you've seen all the concepts in the a c we using the atm_ i've read the
concepts rather saying the notion of adding things and i should have about
seles has not affect the whole mouth listeners concept we just took the
standard job ideas and use them sort of in conjunction with used him libraries
but there's a lot of things in the a scam i break it just made it so much
easier to like for example b graphics contest entries or to write a social
network for whatever and say you're welcome to continue using the atm_
library dot
but some people are wondering wide will use these libraries and this is the
reason why there's just a whole lot of propped you'd have to worry about
i'm question
you'd be use in like you know your favorite word processor like notepad
and there's actually some places which i won't you know name but that there is
it's actually reasonable that you know that some schools and your first
programming class what you do is they say while you need to have like no
pattern you need to have some text editor
and then we're gonna do command-line stuff you're gonna type in like name
surfer names dash data dot textron your program and then everything's gonna be
taxed
so one thing i want to leave you with now in our final few moments together
sort of a notion we were starting to meet next week talk about life after the
five had to give you notion that if you want to go on in terms of learning more
about java specially standard java
we said i just started things off by giving you you know this book which
talks all about the cm libraries and this i think is a great book to actually
learn everything with a new vcm libraries
but if you want to go on worth of other resources you can use
that's not pretty if you don't like the java section of any bookstore just would
be practiced a while one but i would recommend not that i get my kickbacks
restart called learning job a it's actually pretty good time some of the
examples just off your actually based on this book it's a little bit
that's why we don't use the text book in this class if in fact and we get up did
we break two thousand page mark
all right so close it so close with the index
now in nineteen
that some other books that actually the original specification of the java
programming language the same older version of the book is this is one that
was like a week candidate if you are not the old version
i forget which version of acting out a second edition i think now there are
like three or four some impact
looks a little bit bigger birds actually
four books it specifies the language job it's actually very well written as a
reference inside of recommend this as well
if you're going to like all i want it all
the big job
is vague
i think it might actually crossed the thousand page all yachts like thousand
the spirits like twelve hundred
and if you really want to get a hard time like but now i'm all about web
based java
java server programming like everything or do i like a lot of things you don't
want to know if whatever they want to know one more
and that's just a small set
right so they're just a few bucks i'd recommend if you want to go on beyond
this class
but you can go into any bookstore news get inundated with a ton of stuff but
now you have a context for kind of putting all the pieces together because
you've seen all the other things that you actually need to know to be able to
work with the huge set of tools that job actually
so any questions about any of our staff
you're going to go
alright power to a couple minutes early cuz most the time i like to go a couple
minutes late
have a good weekend