<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8428338415088381498</id><updated>2012-02-16T06:11:33.656-08:00</updated><title type='text'>Krakatoas Revenge</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>87</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-285638246114618474</id><published>2009-06-17T06:13:00.001-07:00</published><updated>2009-06-17T06:40:00.988-07:00</updated><title type='text'>Wednesday, June 17: and then there was one</title><content type='html'>Greetings, gentlemen, for the last time:&lt;br /&gt;&lt;br /&gt;Since our purpose is to get absolutely as much done of your finals BEFORE the actual day of the final exam, I thought it best to lead off with what I still lack from each of you. For each item below, if you have the files, please send them ASAP:&lt;br /&gt;&lt;br /&gt;A) a group discussion posting about your killer app, what it is intended to do, how you plan to build it, etc. I still need this from James, Ryan C., and Evan...pl;us I blieve that Ryan N. only emailed it to me, so if you could post what you emailed Ryan, that'd be swell&lt;br /&gt;&lt;br /&gt;B) "year in review" group posting --&gt; still cannot find one for Ryan C. and Dillon&lt;br /&gt;&lt;br /&gt;C) research topic group discussion posting: I still cannot locate one for the following people:&lt;br /&gt;Ryan C, Evan, Dillon&lt;br /&gt;Additionally, I'm having "source citation" troubles with the following people:&lt;br /&gt;EJ, Sean, Thomas&lt;br /&gt;&lt;br /&gt;remember, you need to have eight sources listed, directly below your actual discussion post. NOT somewhere else, I don't wanna guess!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;D) the actual "killer app" --&gt; so maybe it cannot kill just yet. Maybe it can't maim. Maybe it cannot fold, spindle or mutilate. Perhaps its incapable of breaking the skin. Maybe it cannot even break the skin off a rice pudding. Whatever! Just make sure to send in a copy before the end of the class, by email, with your name and the phrase "killer app" in the subject line. Make sure to actually ATTACH the file please. And be aware, not only can you work on this for the rest of the week, in your spare time and on the day of the actual exam if you feel the need, it's also meant to be thought provoking long after this building goes quiet for the summer.&lt;br /&gt;&lt;br /&gt;Th-th-th-that's all, folks!!!!!!&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-285638246114618474?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/285638246114618474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/06/wednesday-june-17-and-then-there-was.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/285638246114618474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/285638246114618474'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/06/wednesday-june-17-and-then-there-was.html' title='Wednesday, June 17: and then there was one'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-5198902787709213893</id><published>2009-06-15T10:01:00.000-07:00</published><updated>2009-06-15T10:05:42.188-07:00</updated><title type='text'>Tuesday June 16: Two days left: what else is there to say?</title><content type='html'>Greetings once again, one and all:&lt;br /&gt;&lt;br /&gt;You have already received instructions for all that you must do to complete your final exam projects before the actual exam day. Considering that that will be THE last day for you, that's actually pretty generous: if we are successful, all we have to do is come in that day and enjoy one last time together before the summer.&lt;br /&gt;&lt;br /&gt;Please make sure that you have done everything that needs to be done, posted all group discussions, sent all needed emails, so that then you may work on your "killer apps"&lt;br /&gt;&lt;br /&gt;You know what needs to be done. As the Nike commercials say: "JUST DO IT!"&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-5198902787709213893?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/5198902787709213893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/06/tuesday-june-16-two-days-left-what-else.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/5198902787709213893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/5198902787709213893'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/06/tuesday-june-16-two-days-left-what-else.html' title='Tuesday June 16: Two days left: what else is there to say?'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-2820174373380922234</id><published>2009-06-12T07:23:00.001-07:00</published><updated>2009-06-12T07:38:06.721-07:00</updated><title type='text'>Friday, June 12: a great big TODO list for all of you</title><content type='html'>Greetings, fellow JavaNoidz!&lt;br /&gt;&lt;br /&gt;Let's get right to the big stuff first, shall we?&lt;br /&gt;&lt;br /&gt;A) With only one exception, I cannot seem to find evidence of anyone sending me by email a "choice of topic"   -- that's be the topic to do with computer programming that you began at least a week ago-- eight website sources you will be able to cite, a list of facts about your chosen topic, a formal written set of paragraphs, WHICH, along with your wesbite source addresses, you were supposed to have posted as a group discussion.&lt;br /&gt;&lt;br /&gt;Since it's more likely that I've overlooked something somehow, here's what I want you to do with that:&lt;br /&gt;&lt;br /&gt;POST IT AS A GROUP DISCUSSION RIGHT NOW. PLEASE REFER TO THE BLOG POSTINGS TO SEE WHAT MUST BE INCLUDED. MAKE SURE TO CLEARLY LABEL IT AS YOUR RESEARCH TOPIC. DO NOT POST UNDERNEATH SOMEONE ELSE'S POST.&lt;br /&gt;&lt;br /&gt;B) I have been unable to find the "year in review" discussion posting for the following people:&lt;br /&gt;Dylan, Evan, EJ, Ryan C.   Guys, get it done, its not possible to get it wrong, unless you don't do it at all, OR you're really cheap on me with how much you write&lt;br /&gt;&lt;br /&gt;C) I have received neither an email nor a group discussion posting to do with your "website resources" to do with your killer app from the following people:&lt;br /&gt;James, Ryan C., Evan   Please take care of this one way or the other. Refer to the blog posts or to your peers for advice in what I'm asking for here, I've already stated it at least twice.&lt;br /&gt;&lt;br /&gt;D) When all is said and done, by the end of this class, I will need you to email me the latest copy of your "killer app". Whatever its state of development, please send me a copy by the end of class. Please put your name and the phrase "killer app" in the subject line&lt;br /&gt;&lt;br /&gt;OK, you gotta a lunch block to work in: let's get it done. And yes, start with the easy stuff: why do you think they're in the exam, if not to boost your confidence?&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-2820174373380922234?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/2820174373380922234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/06/friday-june-12-great-big-todo-list-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/2820174373380922234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/2820174373380922234'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/06/friday-june-12-great-big-todo-list-for.html' title='Friday, June 12: a great big TODO list for all of you'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-3699509118452938269</id><published>2009-06-10T10:39:00.000-07:00</published><updated>2009-06-11T04:22:15.753-07:00</updated><title type='text'>Thursday June 11: end game part 4</title><content type='html'>&lt;strong&gt;Hello there once again!&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Today, there are several things which you will need to start "wrapping up". They include the following:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;A) You will need to use the email version of your "year in review" and set up a group discussion posting &lt;span style="font-size:130%;color:#ff0000;"&gt;BASED&lt;/span&gt; on it. The discussion possting should be labeled with your name plus the phrase "year in review". it should be at least three paragraphs of at least three complete sentences each in length, and it should include all the points you brought up in your rough draft email, which if you will recall, needed at least seven things you remembered about this class&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;B) You will need to produce another group discussion posting &lt;span style="font-size:130%;color:#ff0000;"&gt;BASED&lt;/span&gt; on the email you (theoretically) sent to me back on Monday, June 8. this email not included your choice of a topic to do with computer programming. Recall that the discussion topic was supposed to be on about "some person, company, "killer app",milestone, "day of infamy" etc etc etc in computer programming. " Recall also that you were most recently supposed to have sent me two facts derived from each of the eight website &lt;span style="font-size:130%;color:#ff0000;"&gt;based&lt;/span&gt; sources you were supposed to locate as part of this effort.&lt;br /&gt;Sooooooooooooooooooooo....make a discussion posting that's at least the same &lt;span style="font-size:130%;color:#ff0000;"&gt;basic&lt;/span&gt; format as the one found in point A) above, but includes ALL the info you gathered and emailed to me the other day&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;C) The "killer app" email you sent to me as the first part of this exam period project also needs to be posted as a group discussion. make sure you label it as your name, plus the phrase "my killer app"&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;D) While you're at it, do something to begin creating this app. At some point, I will have you upload or email me a copy of it&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Cheers,&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Uncle Paulie&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-3699509118452938269?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/3699509118452938269/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/06/thursday-june-11-end-game-part-4.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3699509118452938269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3699509118452938269'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/06/thursday-june-11-end-game-part-4.html' title='Thursday June 11: end game part 4'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-345796708075249997</id><published>2009-06-07T18:43:00.000-07:00</published><updated>2009-06-08T05:55:03.286-07:00</updated><title type='text'>Monday June 8: End game part three</title><content type='html'>Greetings, encoded ones!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Today, you will be working towards accomplishing three separate objectives:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) Continue to gather resources towards beginning to create your "killer app" (you can test them out as you will, and see what shakes loose. After all, it's a code class, yes?)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;B) You need to expand upon the research topic you chose last week by emailing me at least two facts you have discovered about your topic from EACH of the eight online sources you procured last week. Each fact must be presented in the form of a complete sentence. Make sure your email is labeled with your name and the phrase "my topic facts"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C) &lt;strong&gt;"year in review"&lt;/strong&gt; create a rough draft on the topic of "year in review". All you have to do for this is to email me at least seven different things that stand out in your mind about this class. Whatever you remember the best, the events that stand out the most, particular programs, the teamwork, the weird examples etc etc etc. Just make sure that the subject line of the email includes your name and "rough draft year in review". A complete sentence for each item you recall the best will suffice for now&lt;br /&gt;&lt;br /&gt;"the faster we go, the rounder we get"&lt;br /&gt;Uncle Paulie&lt;br /&gt;&lt;br /&gt;PS Even if you were not physically here to do this assignment, you are still responsible for it. Most of it can be done without actually even being here. Which begs the question then: why do any of have to get outta bed to come all the way here for then? :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-345796708075249997?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/345796708075249997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/06/monday-june-8-end-game-part-three.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/345796708075249997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/345796708075249997'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/06/monday-june-8-end-game-part-three.html' title='Monday June 8: End game part three'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-7058254822151266571</id><published>2009-06-03T06:56:00.000-07:00</published><updated>2009-06-03T07:43:29.455-07:00</updated><title type='text'>Wednesday June 3: End game part two</title><content type='html'>greetings, swashbucklers of code!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Yesterday, you were asked to describe as well as possible, your idea for a "killer app". Most of you have responded...those of you who have not need to get that done and passed in before the end of today's class. You really don't want to fall behind on this point, especially if you happen to be a sophomore, since I will in all likelihood NOT see you tomorrow due to MCAS&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;That much being said, today you will need to begin drafting your response to letters B) and C) from yesterday. Let's start with&lt;br /&gt;&lt;br /&gt;B) "You've taken your first step into a larger universe"&lt;br /&gt;The point of this is to begin gathering resources that you will need to actually begin trying to realize the vast ambitions you outlined in point A)making a "killer app"&lt;br /&gt;&lt;br /&gt;What kind of resources? Well, to begin with, you will need to make a discussion post detailing the individual components you think your "K A" will need.&lt;br /&gt;&lt;br /&gt;For example, if you need your program to access a website in some way, well, we've sorta kinda done that, but you might need more information about how to improve that. Ditto if your program needs to be able to read from or write to some files: we've gotten a good start on that, but we've hardly exhausted the possibilities. Moreover, we've never even touched on items like connecting to databases or producing HTML documents "on the fly"&lt;br /&gt;&lt;br /&gt;Once you've listed stuff you think you'll need, you'll need to go out and scour the Web looking for people and places that might have something like what you're looking for. AND, you will need to keep a record of those websitess URLs AND a succint tag for each one saying what that site is good for. Trsut me, don't hold this stuff in your head: you'll end up losing your hair. Not to mention its a requirement for you to make a second discussion post listing this information&lt;br /&gt;&lt;br /&gt;Last for point B) you will need to start trying to make use of the resources you've found. If there are tutorials or sample code to download, then get crackin'... you have free reign to make use of ANYTHING you can lay your caffeinated little hands upon. let;s see what we can scare up!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OK, now as for point C: each of you will be (eventually) making a discussion post about some person, company, "killer app",milestone, "day of infamy" etc etc etc in computer programming. It goes back a lot further than you think: for example, you could do a discussion about "George Boole". BUT, long before you do the discussion, you have to GATHER RESOURCES. In this case, you need to have on hand at least a bytes worth of credible websites as sources you could cite in the course of your discussion. These sources you will need to email to me, putting your name and "research point C websites" in the subject line&lt;br /&gt;&lt;br /&gt;OK, that oughtta be enough exercise for today!&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-7058254822151266571?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/7058254822151266571/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/06/wednesday-june-3-end-game-part-two.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/7058254822151266571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/7058254822151266571'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/06/wednesday-june-3-end-game-part-two.html' title='Wednesday June 3: End game part two'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-5309321491984094869</id><published>2009-06-01T10:21:00.000-07:00</published><updated>2009-06-02T05:22:55.136-07:00</updated><title type='text'>Tuesday June 2: End Game, Part One</title><content type='html'>As of this moment, we have only two full weeks before the onset of the exam week, which is scheduled to begin June 18th. Because of the nature of our class, and due to the fact that I never like waiting to the last minute anyway,we are going to commence work on your final projects, beginning right now.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Before we begin, allow me to give you a very simple outline of what we will be accomplishing over the next two weeks:&lt;br /&gt;&lt;br /&gt;A) What makes a "killer app"? Details to follow quite soon&lt;br /&gt;&lt;br /&gt;B) "You've taken your first step into a larger universe" Details to follow&lt;br /&gt;&lt;br /&gt;C) not so random research : each of you will be researching a particular topic that has something to do with computer programming. Details to follow&lt;/p&gt;&lt;br /&gt;&lt;p&gt;D) "year in review" Details to follow&lt;br /&gt;&lt;br /&gt;E) "speak,hands, for me!" Details to follow&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In any event, let's get down to what you will be doing today:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The term "killer app" was coined long ago in the 1980s to describe a computer program that was so important and influential to how computers were developing that they crushed all the competition. At one point or another, every computer geek dreams of making their own, just like every politician dreams of becoming President and every dog dreams of waking up in a world where all the cars are slow and they're made of Beggin' Strips.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So here's your chance to dream out loud. Please describe what your killer app would be like, if only you could invent one. Your description must include the following:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1) what general category would this app fall into? Would it be a utility program, something that would help make your computer work better? Would it be some kind of instant messaging or email software? Would it work with databases? Would it be a game of some sort? Would it be used to test network security ("pen testing")?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2) What kind of person would you try to get to use this software? Think about things like age, gender, lifestyle, income bracket, what they do for a living, what their hobbies or interests might be.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3) How would you distribute it? In other words, how would an interested party get a hold of a copy of your software?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4) Would you attempt to patent it and make it propietary, or would you go open source, let the world see how you did it, and try to make money on its usage?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5) For that matter, would you be trying to make money from this, or would that not be a consideration? (Remember, there's no one right answer to this)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6) How would you get this "before the public"? In other words, how do you plan on getting people's attention long enough to TRY your "killer app", bearing in mind the "MTV syndrome"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7) What if someone wanted to buy the rights to this software of yours, what would you do? How would you respond? Again, there is no one right answer to this.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;8) Finally, who do you feel would be the first and most important consumer of this software? Who's it really for, anyway?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;That should do it. For today, please create at least a complete paragraph for each point as a rough draft. When you are finished, please email it to me with your name and "my killer app" in the subject line&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-5309321491984094869?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/5309321491984094869/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/06/tuesday-june-2-end-game-part-one.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/5309321491984094869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/5309321491984094869'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/06/tuesday-june-2-end-game-part-one.html' title='Tuesday June 2: End Game, Part One'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-1817319095050536434</id><published>2009-05-28T06:02:00.001-07:00</published><updated>2009-05-28T06:15:06.848-07:00</updated><title type='text'>Thursday May 28: UberGeek SoundOff</title><content type='html'>Greetings, fellow JavaNoidz!&lt;br /&gt;&lt;br /&gt;In a recent class, there was a happy accident whereby two completely different ideas met in the luxuriant garden that is my mind, fell in love and gave birth to a third idea that combines the two. The first was that I had asked each of you to post to our discussion group some sense of what it means to you personally to be involved with computer programming, ie, "what's it all good for?" The second was that a few of you had casually mentioned that even though we've meeting right next door to it, and even though you've been attending this school for this entire year, and perhaps more years than one, you had never even seen the inside of the radio production rooms next door to this class.&lt;br /&gt;&lt;br /&gt;What has sprung in my ever-moving and often randomly creative mind is that today, for those of you who are interested, I would like to give each of you a brief tour of the facility, and perhaps give you a brief run through with the equipment. This can only take place if ALL of us agree to the following conditions:&lt;br /&gt;&lt;br /&gt;A) I cannot take in the entire class at one time. At best, I can get four of you in at a shot&lt;br /&gt;&lt;br /&gt;B) Those of you who are awaiting your turn or have finished it need to work quietly and appropriately in our class on your projects&lt;br /&gt;&lt;br /&gt;C) If you wish to make a brief recording, it should be on a topic related to this class and MUST be school appropriate at all times&lt;br /&gt;&lt;br /&gt;D) Naturally, you must be respectful and careful of the equipment. All computers are worthy of respect, whether they have microphones attached to them or not.&lt;br /&gt;&lt;br /&gt;If we can all agree to that, I think that this would be a good experience for all. I have had many other students from outside the radio class take part in similar projects, and it has been extremely helpful in promoting the unique resources we have here at HHS. Since most of you are in the 9th or 10th grade, it may even be that you will be interested enough to take one of the Radio classes offered here, since you will be here for at least another 2 or 3 years&lt;br /&gt;&lt;br /&gt;Please undertsnad that there is nothing in the least bit mandatory about any of this, and if this is an activity in which you have no interest, you are not required to take part. You will have to stay in the regular classroom however, as I think running down the hall screaming like a nut would probably attract undue attention.&lt;br /&gt;&lt;br /&gt;So, let's look at some new technology, m'OK?&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-1817319095050536434?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/1817319095050536434/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/05/thursday-may-28-ubergeek-soundoff.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1817319095050536434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1817319095050536434'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/05/thursday-may-28-ubergeek-soundoff.html' title='Thursday May 28: UberGeek SoundOff'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-2499381773168514682</id><published>2009-05-20T20:15:00.000-07:00</published><updated>2009-05-21T05:29:17.000-07:00</updated><title type='text'>Thursday May 21: so what's it all good for?</title><content type='html'>Greetings, Javaneited gentlemen!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Towns, cities and states all across America are screaming for money to run various different programs, and some of these have to do with education. Technology instruction is part of education, so what we do here in this class -- and in future classes-- is affected by all this. So what I'm asking you to think about and then write into a group discussion post is this: what's it all good for? How do we justify spending money on technology instruction? How do we keep classes that we already have and try to offer more?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What I would like each of you to do is to write a group discussion post of at least two paragraphs of at three complete sentences each detailing why you believe that what we do here is important, and what we can say convince others of the basic value of what we're all about. As part of that, let's try to discuss ways in which the technologies we pursue can actually save money, for everyone, not just us. Additionally, let's try to discuss what each of us believes to be the items that should be part of any program of technology instruction.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;After that, you can continue with your game projects,&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;cheers,&lt;br /&gt;Mr. L&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-2499381773168514682?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/2499381773168514682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/05/thursday-may-21-so-whats-it-all-good.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/2499381773168514682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/2499381773168514682'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/05/thursday-may-21-so-whats-it-all-good.html' title='Thursday May 21: so what&apos;s it all good for?'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-2323039764714257293</id><published>2009-05-19T09:52:00.000-07:00</published><updated>2009-05-19T09:56:22.604-07:00</updated><title type='text'>Tuesday May 19th: for the record!</title><content type='html'>Greetings one and all,&lt;br /&gt;&lt;br /&gt;Today, I have a somewhat different request...I'll tell you what it is, then I'll explain why I need this done:&lt;br /&gt;&lt;br /&gt;A) I will need you to email me as an attachment the latest copy of your current project. Along with this attachment, as a paragraph in the main body of the email, I will need a description of how to do ONE thing in this program, in a "step by step" fashion&lt;br /&gt;&lt;br /&gt;B) the reason I need this is because I want to "film" your program in action, doing the thing you said that it can do. I have a program to record this, and I wish to make a brief video of each of your programs&lt;br /&gt;&lt;br /&gt;OK, let's get on with that, so i can get filming and yopu can keep coding&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Mr. L&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-2323039764714257293?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/2323039764714257293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/05/tuesday-may-19th-for-record.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/2323039764714257293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/2323039764714257293'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/05/tuesday-may-19th-for-record.html' title='Tuesday May 19th: for the record!'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-1871057933873852104</id><published>2009-04-24T08:24:00.000-07:00</published><updated>2009-05-22T07:07:54.548-07:00</updated><title type='text'>Monday May 18: JN25, part five</title><content type='html'>Allllrighty then, this is the very last part of the little program I've been showing you. This is the part that starts really bringing it together&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here's what to do:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) first off, we add a KeyListener along with all those other listeners at the top of the program, like so (MAKE IT &lt;em&gt;&lt;strong&gt;LOOK&lt;/strong&gt;&lt;/em&gt; LIKE THIS, DO NOT ADD ANOTHER WHOLE LINE):&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;implements ActionListener, ChangeListener, ItemListener, KeyListener&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;B) If this key listener thing sounds familar, well it should: your classmate Evan taught this to you weeks ago&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;C) The KeyListener requires that three methods be declared, even if you only are goiong to use one of them. Hey, I didn't set it up that way...not my idea! Anyway, just add this block underneath the (STILL empty) actionperformed code block&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;public void keyTyped(KeyEvent e) { }//empty method&lt;br /&gt;public void keyPressed(KeyEvent e) &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;{&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;}// we will use this method&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;public void keyReleased(KeyEvent e) { }//empty method&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;D) Now the next step will use a switch case, which is similar to an if statement, but is especially adept at using ints. Here's the first small part which we will setup INSIDE the curly braces for the keyPressed(KeyEvent e) method&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;switch (e.getKeyCode()) //every key has an integer keyCode&lt;br /&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;case KeyEvent.VK_Q: // 1st in array?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;whichOne=0; &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;break; &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;case KeyEvent.VK_W: // 2nd in array?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;whichOne=1;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;break; &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;case KeyEvent.VK_E: // 3rd in array?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;whichOne=2;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;break; &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;case KeyEvent.VK_R: // 4th in array?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;whichOne=3;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;} //end switch case &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;System.out.println(whichOne); //show value of integer in console&lt;br /&gt;String codedStuff = enc.getText(); //get the stuff already in code JTextArea enc.setText(codedStuff + coded[whichOne]);//add new stuff into code JTextArea&lt;br /&gt;} //end keypressed&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;E) The quick ones among you will have already figured out that this method receives input in the form of a key that's been pressed, then uses that key to set the value of an integer. This intger then points to an element in the coded Array, and then types that String to the other JTextArea, appending it at the end of encrypted text thats already there. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The entirety of the switch case can be found here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.box.net/shared/ppxd8c35tz"&gt;http://www.box.net/shared/ppxd8c35tz&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;cheers,&lt;br /&gt;&lt;br /&gt;Mr. L&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-1871057933873852104?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/1871057933873852104/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/monday-may-18-jn25-part-five.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1871057933873852104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1871057933873852104'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/monday-may-18-jn25-part-five.html' title='Monday May 18: JN25, part five'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-2064309398634301051</id><published>2009-04-24T07:52:00.000-07:00</published><updated>2009-05-18T04:53:20.320-07:00</updated><title type='text'>Monday May 18: JN25, part four</title><content type='html'>Before beginning work on your game projects, I am going to have you each make another addition to the program I have been demonstrating to recently. It will be useful for the following reasons:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1) It will set up for the beginning of next wek, when we can have some $#+33^ 6((3 fun with this program&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2) it will demonstrate how you can use arrays and loops to create large numbers of similiar components&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3) It will show some fun stuff you can do with swing type labels&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OK, here we go again&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) In the "declarations" section of this program, you will add two new JPanels, two JLabels and twoArrays, like so:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;JPanel alpha,omega;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;JLabel noCode, crypto;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;//use with clear JTextArea &amp;amp; noCode JLabels&lt;br /&gt;String[] qwerty ={"q","w","e","r","t", "y", "u", "i","o","p","a","s","d","f","g","h","j","k","l"," ","z","x","c","v","b","n","m", ".", ",","!"};&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;//use with enc JTextArea &amp;amp; crypto JLabels&lt;br /&gt;String[] coded ={"!","@","#","$","%", "^", "&amp;amp;", "*","(",")","+","=","{","}","[","]","1","2","3"," ","4","5","6","7","8","9","0", ".", ",","!"};&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;You will notice that each array has thirty elements and that both are String arrays. If you believe that they can be used together for a simple cypher, you guessed correctly&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Compile and run now to make sure you have no errors before we proceed&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;B) Just above the end of the constructor line that makes the program visible, add this method call:&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;addAlpha(); //call method set up clear keys&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;C) create this new method just below the (STILL!) empty actionPerformed method block: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;//method to populate JLabels for clear keys &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;public void addAlpha() &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;{ &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;alpha = new JPanel();&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;alpha.setBounds(20,150,300,200);&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;alpha.setLayout(new GridLayout(3,10));&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;for (int i = 0; i &lt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;{ &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;noCode = new JLabel(qwerty[i],SwingConstants.CENTER); //create a label noCode.setBorder(new LineBorder(Color.blue, 3)); //give it a blue border &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;alpha.add(noCode); //add label to Panel &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;System.out.println(qwerty[i]); &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;}&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;//end for loop fill clear labels&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;Ultra.add(alpha); //add panel to container&lt;br /&gt;}//end addAlpha&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;OK, that's great, but what does it all mean? Well, let's break it down:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;1) You're making a new JPanel, with a GridLayout of three rows of ten&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;2) You're using a for loop that will run the "length" of the qwerty Array&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;3) each pass through the for loop creates a new JLabel that has the text found at the position in the qwerty Array that is the same as the value of "i". &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;4) So if is 4, then you go to position 4 in the array, which is the letter "t", and thats what gets put in that label&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;5) each JLabel gets a pretty blue border whose thickness is set to 3&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;6) the value of the label text gets outputted to the system console&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;7) when the loop is done and the JPanel is filled, put the JPanel into the container&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;30 labels in an eyeblink!&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;Cheers,&lt;br /&gt;Mr. L&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-2064309398634301051?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/2064309398634301051/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/monday-may-18-jn25-part-four.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/2064309398634301051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/2064309398634301051'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/monday-may-18-jn25-part-four.html' title='Monday May 18: JN25, part four'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-377820345988305730</id><published>2009-04-24T07:28:00.001-07:00</published><updated>2009-05-13T08:27:36.846-07:00</updated><title type='text'>Wednesday April 29th: JN25, part three</title><content type='html'>Today we will keep this part of the class to a minimum: you will only need to add a JComboBox to the JPanel from yesterday, you know, the one with the slider in it. You will then use this JComboBox to determine the font of the text in the JTextArea. Here's how you do it:&lt;br /&gt;&lt;br /&gt;A) Add a new "listener" at the end of the line that says "implements ActionListener, ChangeListener"&lt;br /&gt;so that it reads &lt;span style="color:#ff0000;"&gt;&lt;strong&gt;implements ActionListener, ChangeListener, ItemListener&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;we need an itemlistener here because comboboxes are basically lists of items, in this case, font names&lt;br /&gt;&lt;br /&gt;B) In the constructor, add the code for creating the JComboBox and its JLabel JUST BELOW WHERE YOU ADDED THE SLIDER AND ITS LABEL&lt;br /&gt;&lt;br /&gt;Here is the code you add:&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;//add array elements to JComboBox&lt;br /&gt;daFonts = new JComboBox(typeStyle);&lt;br /&gt;daFonts.setSize(150,25);&lt;br /&gt;//add itemlistener to combobox&lt;br /&gt;daFonts.addItemListener(this); &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;setWordz.add(daFonts); //add combobox to panel&lt;br /&gt;whatDaFont = new JLabel("Please Choose a Font",SwingConstants.CENTER); &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;whatDaFont.setSize(150,25); &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;setWordz.add(whatDaFont); //add JLabel for combobox to panel&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;C) As you might imagine, you have to add a new ItemListener method to handle the event of you choosing a new font from the list. Here it is, and please enter it just below the other one you made yesterday:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;public void itemStateChanged(ItemEvent e)&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;{&lt;br /&gt;//set String variable for font style to item chosen in combobox&lt;br /&gt;whichFont = daFonts.getSelectedItem().toString();&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;ChangeDemWordz(); //call method set size and font of JTextAreas&lt;br /&gt;}//end itemStateChanged&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;As you can see, you're setting a String variable equal to whatever has been chosen from the JComboBox, then calling the same method from yesterday to apply it to text that gets typed&lt;br /&gt;&lt;br /&gt;See how easy?&lt;br /&gt;Mr. L&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-377820345988305730?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/377820345988305730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/wednesday-april-29th-jn25-part-three.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/377820345988305730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/377820345988305730'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/wednesday-april-29th-jn25-part-three.html' title='Wednesday April 29th: JN25, part three'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-6749578628486274945</id><published>2009-04-24T06:52:00.000-07:00</published><updated>2009-05-13T06:51:13.495-07:00</updated><title type='text'>Tuesday April 28th: JN25, part two</title><content type='html'>&lt;div&gt;OK, so yesterday, part of what you did involved working on a small program that I have introduced. Today, before you work further on your game programs, I am going to demonstrate to you some added functionality of this other program, using a component we're already familiar with -- the JComboBox -- and one we haven't worked with yet, the JSlider.&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;We are going to use these two components to chnage the font style and size of the text typed into the JTextAreas. Here we go!&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;A) first off, you need to add this code block to your "declarations", I would do it just below the line that runs "JPanel alpha,omega, setWordz;"&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt; //use to fill JComboBox  &lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;String[] typeStyle ={"Impact ","Arial", "Comic Sans MS"};&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;JComboBox daFonts;  &lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;String whichFont= typeStyle[0]; //start with first font in Array&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;JSlider daSizes;  &lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;int fontBigness=25;  //start at font size 25&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt; //use to provide info about JSlider for font sizes and JComboBox font styles&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;JLabel whatDaFont, wowSoBig;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#000000;"&gt;As you can see, there are actually FOUR components we will be using eventually, but two of them are JLabels. These JLabels will just have some text in them to describe the function of the component they sit next to&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;Also, we will use a String to describe which font is going to be used by picking it from a String Array full of font names. Additionally, there is an int to desribe how big the font size is&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;B) NEXT, you need to add the following to your constructor:&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;//add in Panel with JSlider and JComboBox here&lt;br /&gt;setWordz = new JPanel();&lt;br /&gt;//new JPanelsetWordz.setBounds(250,380,300,50);&lt;br /&gt;setWordz.setLayout(new GridLayout(2,2));&lt;br /&gt;daSizes = new JSlider(); //new JSlider&lt;br /&gt;daSizes.setValue(fontBigness); //start at default font size&lt;br /&gt;daSizes.setSize(150,25);&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;setWordz.add(daSizes); //add slider to panel&lt;br /&gt;wowSoBig =  new JLabel("Slider Sets Font Size",SwingConstants.CENTER);&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;wowSoBig.setSize(150,25);&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;setWordz.add(wowSoBig); //add JLabel for slider to panel&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#000000;"&gt;As you can see, this sets up a JPanel that has a gridlayout with four sections. Today, you will just be filling two.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#000000;"&gt;The first thing we put in the Panel was a "JSlider". It's a little control that can be slid back and forth. By default, it starts at a value of 50 out of 100, but that can be set to something else. In this case, we set it to the value of an integer that starts at 25&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;The other thing was a JLabel. This just gives you some info about what the JSlider will do. You will notice that I've shown the way to center the text in the JLabel&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;C) OK, if you compile and run the program now, you can move the slider thingy around, but it does nothing. Here's what we do to rememdy that:&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;D) First off, you have to add a new kind of Listener way up at the top of the program, after the part that says "implement ActionListener".  make it read like so:&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;implement ActionListener, ChangeListener&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;The next obvious step is to add a ChangeListener to your slider, like so:&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;daSizes.addChangeListener(this);//add changelistener to slider&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#000000;"&gt;E) Once you have a ChangeListener on the JSlider, you gotta tell it to DO something once you have its attention. So, just below the (still empty) actionPerformed method block, add in this new method block:&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;public void stateChanged(ChangeEvent ce)&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;{ &lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;fontBigness = daSizes.getValue(); &lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;System.out.println(fontBigness); &lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;ChangeDemWordz();//call method to change the font size &amp;amp; face  &lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;}&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;All this method does is to to change the integer "fontBigness" to the value of the JSlider as you move it around...you can see it change in the system console. BUT, it doesn't actually change the size of the font in the JTextAreas, which is why you call another method, a "homegrown" method called :&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;public void ChangeDemWordz()&lt;br /&gt;{&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;clear.setFont(new Font(whichFont, 0, fontBigness));&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;enc.setFont(new Font(whichFont, 0, fontBigness)); &lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;}//end method ChangeDemWordz()&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#000000;"&gt;OK, so re-compile and run the program. You should be able to change the font size of text in this program at will.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#000000;"&gt;Once you're done with that, proceed to working on your game programs&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#000000;"&gt;Cheers,&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#000000;"&gt;Mr. L&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-6749578628486274945?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/6749578628486274945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/tuesday-april-28th-jn25-part-two.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/6749578628486274945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/6749578628486274945'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/tuesday-april-28th-jn25-part-two.html' title='Tuesday April 28th: JN25, part two'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-38312485465779207</id><published>2009-04-24T06:14:00.000-07:00</published><updated>2009-05-12T05:32:19.916-07:00</updated><title type='text'>Tuesday May 12th: JN25, part one</title><content type='html'>There is a program I am going to have you build over the next few days which has some interesting features which I must demonstrate to you while you work on your game programs. Here we go....&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;There is a file called "JN25" which you will need to download from a folder found here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.box.net/shared/aha47pf4fi"&gt;http://www.box.net/shared/aha47pf4fi&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When you compile and run it, you will find a very simple program which actually doesn't have much in it just yet. There are only two simple things we are going to do with this program:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) add two JTextAreas inside two JScrollPanes which have vertical scrollbars, just like those we put the JEditorPanes inside a few weeks back&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;B) add a small correction to a slight problem you will no doubt notice almost immediately&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For part A, we need to construct two JTextAreas that are next to each other. Here's how the first one gets built:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;in the programs constructor, just below where it states that the JFrame's container has a "null" layout, enter in this code block:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;clear = new JTextArea("", 20,20);&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;clear.setBounds(10,10,400,100);&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;clearScroll = new JScrollPane(clear);&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;clearScroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;clearScroll.setBounds(10,10,400,100);&lt;br /&gt;Ultra.add(clearScroll);&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;This adds a new JTextArea, which unlike a TextField, has multiple rows as well as many columns: how many has been determined by the 20,20 ints above&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The JTextArea is added inside a scrollpane, because if you end with lots of text in it, you might need to scroll up and down to read it all&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The ScrollPane is then added to the container, and since that container's layout is set to null, you need to setBounds on the ScrollPane to determine where it gets placed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Once you have that set up, all you need to do to put the other JTextArea/scrollpane onto the program is to copy and paste the code block from above, paste it right below that first code block in your program, then change the neame of the JTextArea from "clear" to "enc" and the name of the JScrollPane from "clearScroll" to "encScroll".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And of course, you have to change WHERE the second textarea/scroller is placed. Hint: if you set the first int valuein "setBounds" to something bigger than "10", say "450", that should do it&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OK, one last thing: when you type in either of these JTextAreas, you will notice that they don't "word wrap" Even though the JScollPane has a vertical scrollbar. !!!!#!@##!~!!!!!!!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;fear not though: you can control that by adding these three lines just below where you setbounds for the first JTextArea:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;clear.setEditable(true);&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;clear.setLineWrap(true);&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;clear.setWrapStyleWord(true);&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;Make sure to do it for the other JTextArea as well. When you're done, your groups may proceed onwards with your game projects&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Mr. L&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-38312485465779207?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/38312485465779207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/tuesday-may-12th-jn25-part-one.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/38312485465779207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/38312485465779207'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/tuesday-may-12th-jn25-part-one.html' title='Tuesday May 12th: JN25, part one'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-5775005014630351278</id><published>2009-04-24T06:07:00.000-07:00</published><updated>2009-04-27T04:26:51.842-07:00</updated><title type='text'>Monday April 27th: Before we begin, a simple poll</title><content type='html'>Greetings, and welcome back&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Before we begin, I would like for you to meet as teams and decide how much additional time you will require to work on your game projects. We can either limit it to the rest of this week, or extend it to include both this week and next week. So, it either ends May 1 or May 8.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Decide by teams and then make one group discussion post per team. The subject line should include all the names of the people working together as a group, followed by either the May 1 or the May 8 deadline.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Additionally, each team should indicate if they feel the need to have the entirety of today's class devotd to their project or not. I have several techniques that I would love to demonstrate, but they can wait if you need the additonal time&lt;br /&gt;&lt;br /&gt;Lastly, in the body of your post, please indicate whether or not your team feels sufficiently confident of your program to be able to present it to the rest of the class, field questions, ect etc.&lt;/p&gt;&lt;br /&gt;Once that is done, we can go on to the next step&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Mr. L&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;an "E"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-5775005014630351278?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/5775005014630351278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/monday-april-27th-before-we-begin.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/5775005014630351278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/5775005014630351278'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/monday-april-27th-before-we-begin.html' title='Monday April 27th: Before we begin, a simple poll'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-851550589304118444</id><published>2009-04-15T04:25:00.000-07:00</published><updated>2009-04-15T05:02:06.333-07:00</updated><title type='text'>wednesday April 15th: prepping for beyond the break</title><content type='html'>greetings, Java-nated ones,&lt;br /&gt;&lt;br /&gt;as you may have guessed, I am not in today. That being the case, I have decided to go forward with two items I meant to work on after the break, to wit:&lt;br /&gt;&lt;br /&gt;A) Anything that you have &lt;ahem&gt; missed passing in, either as an attached Java assignment or as a group discussion posting, start getting that made up today. If you forget what you owe, just compare recent blog posts that I have made to group discussion posts you were supposed to have made&lt;br /&gt;&lt;br /&gt;B) Begin setting up a list of basic (no, I can't hear you from here) ideas for developing some sort of game program in Java, using knowledge which already have and employing both AWT and Swing components as needed. I'm not necessarily talking about WoW or Halo -- obviously-- but something a little more doable. When I return, I'll demonstrate something along those lines. Here are some things you should consider for your game:&lt;br /&gt;&lt;br /&gt;1) What is the object of the game?&lt;br /&gt;&lt;br /&gt;2) does it have identifiable characters?&lt;br /&gt;&lt;br /&gt;3) does it have multiple skill levels?&lt;br /&gt;&lt;br /&gt;4) how does it register input?&lt;br /&gt;&lt;br /&gt;5) can it have more than one player?&lt;br /&gt;&lt;br /&gt;6) how does it keep score?&lt;br /&gt;&lt;br /&gt;7) how do you determine when the game ends?&lt;br /&gt;&lt;br /&gt;8) can you save games? high scores? levels&lt;br /&gt;&lt;br /&gt;9) can you "build" a character? -- (that'd be a bit more difficult, but perhaps fun to try)&lt;br /&gt;&lt;br /&gt;Please think about these issues, then create a Group discussion post named after yourself, plus the phrase "Java gaming". Describe what you have in mind for your game.&lt;br /&gt;&lt;br /&gt;And yes, in answer to your question, you may work with partners on this if you wish. Please include that in your posts...but remember, ALL of you must make that first post.&lt;br /&gt;&lt;br /&gt;Mr. L&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-851550589304118444?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/851550589304118444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/wednesday-april-15th-prepping-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/851550589304118444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/851550589304118444'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/wednesday-april-15th-prepping-for.html' title='wednesday April 15th: prepping for beyond the break'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-2380513457437507052</id><published>2009-04-11T15:31:00.000-07:00</published><updated>2009-04-13T09:47:33.596-07:00</updated><title type='text'>Monday April 13th: Improving our "browser"</title><content type='html'>Gentlemen,&lt;br /&gt;&lt;br /&gt;If you will recall, last week, before Evan made some noise with you and I showed you a little bit about JToolbars, we wer working on a kind of "browser": not exactly Firefox, but it was a start. I had told you that at some point, I would show you how to modify this program so that Favorites you added would STAY in your favorites list, by using some basic File reading and writing capabilities.&lt;br /&gt;&lt;br /&gt;Before I go any further, I want to point out from the beginning that there are some obvious "bugs" in the way this program is setup. My purpose in doing this is to get you to think about how YOU would fix the errors, as well as being able to look for them in the first place. If you don't know there's a problem, it's kind of like that giant squid in the Family Guy episode: it's there, whether you acknowledge it or not.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Also, there's a file that I used in this version of the program which you can download here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.box.net/shared/n32n5qk2qs"&gt;http://www.box.net/shared/n32n5qk2qs&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It's called "addys.pml". Later on, you can modify this file, but for now, you can just use it as we progress through this lesson.&lt;br /&gt;&lt;br /&gt;so OK, here we go:&lt;br /&gt;&lt;br /&gt;The improvement to be made today involves being able to REALLY save favorites to a list. In the most recent incarnation of this program, you were able to use an "Add to Faves" button to add a particular website address to your JComboBox; but when the program closed, all those newly added Favorites were lost.&lt;br /&gt;&lt;br /&gt;The solution is to use some elemental File writing and reading capabilities to your program. If your favorites list is built by reading from a separate text file, then it follows that anything you WRITE to that file during the course of running the program should be available the next time you run it. Here's what I did:&lt;br /&gt;&lt;br /&gt;In your constructor, you should have a code block that looks like this:&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;webURL = new Vector();&lt;br /&gt;webURL.addElement("&lt;/span&gt;&lt;/strong&gt;&lt;a href="http://www.google.com/"&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;http://www.google.com&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;");&lt;br /&gt;webURL.addElement("&lt;/span&gt;&lt;/strong&gt;&lt;a href="http://www.thinkgeek.com/"&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;http://www.thinkgeek.com&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;");&lt;br /&gt;webURL.addElement("&lt;/span&gt;&lt;/strong&gt;&lt;a href="http://www.yahoo.com/"&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;http://www.yahoo.com&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;");&lt;br /&gt;webURL.addElement("&lt;/span&gt;&lt;/strong&gt;&lt;a href="http://www.foxnews.com/"&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;http://www.foxnews.com&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;");&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;You need to comment out that entire block!&lt;br /&gt;Well now, if you do that, your Favorites list will be empty. So, we've gotta find some other way of populating it. Here's what I did:&lt;br /&gt;&lt;br /&gt;Just below the stuff I commented, I made a method call:&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;readFilesMakeFaves(); //call this method&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;This means I have to create the method that will be called; just make sure you don't embed this thing inside another method. That would be bad. Here is what my method looks like:&lt;br /&gt;&lt;br /&gt;private void readFilesMakeFaves( )&lt;br /&gt;{&lt;br /&gt;webURL = new Vector();//create vector&lt;br /&gt;//add to that vector using file read&lt;br /&gt;try {&lt;br /&gt;BufferedReader in = new BufferedReader(new FileReader("addys.pml"));&lt;br /&gt;String str;&lt;br /&gt;while ((str = in.readLine()) != null)&lt;br /&gt;{&lt;br /&gt;System.out.println(str); //show whats going into file in system console&lt;br /&gt;webURL.addElement(str); //add to the vector the line just read&lt;br /&gt;}&lt;br /&gt;in.close( ); //stop reading&lt;br /&gt;}&lt;br /&gt;catch (IOException e)&lt;br /&gt;{System.out.println("file not found or is null"); }&lt;br /&gt;}//end readfilemakefaves method&lt;br /&gt;&lt;br /&gt;So what this filereader does is to open up the file called "addys.pml", and read it one line at a time. As it does so, it adds each line to the JComboBox. It also prints out each line to the System console. So far, so good!&lt;br /&gt;&lt;br /&gt;The next step is to modify the "Add Faves" button so that it can add a favorite as a line into the "addys.pml" file. This will mean that even if you close the program and then re-start it, the new favorites places that has been added will STILL be in the list, which is an improvement over the previous system. Here is how I did it:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;private void addFaves()&lt;br /&gt;{&lt;br /&gt;//read into the addy.pml file the address in JTextField&lt;br /&gt;try {&lt;br /&gt;//open a writer to append to end of addys.pml file which stores faves&lt;br /&gt;BufferedWriter out = new BufferedWriter(new FileWriter("addys.pml", true));&lt;br /&gt;out.newLine(); //drop to next line&lt;br /&gt;out.write(WhereTo.getText()); //write in contents of JTextField&lt;br /&gt;out.close(); //stop writing fer cryin' out loud&lt;br /&gt;}&lt;br /&gt;catch (IOException e) { }&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;OK, here's what I want you to do after you've saved, compiled and run this thing:&lt;br /&gt;&lt;br /&gt;A) At some point, I will want you to add a JToolbar to this program which will have graphical buttons that provide another way of doing the stuff we've already been doing with this programB) There's at least one glaring omission with this program, something it should do but doesn't. Figure out what it is, then figure out YOUR way to fix it.&lt;br /&gt;&lt;br /&gt;C) After you've done both A and B above, please make a discussion post describing the problem you found and your solution.&lt;br /&gt;&lt;br /&gt;D) Please email your completed program before the end of the class.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-2380513457437507052?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/2380513457437507052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/monday-april-13th-improving-our-browser.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/2380513457437507052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/2380513457437507052'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/monday-april-13th-improving-our-browser.html' title='Monday April 13th: Improving our &quot;browser&quot;'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-3259537061971009045</id><published>2009-04-09T05:36:00.000-07:00</published><updated>2009-04-09T07:32:54.904-07:00</updated><title type='text'>Thursday, April 9: Evan's at bat and here's the rest of the code!</title><content type='html'>public boolean keyDown(Event e, int key)&lt;br /&gt;&lt;br /&gt;//this boolean called keydown sets the key so if it is pushed, the sound will play.&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;if(key=='q'key=='Q')&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if (lowCPlaying == false)&lt;br /&gt;{&lt;br /&gt;lowC.loop();&lt;br /&gt;}&lt;br /&gt;lowCPlaying = true;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if(key=='w'key=='W')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if (lowDPlaying == false)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;lowD.loop();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;lowDPlaying = true;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if(key=='e'key=='E')&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if (lowEPlaying == false)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;lowE.loop();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;lowEPlaying = true;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;if(key=='r'key=='R')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if (lowFPlaying == false)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;lowF.loop();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;lowFPlaying = true;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;if(key=='t'key=='T')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if (lowGPlaying == false)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;lowG.loop();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;lowGPlaying = true;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;if(key=='y'key=='Y')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if (lowAPlaying == false)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;lowA.loop();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;lowAPlaying = true;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(key=='u'key=='U')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if (lowBPlaying == false)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;lowB.loop();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;lowBPlaying = true;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(key=='i'key=='I')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if (midCPlaying == false)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;midC.loop();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;midCPlaying = true;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(key=='o'key=='O')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if (midDPlaying == false)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;midD.loop();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;midDPlaying = true;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(key=='p'key=='P')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if (midEPlaying == false)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;midE.loop();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;midEPlaying = true;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(key=='a'key=='A')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if (midFPlaying == false)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;midF.loop();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;midFPlaying = true;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(key=='s'key=='S')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if (midGPlaying == false)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;midG.loop();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;midGPlaying = true;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(key=='d'key=='D')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if (midAPlaying == false)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;midA.loop();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;midAPlaying = true;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(key=='f'key=='F')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if (midBPlaying == false)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;midB.loop();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;midCPlaying = true;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(key=='g'key=='G')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if (highCPlaying == false)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;highC.loop();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;highCPlaying = true;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;return true;&lt;br /&gt;&lt;br /&gt;}//end keyDown method&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public boolean keyUp (Event e, int key)&lt;br /&gt;&lt;br /&gt;//this makes a boolean so when the key is not being pushed the sound will stop.&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if(key=='q'key=='Q')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;lowC.stop();&lt;br /&gt;&lt;br /&gt;lowCPlaying = false;&lt;br /&gt;&lt;br /&gt;}if(key=='w'key=='W')&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;lowD.stop();&lt;br /&gt;&lt;br /&gt;lowDPlaying = false;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if(key=='e'key=='E')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;lowE.stop();&lt;br /&gt;&lt;br /&gt;lowEPlaying = false;&lt;br /&gt;&lt;br /&gt;}if(key=='r'key=='R')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;lowF.stop();&lt;br /&gt;&lt;br /&gt;lowFPlaying = false;&lt;br /&gt;&lt;br /&gt;}if(key=='t'key=='T')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;lowG.stop();&lt;br /&gt;&lt;br /&gt;lowGPlaying = false;&lt;br /&gt;&lt;br /&gt;}if(key=='y'key=='Y')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;lowA.stop();&lt;br /&gt;&lt;br /&gt;lowAPlaying = false;&lt;br /&gt;&lt;br /&gt;}if(key=='u'key=='U')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;lowB.stop();&lt;br /&gt;&lt;br /&gt;lowBPlaying = false;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(key=='i'key=='I')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;midC.stop();&lt;br /&gt;&lt;br /&gt;midCPlaying = false;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(key=='o'key=='O')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;midD.stop();&lt;br /&gt;&lt;br /&gt;midDPlaying = false;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(key=='p'key=='P')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;midE.stop();&lt;br /&gt;&lt;br /&gt;midEPlaying = false;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(key=='a'key=='A')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;midF.stop();&lt;br /&gt;&lt;br /&gt;midFPlaying = false;&lt;br /&gt;&lt;br /&gt;}if(key=='s'key=='S')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;midG.stop();&lt;br /&gt;&lt;br /&gt;midGPlaying = false;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(key=='d'key=='D')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;midA.stop();&lt;br /&gt;&lt;br /&gt;midAPlaying = false;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(key=='f'key=='F')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;midB.stop();&lt;br /&gt;&lt;br /&gt;midBPlaying = false;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(key=='g'key=='G')&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;highC.stop();&lt;br /&gt;&lt;br /&gt;highCPlaying = false;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;return true;&lt;br /&gt;&lt;br /&gt;} // end keyUp method&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-3259537061971009045?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/3259537061971009045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/thursday-april-9-evans-at-bat-and-heres.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3259537061971009045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3259537061971009045'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/thursday-april-9-evans-at-bat-and-heres.html' title='Thursday, April 9: Evan&apos;s at bat and here&apos;s the rest of the code!'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-3615113505746084944</id><published>2009-04-08T09:36:00.000-07:00</published><updated>2009-04-09T07:01:20.205-07:00</updated><title type='text'>Thursday, April 9: Evan's at bat -- and man is he LOUD!</title><content type='html'>&lt;strong&gt;&lt;span style="font-size:78%;"&gt;[Note from Mr. L: today we will be having the second in our series of student led programming classes. If you care to be the next volunteer, you know where to find me]&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:78%;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;hello grand privateers - this is your BloodSail Admiral, Abquhazar!&lt;br /&gt;Today we will be looking at a simple sound player. I attempted to make this in Visual Basic but I Epic failed.... and yet somehow, I got it in JAVA!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;but any ways, we are going to learn how to play the violin today =D&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;lets break this down shall we?&lt;br /&gt;we are gonna start this with the usual... please download the initial file at&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.box.net/shared/nf2gty9c0i"&gt;http://www.box.net/shared/nf2gty9c0i&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It has the startup file with three empty methods: init, keyDown and keyUp&lt;br /&gt;&lt;br /&gt;The file is meant to be played as an Applet, btw.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;now lets declare some things; we will do that just ABOVE the init( ) method:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;AudioClip lowC, lowD, lowE, lowF, lowG, lowA, lowB, midC, midD, midE, midF, midG, midA, midB, highC; //all this stuff should go on one line!&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;int keyPressed;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I made enough sound files to play 2 octaves in C Major. Personally, C Major is my favorite scale but if you're not into music theory its all the same.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;now we declare some booleans....you know, things that are either true or false. In this case, we wanna know if a particular note is playing....&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;boolean lowCPlaying,lowDPlaying,lowEPlaying,lowFPlaying, lowGPlaying, lowAPlaying, lowBPlaying, midCPlaying,midDPlaying, midEPlaying, midFPlaying,midGPlaying, midAPlaying, midBPlaying, highCPlaying;&lt;br /&gt;//all this should should go on one line!!!&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Once again, Iused 2 octaves of notes in a moajor scale.... thats 16 notes right there.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ok, so now get into our public void - once again, we have many sound files to load so lets get crackin'.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Fill this empty init method so that it looks like this:&lt;br /&gt;public void init( )&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;try&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;lowC=getAudioClip(getCodeBase(),"lowc.mid");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;lowD=getAudioClip(getCodeBase(),"lowd.mid");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;lowE=getAudioClip(getCodeBase(),"lowE.mid");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;lowF=getAudioClip(getCodeBase(),"lowF.mid");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;lowG=getAudioClip(getCodeBase(),"lowG.mid");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;lowA=getAudioClip(getCodeBase(),"lowA.mid");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;lowB=getAudioClip(getCodeBase(),"lowB.mid");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;midC=getAudioClip(getCodeBase(),"midC.mid");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;midD=getAudioClip(getCodeBase(),"midD.mid");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;midE=getAudioClip(getCodeBase(),"midE.mid");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;midF=getAudioClip(getCodeBase(),"midF.mid");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;midG=getAudioClip(getCodeBase(),"midG.mid");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;midA=getAudioClip(getCodeBase(),"midA.mid");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;midB=getAudioClip(getCodeBase(),"midB.mid");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;highC=getAudioClip(getCodeBase(),"highC.mid");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}//end try&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;catch (Exception e){ } //end empty catch&lt;br /&gt;&lt;br /&gt;} //end init&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You have to use a "try catch" to init the sounds for the same reason you use it when loading a webpage: you have to have a "just in case' event in case the sounds aren't there.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So now after all the sounds are loaded, we will set up keydown commands to play the sound! We will put this in the boolean called "keyDown". Here we go...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;INSIDE the public boolean keyDown method, just above the "return true" statement, add this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;if(key=='q'key=='Q')&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;{ &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;if (lowCPlaying == false) &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;{ &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;lowC.loop(); &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;} &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;lowCPlaying = true;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is just one sound. lets see if you can figue some of this out - I'll put the next post up in a few minutes to show the rest...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;now as we might realize, there is no way to stop the sound once is has played... SO we are gonna have to make another boolean called keyUp. now im not going to tell you how to fix this problem just yet... lets have your brain go for a little jog...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;any one get it? Well here is the spoiler for all the n0obs who didnt try....&lt;br /&gt;&lt;br /&gt;Put this in the keyUp method, just above the "return true"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;if(key=='q'key=='Q')&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;{ &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;lowC.stop(); &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;lowCPlaying = false; &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;Save, compile, then run the program...when you do, you should be able to play a low C when you press the "Q" key.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;The rest of the program is about adding in more if statements to both the keyUp and keyDown methods: other sounds connected with other keys. See if you can figure that out on your own....if not, then I'll give ya the complete set in another blog post &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-3615113505746084944?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/3615113505746084944/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/thursday-april-9-evans-at-bat-and-man.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3615113505746084944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3615113505746084944'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/thursday-april-9-evans-at-bat-and-man.html' title='Thursday, April 9: Evan&apos;s at bat -- and man is he LOUD!'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-4822237208071854523</id><published>2009-04-07T20:10:00.000-07:00</published><updated>2009-04-08T04:47:00.603-07:00</updated><title type='text'>Wednesday, April 8: Tooltips and rollovers and Togglers, O my!</title><content type='html'>OK, now for the second phase of today's adventure: tooltips! This is actually pretty simple to do: to the first JButton you made, add this line of code:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Smile.setToolTipText("Always look on the bright side of life!");&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;then re-compile and run the program. You should get a message that pops up each time you leave the mouse over any particular JButton.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Speaking of rollovers, if you add this line of code:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;Utool.setRollover(true);&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;after this liner of code&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Utool.setFloatable(true);&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;you will get another effect showing which JButton you are about to select&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OK, now for our other component, the JToggleButton. This component acts like a kind of light switch: it has an on and off position, and you can make things happen in your program based on that. It can be added to your JToolbar like any other JButton, and it can make use of another type of Listener, an "ItemListener" (This type of listener can also be used by radio buttons, but we'll get to that some other time) So, first things first, lets add an ItemListener to your program:&lt;br /&gt;&lt;br /&gt;add this &lt;span style="color:#ff0000;"&gt;&lt;strong&gt;, ItemListener&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;after this &lt;strong&gt;&lt;span style="color:#ff0000;"&gt;implements ActionListener&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;put 'em both on the same line&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;then, declare this:&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;JToggleButton JTB;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;and then add it into memory like so&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;JTB = new JToggleButton(new ImageIcon("gearHead.jpg") );&lt;br /&gt;JTB.setToolTipText("Gear Up, Mates!");&lt;br /&gt;JTB.addItemListener(this);&lt;br /&gt;Utool.add(JTB);&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;Finally, you need to add an ItemStateChanged method to your program. You can probably do this just below your actionPerformed method, that's where I did it:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;public void itemStateChanged(ItemEvent evt)&lt;br /&gt;{&lt;br /&gt;if (evt.getStateChange() == ItemEvent.SELECTED)&lt;br /&gt;{&lt;br /&gt;Utool.setFloatable(false);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;Utool.setFloatable(true);&lt;br /&gt;}&lt;br /&gt;}//end itemStateChanged&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;Cheers,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;Uncle Paulie&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-4822237208071854523?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/4822237208071854523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/wednesday-april-8-tooltips-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/4822237208071854523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/4822237208071854523'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/wednesday-april-8-tooltips-and.html' title='Wednesday, April 8: Tooltips and rollovers and Togglers, O my!'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-7340518915058576967</id><published>2009-04-07T19:47:00.000-07:00</published><updated>2009-04-08T04:31:51.956-07:00</updated><title type='text'>Wednesday, April 8: and now for something completely different...</title><content type='html'>greetings, one and all!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Today, we will be learning about a couple of really neat components that can make your programs that much more legit acting and looking. The first one is a JToolbar, and it is exactly like it sounds: it functions in much the same way as the toolbar you find in the browser you're using right this second. The second is a JToggleButton, which can be used to turn things on and off.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When we're done playing with these two new additions, you will need to do the usual routine of applying what you've learned to something else you already knew, AND sending your new program by email, AND posting a discussion about it. Plus, after you're done with that, you will get to apply what you've learned to something that we haven't covered in class, which I know many of you are doing already anyhow. Btw, if there is still some interest by any of you in leading the class on a particular topic of your choosing, please let me know.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OK, lets get going: download the Java file and the image files found here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.box.net/shared/zkrrerzdfx"&gt;http://www.box.net/shared/zkrrerzdfx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;and put 'em all in a separate directory inside your main Java folder&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The first step to take after opeing this program in TextPad is to add a JToolbar to it. Add this to your declarations:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;JToolBar Utool;&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;and then add it to memory in your constructor like so:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Utool = new JToolBar("Standard ToolBar, Inc.",JToolBar.HORIZONTAL );&lt;br /&gt;Utool.setFloatable(true);&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;and then add this line:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;ToolBox.add(Utool);&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;just above this line:&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Hammer.setVisible(true);&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#000000;"&gt;this gets you a toolbar that starts horizontal and can be dragged around (more on that later)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#000000;"&gt;BUT, if you compile and run your program now, you won't see very much: you have to put some JButtons on this thing first! So add this to your declarations:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;JButton Smile, Stop, BraveHeart;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;and then add this first JButton to your JToolbar, like so:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Smile = new JButton(new ImageIcon("mrHappy.jpg") );&lt;br /&gt;Smile.addActionListener(this);&lt;br /&gt;Utool.add(Smile);&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#000000;"&gt;Save, compile, then run your program. What you should have now is a MUCH more visible JToolbar which has one button in it. AND, you can drag that JToolbar around all over the place. Pretty neat, huh?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#000000;"&gt;Now, add those other two JButtons to your Jtoolbar, then lets get to the next phase&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#000000;"&gt;Cheers,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#000000;"&gt;Uncle Paulie&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-7340518915058576967?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/7340518915058576967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/wednesday-april-8-and-now-for-something.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/7340518915058576967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/7340518915058576967'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/wednesday-april-8-and-now-for-something.html' title='Wednesday, April 8: and now for something completely different...'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-1018920461916637962</id><published>2009-04-05T13:20:00.001-07:00</published><updated>2009-04-06T07:52:19.840-07:00</updated><title type='text'>Monday April 6 : additional stuff for our Swing Browser</title><content type='html'>Greetings JavaNoidz!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Today is going to be a simple two step process:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) I will show you something pretty simple to do, that can be applied to ANY program you create here, that's pretty cool, AND its a response to a request that several of you had made.&lt;br /&gt;&lt;br /&gt;Sometimes, you just gotta give the people what they want...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;B) After that, you will have the rest of the class to further develop this mini browser we've been working on. Add to it something that we've worked with before, perhaps a menu or the ability to make use of saved files to extend its capabilities.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Remember, BEFORE the class ends, email me your completed program with its new powers, AND make a post on our Google group titled "what MY browser can do"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OK, so here's something easy and cool to do that will work with any program:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;0) open the folder where your mini browser is stored&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1) start up TextPad, and open your mini browser program&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2) start up a new document, and type the following:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;start javaw CreateTabbedPane&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;where "CreateTabbedPane" is the name of the class file you wish to run.&lt;br /&gt;DO NOT add the ".class" extension&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3) save this new file as StartBrowser.bat INSIDE THE SAME FOLDER AS YOUR PROGRAM. make SURE you add that ".bat" extension&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4) This will make a batch file inside your folder that you can click on. Doing so will start your minibrowser program WITHOUT the annoying, telltale "command prompt" window --&gt; that's why you use "javaw" to invoke your program&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5) But wait there's more! It's not sold in any store! If you create a shortcut to this batch file, you should be able to drag that shortcut anywhere, even onto your Start button, which will make it part of the Start menu&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6) But wait, there's STILL more ! If you right click on your new shortcut, and then click on "Properties", you can go to the "shortcut" tab, then click on the "Change Icon" button. This allows you to browse for an icon that looks cooler than the little gear thingy looking device you're using now&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7) But wait: if you call RIGHT NOW, you can go to this address:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.iconarchive.com/"&gt;http://www.iconarchive.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;and download any kind of icon file you want. Just download them to your folder, and then when you change the icon, just browse top your folder, and choose the icon you like :-)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-1018920461916637962?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/1018920461916637962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/monday-april-6-additional-stuff-for-our.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1018920461916637962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1018920461916637962'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/monday-april-6-additional-stuff-for-our.html' title='Monday April 6 : additional stuff for our Swing Browser'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-5406882146750170363</id><published>2009-04-02T16:23:00.001-07:00</published><updated>2009-04-03T06:15:54.956-07:00</updated><title type='text'>Friday April 3: Java Swing Tabbed Browsing part Six</title><content type='html'>Alrighty then, for our last trick together before you surge ahead on your own, why don't we make an "Add to Favorites" type component? This would be something that would allow you to add additional addresses to your ComboBox. Here's what I did:&lt;br /&gt;&lt;br /&gt;A) I declared a new button:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;JButton Bravo;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;B) created it in memory and added to the program, giving it an actionlistener:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;Bravo = new JButton("Add 2 Faves");&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;Bravo.setBounds(460,0,130,20);&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;Bravo.addActionListener(this);&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;ButtonsAndText.add(Bravo);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;C) Add another "else if" to our actionPerformed:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;else if (e.getSource() == Bravo)&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;addFaves(); // make method call&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;D) create the new method that is being called&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;System.out.println("everybody, do the monkey!");&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;webURL.addElement(WhereTo.getText()); //add to vector&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;myWebPlaces = new JComboBox(webURL); //reload vector to combobox&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;That should about do it, And once you've mastered that, you know what I'm looking for:&lt;br /&gt;&lt;br /&gt;1) add something you already know about to this program&lt;br /&gt;&lt;br /&gt;2) make a posting about what you did today while working with this program&lt;br /&gt;&lt;br /&gt;Have a helluva weekend,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-5406882146750170363?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/5406882146750170363/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/friday-april-3-java-swing-tabbed_02.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/5406882146750170363'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/5406882146750170363'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/friday-april-3-java-swing-tabbed_02.html' title='Friday April 3: Java Swing Tabbed Browsing part Six'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-98829866154850235</id><published>2009-04-01T09:35:00.000-07:00</published><updated>2009-04-03T06:00:51.054-07:00</updated><title type='text'>Friday April 3: Java Swing Tabbed Browsing part Five</title><content type='html'>Hey chilluns, I just had this sudden thought: what if we wanted to have a list of websites we could goto, instead of laboriously having to type in an address over and over? There are many ways of accomplishing this, and I suppose I COULD have made a menu; but I chose another path, for three reasons:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) It would require having to make a MenuBar, Menu and several menuitems... too much work&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;B) We can accomplish the same goal using what's known in Java as a "ComboBox", aka a "pulldown menu". Plus, if we connect this ComboBox to a Vector (remember that component? Told you we'd use 'em again), it might be possible to make the list expand to hold more websites&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C) I'm too old, too stubborn and too big to be prevented from using a ComboBox.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So anyway, here's how I did it, perhaps some of you have another idea. I would love to see them :-)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Add this import for using Vectors&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;import java.util.*; //for use with vectors&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;add these to your declarations section:&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Vector webURL; //to hold addresses&lt;br /&gt;JComboBox myWebPlaces; //to display those addresses&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;Add these two components to your constructor:&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;webURL = new Vector( );&lt;br /&gt;webURL.addElement("http://www.google.com");&lt;br /&gt;webURL.addElement("http://www.thinkgeek.com");&lt;br /&gt;webURL.addElement("http://www.yahoo.com");&lt;br /&gt;webURL.addElement("http://www.foxnews.com");&lt;br /&gt;&lt;br /&gt;myWebPlaces = new JComboBox(webURL);&lt;br /&gt;myWebPlaces.setEditable(true);&lt;br /&gt;myWebPlaces.setBounds(300,0,100,20);&lt;br /&gt;myWebPlaces.addActionListener(this);&lt;br /&gt;ButtonsAndText.add(myWebPlaces);&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;Add this “else if” to your actionPerformed&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;else if (e.getSource( ) == myWebPlaces)&lt;br /&gt;{&lt;br /&gt;System.out.println(myWebPlaces.getSelectedItem());&lt;br /&gt;StartPage= myWebPlaces.getSelectedItem()+ "";&lt;br /&gt;makeTab( ); //call method, make new tab with selected page&lt;br /&gt;}//end using combobox&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: normal; COLOR: rgb(0,0,0)"&gt;Now obviously, if you want to use a different set of websites, or a different number of them, go right on ahead. Let's see what's in &lt;span style="FONT-WEIGHT: bold; FONT-STYLE: italic"&gt;your &lt;/span&gt;fridge!&lt;br /&gt;&lt;br /&gt;code is good food,&lt;br /&gt;Uncle Paulie&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-98829866154850235?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/98829866154850235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/friday-april-3-java-swing-tabbed_01.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/98829866154850235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/98829866154850235'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/friday-april-3-java-swing-tabbed_01.html' title='Friday April 3: Java Swing Tabbed Browsing part Five'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-9060628352461207552</id><published>2009-04-01T09:23:00.001-07:00</published><updated>2009-04-03T05:20:06.760-07:00</updated><title type='text'>Friday April 3: Java Swing Tabbed Browsing, part Four</title><content type='html'>Some of the sharper elements here may have noticed: hey, some websites are CUT OFF! I can't reach the bottom of the page! Wazzup wi' THAT?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Well, its true, a JeditorPane by itself will not scroll down to see all the stuff on a webpage that's too big to fit...that's why you need a "JScrollPane". What we will do is to put the JEditorPane which holds your webpage inside a JScrollPane which is added to the JTabbedPane which is added to a Container which is added to a JFrame.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Holy crap..supply lines are getting longer and harder to maintain!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Add this to your declarations&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;J&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;ScrollPane scrollTheWeb; //to make webpages scroll&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Add this to the “try catch” in the method makeTab( ),&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;//put webpage container inside scroller&lt;br /&gt;scrollTheWeb = new JScrollPane(newWeb);&lt;br /&gt;scrollTheWeb.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Just below where you have this line:&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;newWeb.setBounds(10,50,850,720);&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and then &lt;span style="FONT-WEIGHT: bold; FONT-STYLE: italic"&gt;change &lt;/span&gt;this line&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Tabitha.add("Page " + pageNumber , newWeb);&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;To look like this&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Tabitha.add("Page " + pageNumber , scrollTheWeb);&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Shazzam!&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;strong&gt;Uncle Paulie&lt;/strong&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-9060628352461207552?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/9060628352461207552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/friday-april-3-java-swing-tabbed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/9060628352461207552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/9060628352461207552'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/friday-april-3-java-swing-tabbed.html' title='Friday April 3: Java Swing Tabbed Browsing, part Four'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-1660160235877825760</id><published>2009-04-01T09:19:00.000-07:00</published><updated>2009-04-01T10:35:03.041-07:00</updated><title type='text'>Tues April 1: Java Swing Tabbed Browsing, part Three</title><content type='html'>So now we can make tabs -- and LOTS of 'em!-- but they all display the same darned website! How's about we wanna choose our own site?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;No problem-o... here's the way I did it. Perhaps you might have done it differently. This product sold by weight, not by volume...some settling of contents may have occurred during shipping :-)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Add this to your declarations section:&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;JTextField WhereTo;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Add these two components to your constructor:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Brain = new JButton("Go There");&lt;br /&gt;Brain.setBounds(160,0,130,20);&lt;br /&gt;Brain.addActionListener(this);&lt;br /&gt;ButtonsAndText.add(Brain);&lt;br /&gt;&lt;br /&gt;WhereTo = new JTextField(StartPage, 20); //starting page plus # of columns&lt;br /&gt;WhereTo.setBounds(0,0,200,20);&lt;br /&gt;WhereTo.addActionListener(this);&lt;br /&gt;ButtonsAndText.add(WhereTo);&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;Add this “else if” to your actionPerformed:&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;else if (e.getSource() == Brain)&lt;br /&gt;{&lt;br /&gt;changePage( ); // make method call&lt;br /&gt;}&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Add this method just below the “makeTab( )” method&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;private void changePage( )&lt;br /&gt;{&lt;br /&gt;System.out.println("are you pondering what I'm pondering?");&lt;br /&gt;StartPage = WhereTo.getText(); //set to addy in JTextField&lt;br /&gt;makeTab( ); //call the other method, create new tab with new address&lt;br /&gt;}//end method changePage&lt;/strong&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-1660160235877825760?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/1660160235877825760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/tues-april-1-java-swing-tabbed-browsing_5957.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1660160235877825760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1660160235877825760'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/tues-april-1-java-swing-tabbed-browsing_5957.html' title='Tues April 1: Java Swing Tabbed Browsing, part Three'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-6394371906141426561</id><published>2009-04-01T09:16:00.000-07:00</published><updated>2009-04-01T10:12:04.258-07:00</updated><title type='text'>Tues April 1: Java Swing Tabbed Browsing, part Two</title><content type='html'>OK, so maybe you're thinking to yourself: this is cool but how do I make more than one tab? If I can't do that, it defeats the whole purpose of having tabs!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Very tru, O impatient ones, but there is a simple solution: create a button that calls the method that made the first tab. Try to see if you can figure that out on your own (I'm betting some of you already have). Try it yourself, and if you can't do it for real the solution is way down at the end of this posting&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Uncle Paulie&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;See, I told you I would give you a solution...now could you try doing this yourself next time?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Add this to your constructor:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Pinky = new JButton("New Tab");&lt;br /&gt;Pinky.setBounds(0,0,130,20);&lt;br /&gt;Pinky.addActionListener(this);&lt;br /&gt;ButtonsAndText.add(Pinky);&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Add this to your actionPerformed method&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;if (e.getSource( ) == Pinky)&lt;br /&gt;{&lt;br /&gt;makeTab( ); // make method call&lt;br /&gt;}&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-6394371906141426561?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/6394371906141426561/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/tues-april-1-java-swing-tabbed-browsing_01.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/6394371906141426561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/6394371906141426561'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/tues-april-1-java-swing-tabbed-browsing_01.html' title='Tues April 1: Java Swing Tabbed Browsing, part Two'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-7924188989922581250</id><published>2009-04-01T09:00:00.000-07:00</published><updated>2009-04-01T09:56:37.039-07:00</updated><title type='text'>Tues April 1: Java Swing Tabbed Browsing, part One</title><content type='html'>Greetings, fellow JavaNoidz!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In keeping with our ongoing exploration of Java Swing, today we will be looking at how to make a program that functions as a tabbed web browser. It's a little crude, but it will do to introduce you to several components we haven't explored yet, re-aquaint you with some items we haven't used in a while, and in general, do something both useful and k3wl.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To begin, download the program found at this address:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.box.net/shared/pdhemt4r06"&gt;http://www.box.net/shared/pdhemt4r06&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When you start it up, it won't look like much: a JFrame with a Container, a JPanel, which is like every Panel we've used before, etc etc. I've written in a lot of the declarations already, too.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The first thing we're going to do is to create a new component called a "JTabbedPane". It is exactly what it sounds like: a container with a little tab on top; it looks a lot like Firefox&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Add this component to your constructor:&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Tabitha= new JTabbedPane( );&lt;br /&gt;Tabitha.setBounds(0,35,980,790);&lt;br /&gt;ProvingGround.add(Tabitha);&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;next, add this method call inside your constructor...&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;makeTab( ); //set first tab by making method call&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;it'll call a method that will load a JEditorPane into the JTabbedPane we just created:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Since we're calling a method, we should make sure it exists too! Create this method just after your constructor:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;private void makeTab( )&lt;br /&gt;{&lt;br /&gt;System.out.println("What are we gonna do tonight?");&lt;br /&gt;//setup JEditorPane using try catch&lt;br /&gt;try {&lt;br /&gt;newWeb = new JEditorPane(StartPage);&lt;br /&gt;newWeb.setEditable(false);&lt;br /&gt;newWeb.setBounds(10,50,850,720);&lt;br /&gt;Tabitha.add("Page " + pageNumber ,newWeb);&lt;br /&gt;} //end try&lt;br /&gt;catch(IOException ioe)&lt;br /&gt;{&lt;br /&gt;System.out.println("try and take over the world!");&lt;br /&gt;} //end catch&lt;br /&gt;pageNumber++; //increment int by one&lt;br /&gt;} //end makeTab method&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;What this method does is to&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;A) create a JEditorPane&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;B) add it to a new Tab that is created which&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;C) is named after a String called "Page" plus an integer value which gets&lt;br /&gt;"bumped up" by one at the end of the method&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;D) the tab includes the new JEditorPane object called newWeb&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;Cheers,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;Uncle Paulie&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-7924188989922581250?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/7924188989922581250/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/tues-april-1-java-swing-tabbed-browsing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/7924188989922581250'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/7924188989922581250'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/04/tues-april-1-java-swing-tabbed-browsing.html' title='Tues April 1: Java Swing Tabbed Browsing, part One'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-2104549740969301118</id><published>2009-03-31T07:25:00.000-07:00</published><updated>2009-03-31T07:35:06.442-07:00</updated><title type='text'>Tuesday March 31: taste the HTML rainbow, part four</title><content type='html'>OK, but what if you want to be abkle to follow links inside a webpage? Like say for example, go to the "Images" section of Google? Well to do that, you have to use a new kind of listener, a&lt;br /&gt;"HyperlinkListener"&lt;br /&gt;&lt;br /&gt;Here's what you do:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;add this    -- &gt;  &lt;span style="color:#ff0000;"&gt;&lt;strong&gt;, HyperlinkListener&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;after this:   implements ActionListener&lt;br /&gt;&lt;br /&gt;add this:&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;Webapalooza.addHyperlinkListener(this);&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt; underneath&lt;br /&gt;Webapalooza.setEditable(false);&lt;br /&gt;&lt;br /&gt;add this code block underneath the actionPerformed method:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt; public void hyperlinkUpdate(HyperlinkEvent evt)&lt;br /&gt;     {&lt;br /&gt;                         if (evt.getEventType() == HyperlinkEvent.EventType.ACTIVATED)&lt;br /&gt;                         {&lt;br /&gt;                               try&lt;br /&gt;                               {&lt;br /&gt;                                 Webapalooza.setPage(evt.getURL());&lt;br /&gt;                               } //end try&lt;br /&gt;                               catch(IOException ioe)&lt;br /&gt;                               {     } //end catch&lt;br /&gt;                         }//end if&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;             } //end hyperlinkEvent&lt;br /&gt; &lt;/span&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-2104549740969301118?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/2104549740969301118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/tuesday-march-31-taste-html-rainbow_4379.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/2104549740969301118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/2104549740969301118'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/tuesday-march-31-taste-html-rainbow_4379.html' title='Tuesday March 31: taste the HTML rainbow, part four'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-3966545316765984845</id><published>2009-03-31T05:51:00.001-07:00</published><updated>2009-03-31T07:16:04.403-07:00</updated><title type='text'>Tuesday March 31: taste the HTML rainbow, part three</title><content type='html'>OK, so now we've got a program that can display a webpage in a JEditorPane, but its kind of like ropeless bungee jumping: it might be exciting, but only for a very brief time, then the thrill is gone. Soooooooooooooooooooooooooooooooooooooooooooo, let's make it so that you can change the webpage loaded into the JEditorPane by entering an address. Here's how I did it:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Declare these two components&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;JTextField WebAddy;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;JButton ChangeAddy;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;then add these two components to your constructor:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;//create JTextField, set text to first webpage String&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;WebAddy = new JTextField(StartPage); &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;WebAddy.setBounds(345,0,200,20); //size and place it &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;WebAddy.addActionListener(this);&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;ProvingGround.add(WebAddy); //add to container&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;ChangeAddy = new JButton("Go There"); //create JButton&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;ChangeAddy.setBounds(180,0,165,35); //size and place it &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;ChangeAddy.addActionListener(this); &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;ProvingGround.add(ChangeAddy); //add to container&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;add an "else if" statement for the ChangeAddy JButton&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;else if (e.getSource() == ChangeAddy)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;{ &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;//StartPage = WebAddy.getText( );&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;try {&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Webapalooza.setPage(new URL(WebAddy.getText()));&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;// urlField.setText(url); &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;} //end try&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;catch(IOException ioe) &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;System.out.println("crap!"); &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;}//end catch &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;}//end else for ChangeAddy JButton&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;Save, compile and run; you should be able to load another website into your JEditorPane by typing the address in the JTextField then hitting the new JButton&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;Cheers,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;Uncle Paulie&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-3966545316765984845?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/3966545316765984845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/tuesday-march-31-taste-html-rainbow_3535.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3966545316765984845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3966545316765984845'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/tuesday-march-31-taste-html-rainbow_3535.html' title='Tuesday March 31: taste the HTML rainbow, part three'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-3387540042549534871</id><published>2009-03-31T05:29:00.000-07:00</published><updated>2009-03-31T07:01:31.095-07:00</updated><title type='text'>Tuesday March 31: taste the HTML rainbow, part two</title><content type='html'>OK, now setting colors is all very cool, but it starts me to wondering: isn't the World Wide Web just full of color? It sure looks that way to me. Plus -- and maybe this hasn't been on YOUR mind lately, but I've been thinking about it-- there should be some way in Java to make a webpage viewer, same as in Visual Basic, right? Well of course there is. It's called a JEditorPane. Let's get introduced, shall we?&lt;br /&gt;&lt;br /&gt;The first thing you have to do is to add these imports&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;import java.io.*; //for try catch to make JEditorPane&lt;br /&gt;import java.net.*; //for use with setting new URL for JEditorPane&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Creating a JEditorPane is not as simple as it might seem: because you're trying to load a webpage, and the webpage might not be there, you have to do it in a "try catch", which is sort of like an if else statement.&lt;br /&gt;&lt;br /&gt;Next step, add these declarations:&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;JEditorPane Webapalooza;&lt;br /&gt;String StartPage = "http://www.google.com";&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And add this to your constructor, just below where you added the "Skittles" button:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;//setup JEditorPane using try catch&lt;br /&gt;try {&lt;br /&gt;Webapalooza = new JEditorPane(StartPage);&lt;br /&gt;Webapalooza.setEditable(false); //this component can be used to edit, but not now&lt;br /&gt;Webapalooza.setBounds(0,50,780,550);&lt;br /&gt;ProvingGround.add(Webapalooza);&lt;br /&gt;} //end try&lt;br /&gt;catch(IOException ioe)&lt;br /&gt;{ } //end empty catch&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;Now when you run your program, you should see the webpage for Google displayed in the JEditorPane&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-3387540042549534871?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/3387540042549534871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/tuesday-march-31-taste-html-rainbow.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3387540042549534871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3387540042549534871'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/tuesday-march-31-taste-html-rainbow.html' title='Tuesday March 31: taste the HTML rainbow, part two'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-6131615386187540099</id><published>2009-03-31T05:06:00.000-07:00</published><updated>2009-03-31T06:50:42.679-07:00</updated><title type='text'>Tuesday March 31: taste the HTML rainbow, part one</title><content type='html'>Greetings and salutations, fellow code jockeys!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Today, we shall continue onwards with an exploration of Java Swing; and the first step on this journey is to download the file located here:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.box.net/shared/j6j4def1kc"&gt;http://www.box.net/shared/j6j4def1kc&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The file inside is functional and will start up a JFrame with a pretty red background. It has an empty actionPerformed method, and its setup so that when you close the JFrame, you shut down the whole program. Beyond that, it doesn't do much; there's not even a component that &lt;strong&gt;could&lt;/strong&gt; make anything happen. So let's change that right now, m'OK?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) just below this line in the declarations section:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Container ProvingGround;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;add this line to declare a JButton:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;JButton Skittles;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;B) In the constructor, just below this line:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;ProvingGround.setLayout(null);&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;add this code block to create and enable the JButton you just declared:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;Skittles = new JButton("Taste The Rainbow");&lt;br /&gt;Skittles.setBounds(0,0,165,35); // null layout makes you use this&lt;br /&gt;Skittles.setBackground(Color.blue);&lt;br /&gt;Skittles.addActionListener(this);&lt;br /&gt;ProvingGround.add(Skittles);&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#000000;"&gt;C)&lt;/span&gt; &lt;/span&gt;&lt;span style="color:#000000;"&gt;Finally, and most importantly, you have to add an if statement to your actionPerformed method, so that when you click the "Skittles" button, it pops up what's known as a JColorChooser Dialog. This dialog box allows you to choose a color, either by clicking on a box, or by setting integer values; you can then apply this color to the Container background:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;if (e.getSource() == Skittles)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;{ &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;//pop up JColorChooser dialog box &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Color TieDye = JColorChooser.showDialog(this,"Hey Man, the Colorz!", getBackground()); &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;if (TieDye != null) //chose a color? &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;//change the Container Color to what you chose &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;ProvingGround.setBackground(TieDye); &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;}// end choose color Skittles button&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;PLEASE NOTE: the line that starts with "Color TieDye" got wrapped to the next line; please put both lines you see here on one line.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OK, that oughta do it; compile it and run, then see if it works for you.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Btw, if you somehow can apply the colors you find in this dialog at runtime, that would be cool. Not necessary, but cool.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-6131615386187540099?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/6131615386187540099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/tuesday-march-31-taste-html-rainbow_31.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/6131615386187540099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/6131615386187540099'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/tuesday-march-31-taste-html-rainbow_31.html' title='Tuesday March 31: taste the HTML rainbow, part one'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-5864283029744996536</id><published>2009-03-29T17:59:00.000-07:00</published><updated>2009-03-30T05:05:32.320-07:00</updated><title type='text'>Monday March 30: add a JMenu !</title><content type='html'>So OK, I said at the beginning that Swing components were a lot like the older style, except they had a J at the front of them. So here is what you need to do: you've made Menus before, so let's use copy and paste, and a little knowledge of how to type the letter "J" to include a JMenu with at least one JMenuItem on this program. They don't have to do anything, let's see you get 'em on here!&lt;br /&gt;&lt;br /&gt;And a special challenge: see if you can get an image onto one of your JMenuItems. The code is pretty darned similar to the stuff we've just done&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-5864283029744996536?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/5864283029744996536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/monday-march-30-add-jmenu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/5864283029744996536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/5864283029744996536'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/monday-march-30-add-jmenu.html' title='Monday March 30: add a JMenu !'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-5334441744987646679</id><published>2009-03-29T17:51:00.001-07:00</published><updated>2009-03-30T04:56:17.284-07:00</updated><title type='text'>Monday March 30: a null layout for the whole program? Sort of....</title><content type='html'>OK, our next trick will involve a little bit of skullduggery from the old AWT library: just because we're suing Swing doesn't mean we have to forswear the old ways entirely. Here is a way to ensure that your program starts up at center screen, no matter what it's size:&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;//make a Toolkit object&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;Toolkit TK = getToolkit();&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;//use toolkit object to find screen size&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;Dimension size = TK.getScreenSize();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;//subtract 1/2 the width of JFrame from 1/2 the width of screen&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;//do the same for height&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;setLocation(size.width/2 - getWidth()/2, size.height/2 - getHeight()/2);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Toolkit is actually part of the AWT libraries, but as you can see from this example, it can be used even with swing based programs. It has its best use when creating a Splash screen: a window controlled by a Timer bearing some sort of information about the program. It lasts for about 5 to 10 seconds, then vanishes to be replaced by a Frame , or JFrame in this case&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OK, onwards to see if yuo can handle a VERY small leap!&lt;br /&gt;&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-5334441744987646679?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/5334441744987646679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/monday-march-30-null-layout-for-whole.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/5334441744987646679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/5334441744987646679'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/monday-march-30-null-layout-for-whole.html' title='Monday March 30: a null layout for the whole program? Sort of....'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-3446224100981324256</id><published>2009-03-29T16:58:00.000-07:00</published><updated>2009-03-30T04:34:55.293-07:00</updated><title type='text'>Monday March 30: SWING into spring with a new layout and a new startup position</title><content type='html'>Greetings JavaNoidz!&lt;br /&gt;&lt;br /&gt;Well, its almost one of my favorite days, April 1, and to celebrate, I want to start this week off by looking at an updated version of Java called "swing". There's three things you should know right off the bat:&lt;br /&gt;&lt;br /&gt;A) Everything in Swing is typed the same as in AWT, but with a "J" in front of it: JFrame, JButton, JTextField, etc etc&lt;br /&gt;&lt;br /&gt;B) Swing components like JButtons are not loaded directly onto JFrames, but into "Containers"&lt;br /&gt;&lt;br /&gt;C) There's some cool new things you can do in Swing that you can't do in AWT&lt;br /&gt;&lt;br /&gt;OK, so let's get going. There's a folder online at Box.net that has two files in it: one a Java file which you will build on, the other being a small image file. Please download both from here:&lt;br /&gt;&lt;a href="http://www.box.net/shared/010jen6jjn"&gt;http://www.box.net/shared/010jen6jjn&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;and put them into a folder named after yourself plus the word "swing"&lt;br /&gt;&lt;br /&gt;When you load this program into TextPad, you will notice that there is a line of code that ends with "(EXIT_ON_CLOSE)" What this does is to close the JFrame AND shut down the program.&lt;br /&gt;&lt;br /&gt;You will also notice that the JFrame has a Container object which will be used to hold components AND its layout has been set to "null". This allows you to position components exactly where you want them; BUT, you have to use the "setBounds" method for pretty much all of them. So OK, let's add a swing component and see it happen:&lt;br /&gt;&lt;br /&gt;right below this line of code:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;ProvingGround.setLayout(null);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;add these lines:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;JButton NewButton = new JButton("Look A JButton!");&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;NewButton.setBounds(0,0,165,65);&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;ProvingGround.add(NewButton);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;compile it and run it, and you will see a button. No big deal; except, let's add another one and see if we can get something a little different:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;ImageIcon buzzed = new ImageIcon("Feine.gif");&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;JButton PicButton = new JButton(buzzed);&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;PicButton.setBounds(100,200,195,65);&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;ProvingGround.add(PicButton);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;ImageIcons can be used to add images to components, including, well JButtons. Notice that this image was found in the same folder as your program; if it was elsewhere, you'd need to somehow inform your program of this.&lt;br /&gt;&lt;br /&gt;Let's try one more:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;JButton ImageNtexT = new JButton("Wired", buzzed);&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;ImageNtexT.setBounds(300,100,165,65);&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;ProvingGround.add(ImageNtexT);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;OK, for our next trick, let's look at doing some absolute positioning for the JFrame itself. Onward to the next posting!&lt;br /&gt;&lt;br /&gt;Ubcle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-3446224100981324256?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/3446224100981324256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/monday-march-30-swing-into-spring-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3446224100981324256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3446224100981324256'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/monday-march-30-swing-into-spring-with.html' title='Monday March 30: SWING into spring with a new layout and a new startup position'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-7502731551245656339</id><published>2009-03-26T07:26:00.000-07:00</published><updated>2009-03-26T07:37:34.973-07:00</updated><title type='text'>Thursday March 26: Projects must be finished up and handed in today!</title><content type='html'>Greetings, fellow code warriors!&lt;br /&gt;&lt;br /&gt;Today, we have a lunch block. It's also the last time I will meet with you this week, and its effectively the last time we will meet for this marking period. With that in mind, it's time for you to finish the projects we started back in the middle of the month. The requirements for your projects were listed &lt;a href="http://krakatoasrevenge.blogspot.com/2009/03/wednesday-march-11-unleash-hounds.html"&gt;HERE&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Please finish up to the best of your ability. You have a great deal of time, and you may use all the resources available, including all previous posts, all group discussions, all previous programs, each other, and me. You may also of course apply techniques you have learned outside the coursework I have assigned, including that taught to you yesterday by one of your peers.&lt;br /&gt;&lt;br /&gt;Make sure to send me by attachment ALL files relevant to your project, and remember to put your name and the phrase "last version" in the subject line.&lt;br /&gt;&lt;br /&gt;Also, you will need to create a final post to do with this project; in it, I will need you to record all thoughts, observations and suggestions for future projects.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-7502731551245656339?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/7502731551245656339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/thursday-march-26-projects-must-be.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/7502731551245656339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/7502731551245656339'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/thursday-march-26-projects-must-be.html' title='Thursday March 26: Projects must be finished up and handed in today!'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-4023079143463735591</id><published>2009-03-25T05:08:00.000-07:00</published><updated>2009-03-25T05:41:28.451-07:00</updated><title type='text'>How Ryan N. gets it done: instructions for making the FileSave work!</title><content type='html'>Today I, Lord Berserkguard, protector of the Alliance, am going to show you how to write files in Java – a little more advanced that the basic I/O you know with the console printing.&lt;br /&gt;&lt;br /&gt;The class we are going to work with is called FileWriter – you can pretty much tell what it does&lt;br /&gt;&lt;br /&gt;We are also going to use a Javax control called JFileChooser as a way for the user to navigate to the file/folder to save. Remember – we have to import javax.swing.* for this to work properly. The program I uploaded already has that import statement, so you don’t need to worry about it for this example.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.box.net/shared/jb0u5k2lhh"&gt;http://www.box.net/shared/jb0u5k2lhh&lt;/a&gt;&lt;br /&gt;Open up that file posted above, and you should see some import statements, a pre-made Frame for you, and an ActionPerformed event. Make a menu bar like you have in the past, with one MenuItem for a save function. Don’t forget to add an action listener to the MenuItem, otherwise it will just look pretty and not actually do anything.&lt;br /&gt;&lt;br /&gt;Once you have done that, declare and add a TextArea to the Frame&lt;br /&gt;&lt;br /&gt;(HINT: This is declared and used just about exactly the same as a TextField – if you still have trouble I will show you how to do it, there is also a line of commenting ALREADY IN THE PROGRAM which tells you the parameters it takes)&lt;br /&gt;&lt;br /&gt;Add this under the if (e.getSource() == saveFile){ in the ActionPerformed:&lt;br /&gt;If the name of your MenuItem isn’t saveFile, than you have to change the name of that to whatever you named your MenuItem.&lt;br /&gt;&lt;br /&gt;Declare a string which is set to the User’s current directory:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;String wd = System.getProperty("user.dir");&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Now, for the JFileChooser implementation – the parameter is the directory to start in, which was set using System.getProperty("user.dir");.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;JFileChooser fc = new JFileChooser(wd);&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Lastly, to show the dialog, you call the showDialog() command from the JFileChooser&lt;br /&gt;(In this case, it’s named fc)&lt;br /&gt;The command takes 2 parameters (parent and approveButtonText):&lt;br /&gt;The parent parameter isn’t all that important, and for all intensive purposes can just be set to NULL. The second parameter is the text you want the button on the dialog to display.&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;int rc = fc.showDialog(null, "Save File");&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Notice how you see the showDialog returns an integer – this is because the showDialog will return either a 0 or a 1 based on input. We can than use rc to check if the user clicked the “Save File” button or cancelled out of the dialog.&lt;br /&gt;&lt;br /&gt;So now we check if the user approved (clicked “Save File”)&lt;br /&gt;Do this by adding this ‘if’ statement:&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;if (rc == JFileChooser.APPROVE_OPTION){&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;If you wanna get creative, the APPROVE_OPTION could also be something like CANCEL_OPTION or ERROR_OPTION, depends on what you want to check for. For now let’s stick with the APPROVE_OPTION.&lt;br /&gt;&lt;br /&gt;In between this ‘if’ statement, declare a File and set it to the file that the user selected from the JFileChooser. getSelectedFile(); returns the file that was selected as type File – which is why we declare it the way we do.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;File file = fc.getSelectedFile();&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Once you add that, declare a String and set it to the file’s location&lt;br /&gt;(getAbsolutePath() returns the whole file path, for example, “C://Documents and Settings/this.txt”. getName() only returns the file name, as in “that.txt”)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;String filename = file.getAbsolutePath();&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Now that the String is set to the full path that the user navigated to, we can use it to specify where the file should be written. We have to use a ‘try’ block – all that does is try to do something, and if there is an error, it raises an exception using ‘catch’. Pretty simple, although it throws many people off unless they know what it does. Declare that now by adding these lines:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;try{&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;After you’ve done that, we can now attempt to write a file. To do this, we declare a FileWriter, and set the parameter to the path that the user chose with the JFileChooser (in this case, the String named ‘filename’)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;FileWriter writer = new FileWriter( filename );&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Now that you have initiated a FileWriter, you should close it when you are done with it; otherwise it takes up system resources, which in some cases make the program unresponsive. To close a FileWriter, use the close() command. Since I named my FileWriter writer, I would close it by typing &lt;strong&gt;&lt;span style="color:#ff0000;"&gt;writer.close();&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Now you should have a try block with a FileWriter declared and then closed. If you have got that done, there’s only one more thing we have to do with the FileWriter – Write the File! To achieve this, one would use the write() command. Same as the close command, except that this has a parameter – the text to be written to the file. This should be written after the line where you declared the FileWriter, but before the line where you closed the FileWriter. Putting this anywhere else will result in an error.&lt;br /&gt;&lt;br /&gt;For instance, writer.write(“I is the hax”); would print ‘I is the hax’ to the file. Now, you can also write Strings to the file. Just set the parameter to a String. writer.write(filename); would write the path of the file to the file, so that if you opened the file it would say something like “C://Documents and Settings/this.txt”.&lt;br /&gt;&lt;br /&gt;However, if you want to make it much cooler, keep reading.&lt;br /&gt;&lt;br /&gt;Remember that TextArea you placed on the frame earlier? Here’s where that comes into play. To get the text from a TextArea and put it into a string, you use the same command as you would with a TextField. If you forget what this command is, look in earlier programs where you printed the text from inside a TextField to the system console.&lt;br /&gt;&lt;br /&gt;After that, try running the program.&lt;br /&gt;&lt;br /&gt;Doesn’t work? It shouldn’t.&lt;br /&gt;&lt;br /&gt;We still need to do one more thing to get this to work. Remember the ‘try’ block we added earlier? We have to catch exceptions that the FileWriter might raise, otherwise you might get some errors. To do this, we add a catch() block at the end of the try block. Just like with if/else statements, try/catch statements use the same syntax.&lt;br /&gt;&lt;br /&gt;Compare the two:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;if(this == that){&lt;br /&gt;//do this&lt;br /&gt;} else {&lt;br /&gt;//do that&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;try{&lt;br /&gt;//try this&lt;br /&gt;} catch (){&lt;br /&gt;//catch that&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;See the similarities?&lt;br /&gt;&lt;br /&gt;In between the parentheses after catch, we state the exception that we want to check. For FileWriters, this exception is called IOException – which means Input/Output exception. Just like how you name a String or a TextField or anything else, you also give Exceptions names. The name doesn’t really matter – unless you plan on using it.&lt;br /&gt;&lt;br /&gt;So now the try statement should look like this, or something similar:&lt;br /&gt;(I named my IOException “ex”)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;try{&lt;br /&gt;FileWriter writer = new FileWriter( filename );&lt;br /&gt;writer.write(“anything you want”);&lt;br /&gt;writer.close();&lt;br /&gt;}catch (IOException ex){&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;If you compile/run the program, it should work. If not, ask me and I will come over and help you. Hope this helps!&lt;br /&gt;&lt;br /&gt;~Your one and only Lord and Master Berserkguard,&lt;br /&gt;Protector of the Alliance,&lt;br /&gt;Pwner of the n00bs&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-4023079143463735591?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/4023079143463735591/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/how-ryan-n-gets-it-done-instructions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/4023079143463735591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/4023079143463735591'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/how-ryan-n-gets-it-done-instructions.html' title='How Ryan N. gets it done: instructions for making the FileSave work!'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-681779606232335920</id><published>2009-03-25T05:02:00.000-07:00</published><updated>2009-03-25T05:08:21.036-07:00</updated><title type='text'>Wed March 25: A student-led learning session</title><content type='html'>Greetings, fellow code monkeys!&lt;br /&gt;&lt;br /&gt;Today will be the first day that a member of this class demonstrates a particular technique that he has learned in the course of creating his project. That student is Ryan N., and the programming technique he is going to demonstrate will be how to save a file from within a Java program. File creation and manipulation is an essential tool in any programming language, and it is certainly so in Java, so I will expect your full level of support and cooperation with your classmate in this process.&lt;br /&gt;&lt;br /&gt;There is an initial file to download from our account at Box.net. The name of the folder is "RyanNFileSave" and it can be found at this address:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.box.net/shared/jb0u5k2lhh"&gt;http://www.box.net/shared/jb0u5k2lhh&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Please go there now and download  this file, and save it to a folder in your Java folder. When we are finished with this lesson, you will be expected to email it to me as an attachment. You are then free to use the time remaining to work on your current projects.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-681779606232335920?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/681779606232335920/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/wed-march-25-student-led-learning.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/681779606232335920'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/681779606232335920'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/wed-march-25-student-led-learning.html' title='Wed March 25: A student-led learning session'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-6021600470834628321</id><published>2009-03-22T09:28:00.000-07:00</published><updated>2009-03-23T07:22:12.066-07:00</updated><title type='text'>Monday March 23: you talk, then you type</title><content type='html'>Greetings, fellow code monkeys!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I have been reviewing your programs, seeing what's working, helping out where there are some difficulties, and generally just getting a peek into where you are heading. I have made some very brief commendations and recommendations for each of you, which I will be sending out by email, possibly today, but more likely it will be tomorrow. They are tailored to your individual progress, to the extent that I could do so. Before we get to that however, there are two tasks that need to be taken care of first:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) You will all need to make a posting to our discussion group with a subject heading that includes your name, plus the phrase "the comments speak". In the body of this posting, you must use the comments from your program to create a two paragraph description, three complete sentences per paragraph, of what your program does. Later on, when you hand in your programs by email, I will observe how closely your discussion posts match your comments.&lt;br /&gt;&lt;br /&gt;Of course, if you have been a little &lt;ahem!&gt;remiss in commenting your program, this assignment is going to be a little more difficult for you to complete. Tell you what: I betcha if you add the comments now while you're creating this latest discussion, your 'umble instructor will be never the wiser for it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;B) When you are done with that operation, you will need to add something similar to your program. Most of your programs include a menuitem called "About"; when clicked on, it pops up a Window which has a Label. The label might already have some default text in it; replace this text with your name, todays date, the name of your program, and a two sentence description of your program, based on the Discussion posting from A) above.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Time permitting, after that you have free reign to continue developing your program :-)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-6021600470834628321?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/6021600470834628321/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/monday-march-23-you-talk-then-you-type.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/6021600470834628321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/6021600470834628321'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/monday-march-23-you-talk-then-you-type.html' title='Monday March 23: you talk, then you type'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-5198940712859065856</id><published>2009-03-19T02:41:00.000-07:00</published><updated>2009-03-19T02:52:57.430-07:00</updated><title type='text'>Thursday March 19: time to p0ny up!</title><content type='html'>Greetings, fellow code monkeys,&lt;br /&gt;&lt;br /&gt;Today you will need to do the following regarding the programs which you have been working on:&lt;br /&gt;&lt;br /&gt;A) you will need to make sure that you have adequately COMMENTED all relevant sections of it. In other words, someone else needs to be able to read your code and understand what the heck you are doing&lt;br /&gt;&lt;br /&gt;B) You need to be able to demonstrate that you actually have some kind of crude understanding of how the main parts of your program actually work. ESPECIALLY if some of these vital parts involve programming techniques not covered in this class. If you are going to "borrow" some code from elsewhere, at least be decent enought to figure out how it operates&lt;br /&gt;&lt;br /&gt;C) Along this line, I will be asking some of you if you would like to demonstrate how some relevant part of your program works...I'm not asking you to give the store away, but if you have something new to offer, something we haven't covered already, I will be looking to share it with the class as a whole.&lt;br /&gt;&lt;br /&gt;D) Sharing time will be during some of our classes next week. Be there, or be square.&lt;br /&gt;&lt;br /&gt;E) As always, I am requiring you to make a discussion post about what you have accomplished today, problems you've come across etc&lt;br /&gt;&lt;br /&gt;F) I will also need the latest version of your program. I need the .java files, not the .class files!&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-5198940712859065856?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/5198940712859065856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/thursday-march-19-time-to-p0ny-up.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/5198940712859065856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/5198940712859065856'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/thursday-march-19-time-to-p0ny-up.html' title='Thursday March 19: time to p0ny up!'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-7704164619494220865</id><published>2009-03-17T07:35:00.000-07:00</published><updated>2009-03-17T07:37:42.189-07:00</updated><title type='text'>Tuesday March 17: Keep 'em coming!</title><content type='html'>Gentelemen,&lt;br /&gt;I've begun a review of the programs sent to me thus far. The results will be out by this Thursday, which is the next time we meet. In the meantime, just keep on doing as you have been. Just be sure to both A) email me your program before the class ends  B) post a discussion about what you've done, issues you've faced, etc etc  before the class ends.&lt;br /&gt;&lt;br /&gt;cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-7704164619494220865?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/7704164619494220865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/tuesday-march-17-keep-em-coming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/7704164619494220865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/7704164619494220865'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/tuesday-march-17-keep-em-coming.html' title='Tuesday March 17: Keep &apos;em coming!'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-3749979434669240922</id><published>2009-03-16T05:14:00.000-07:00</published><updated>2009-03-16T05:25:09.937-07:00</updated><title type='text'>Monday March 16: keep on keepin' on!</title><content type='html'>Greetings after your long weekend, fellow code jockeys!&lt;br /&gt;&lt;br /&gt;Today you will continue work on the projects which you began last Wednesday, March 11. Here are a few reminders and addendums:&lt;br /&gt;&lt;br /&gt;A) If you have done any additional work on this project on your own time, you are to be commended and of course granted some extra credit :-) All you need to do is to IMMEDIATELY send me all code and other related materials by email attachment; in the subject line, just put your name and the phrase "weekend programming"&lt;br /&gt;&lt;br /&gt;B) You are free to use any code/programming techniques we have learned through this class&lt;br /&gt;&lt;br /&gt;C) If you use anything you discover or have discovered outside of this class, you need to make this clear in your email message when you send me your updated programs at the end of this class.&lt;br /&gt;&lt;br /&gt;D) You also need to be able to explain your "discoveries" to the rest of the class; believe me, there's no better way of really understanding something than to have to be able to explain it to a diverse group of people with different levels of skill and enthusiasm.&lt;br /&gt;&lt;br /&gt;E) Since this clearly involves extra work on your part, you shall be granted great big heaping helpings of extra credit for doing it successfully, and standard sized amounts for simply making the attempt.&lt;br /&gt;&lt;br /&gt;F) In this as in all other endeavors, you are free to bounce ideas off one another, ask each other questions, share resources, etc etc. The class is about you guys after all, not me; I'm just the hired help :-)&lt;br /&gt;&lt;br /&gt;Make sure to post a discussion to our group before the end of class, AND email me your updated projects. Both these items should be clearly marked with your name and todays date, which is March 16th.&lt;br /&gt;&lt;br /&gt;"its better to ask forgiveness than to beg permission"&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-3749979434669240922?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/3749979434669240922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/monday-march-16-keep-on-keepin-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3749979434669240922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3749979434669240922'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/monday-march-16-keep-on-keepin-on.html' title='Monday March 16: keep on keepin&apos; on!'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-591532356306373917</id><published>2009-03-11T04:56:00.000-07:00</published><updated>2009-03-11T09:44:47.574-07:00</updated><title type='text'>Wednesday, March 11: unleash the hounds!</title><content type='html'>Greetings, java-eeeeeeeeeeeeeinated ones!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Today we will be starting a new phase of this class, and it will involve both your own ingenuity and a time limit. You will need to create, develop and update a project of your own design, due by the end of next week March 20 -- just in time for spring. Here are the MINIMUM requirements:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) You must first of all post a discussion with your name and the working title of your new program in the subject line. The body of the post must include a two or three sentence paragraph describing what this program will do.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;B) it cannot be something you've already been developing on the side. Most of you aren't, but for those of you who are, the answer is NO. It has to be something developed specifically for this class.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C) BEFORE THE END OF EACH CLASS, YOU MUST EMAIL ME BY ATTACHMENT ALL FILES TO DO WITH YOUR PROJECT TO MY GMAIL ACCOUNT&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;D) Your project must be adequately commented at all times. The top of your program better include comments with your name, the brief description of the project mentioned in A) above &amp;amp; the date of this latest build. Other comments included must be a description of what each part of your program is good for, what its doing. If I have to ask, you didn't comment it well enough&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;E) Additionally, you should be commenting ahead of time, as a way of keeping track of stuff you WANT to develop in your program&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;F) BTw, all your programs must be application based, no applets need apply.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;G) Somewhere along the line, your program needs to make use of AT LEAST the following components:&lt;br /&gt;frames&lt;br /&gt;windows&lt;br /&gt;buttons&lt;br /&gt;textfields&lt;br /&gt;labels&lt;br /&gt;panels&lt;br /&gt;menus&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;H) Your program is obviously going to have to make use of variables (duh!) you should also be using some collection of variables, such as an array or vector&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I) At least half of the coding for your program should be outside the main program itself , IN SEPARATE CLASSES. For the love of humanity, do not make one great big huge hinkin' program that runs to 2000 lines of code -- think MODULAR!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;J) Your program should make use of at least one custom method you've created in a separate class&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;K) Your program should include at least two ways in which an end user can change how the program looks or functions&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;L) You may work together of course and trade ideas, but each of you is reponsible for producing something.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You have plenty of time and space, and these are only the minimum requirements. Feel free to add in whatever else you can develop&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;in honor of my youngest one's birthday,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-591532356306373917?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/591532356306373917/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/wednesday-march-11-unleash-hounds.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/591532356306373917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/591532356306373917'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/wednesday-march-11-unleash-hounds.html' title='Wednesday, March 11: unleash the hounds!'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-1386803418914717646</id><published>2009-03-09T19:20:00.000-07:00</published><updated>2009-03-10T06:39:27.493-07:00</updated><title type='text'>Tues March 10: now that you've done something new and posted about menus...</title><content type='html'>Now I can start with a request that was put in to "do something about timers" (For my next trick, I'm going to turn water into funk)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A timer is a way of making something happen over and over again, kind of like a loop, only you can turn it on and off at will, set how fast or slow it happens, and determine when it starts. It requires a couple of new import statements; and since you already have your "Menu" programs open, we might as well use them to do this. Here's what you need to do:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) add the two import statements at the top of your program:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;import java.util.Timer;&lt;br /&gt;import java.util.TimerTask;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;B) Declare a Timer object and two integers that will be used in controlling when this event starts and how fast it will go:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;Timer myClock;//declare Timer object&lt;br /&gt;int countDown = 5000; // delay for 5 sec.&lt;br /&gt;int howOften = 1000; // repeat every sec.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C) create the timer with his line of code...type it in just above the point where the frame shows &lt;span style="color:#ff0000;"&gt;&lt;strong&gt;up (Gumby.show() )&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;myClock = new Timer();&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;D) create another menuitem and add it to one of your menus. You can use one you've already declared, such as inky or pinky or blue&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;E) create another else if statement in your actionPerfomed method, and put in the following code, like so&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;else if (e.getSource() == inky)&lt;br /&gt;{&lt;br /&gt;myClock.scheduleAtFixedRate(new TimerTask( )&lt;br /&gt;{&lt;br /&gt;public void run( )&lt;br /&gt;{ &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;System.out.println("hello"); &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;} &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;}, countDown, howOften);&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;}//end timer stuff&lt;/span&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-1386803418914717646?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/1386803418914717646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/tues-march-10-now-that-youve-done.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1386803418914717646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1386803418914717646'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/tues-march-10-now-that-youve-done.html' title='Tues March 10: now that you&apos;ve done something new and posted about menus...'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-2285849443740671651</id><published>2009-03-08T14:12:00.001-07:00</published><updated>2009-03-09T05:19:59.697-07:00</updated><title type='text'>Monday, March 9: Menus, Do Your Own thing</title><content type='html'>OK, you should know the drill by now: I want you to use your new knowledge of menus in conjunction with what you already know to do something new. Then I want you to&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) email me your completed program, with your name and the word "menus" in the subject line&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;B) set up another discussion posting with the same label in the subject line, and explain what it was that you did&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;th-th-thats all folks!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-2285849443740671651?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/2285849443740671651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/monday-march-9-menus-do-your-own-thing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/2285849443740671651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/2285849443740671651'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/monday-march-9-menus-do-your-own-thing.html' title='Monday, March 9: Menus, Do Your Own thing'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-1211860002721160486</id><published>2009-03-08T14:11:00.002-07:00</published><updated>2009-03-09T05:05:10.539-07:00</updated><title type='text'>Monday, March 9: Menus Part four</title><content type='html'>OK, the last part of this assignment will be failry easy. What I want you to do is to add a Label to this window you've been popping up. Put some text in the label that will let me know that this is YOUR program; please be school appropriate in how you go about this. Here's how I added a label:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;right below where I declared the window, I declared the label, like so:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;Label gotAnyID;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;right below where I created the window, I added this block of code:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;gotAnyID = new Label("This label belongs to Mr. LaRue.");&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;gotAnyID.setBackground(Color.blue);&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;gotAnyID.setForeground (Color.yellow);&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;helpWindow.add(gotAnyID);&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;Cheers,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;Uncle Paulie&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-1211860002721160486?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/1211860002721160486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/monday-march-9-menus-part-four.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1211860002721160486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1211860002721160486'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/monday-march-9-menus-part-four.html' title='Monday, March 9: Menus Part four'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-546443793460094637</id><published>2009-03-08T14:11:00.001-07:00</published><updated>2009-03-09T04:40:10.749-07:00</updated><title type='text'>Monday, March 9: Menus Part three</title><content type='html'>OK, so by now you have a program that has one menubar, one menu, and one menuitem in that menu that closes the program. Now it's to time to get serious, and do the following:&lt;br /&gt;A) add a second menu&lt;br /&gt;&lt;br /&gt;B) add one menuitem to that menu&lt;br /&gt;&lt;br /&gt;C) give that item an actionlistener, and put in a new "else if" in your action performed that makes this menu item DO something. In this case, its going to open a window, which is a frame that has not border and no standard controls&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here's how we do that:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1) right below the line that &lt;strong&gt;&lt;span style="color:#ff0000;"&gt;declares&lt;/span&gt;&lt;/strong&gt; a frame&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;Frame Gumby; //declare Frame&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;declare a window&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Window helpWindow; //declare a window&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;2) right below the line that declares a menu called "myRoom" declare a menu called OMGhelp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3) You have a long list of menuitems declared: at the end of it but before the ";", add a comma then another menuitem called "about"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OK, so now you've declared everything, now its time to put that stuff in memory. Go to the line that says &lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Gumby.add(exit);&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt; and add these two lines:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4)&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;helpWindow = new Window(Gumby);//window has to be attached to a frame helpWindow.setBounds(600,200,200,200);&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;5) right below where you created the first menu, you will create the second one and add it to the menubar, like so:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;OMGhelp = new Menu("HELP"); //create a Menu&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;myHouse.add(OMGhelp);//add the second menu to the menubar&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;6) Just below that, add in the code block which will add the new menuitem called "about" to this new menu, and give it an actionlistener:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;about = new MenuItem("ABOUT"); //create a menu item&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;about.addActionListener(this);//give it a listener&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;OMGhelp.add(about); //add this menuitem to the new menu&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;7) Finally, see if you can figure out on your own how to make this menuitem cause that window to appear by adding in another "else if" to the actionPerfomed method&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-546443793460094637?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/546443793460094637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/monday-march-9-menus-part-three.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/546443793460094637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/546443793460094637'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/03/monday-march-9-menus-part-three.html' title='Monday, March 9: Menus Part three'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-1329803532839887604</id><published>2009-02-24T07:34:00.001-08:00</published><updated>2009-03-08T14:10:07.831-07:00</updated><title type='text'>March 5: Menus, part two</title><content type='html'>OK, so now you have a menubar with one menu and one menuitem on that menu. It doesn't DO anything though, now does it? That's simple enough to fix; I bet some of you already added to your action performed statement like so:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;else if (e.getSource() == quit)&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;{&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;System.exit(0);&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;}// lets quit using using the menu&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;If you haven't tried that, why don't you do so now?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you have done that, why don't you try adding the other menuitems to the menu&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-1329803532839887604?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/1329803532839887604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/march-5-menus-part-two.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1329803532839887604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1329803532839887604'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/march-5-menus-part-two.html' title='March 5: Menus, part two'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-1946563825224756209</id><published>2009-02-24T07:16:00.000-08:00</published><updated>2009-03-05T08:47:42.826-08:00</updated><title type='text'>March 5: Menus, part one</title><content type='html'>Greetings, JavaNoidz: today, we will be adding menus to your programs. As always, your ever so helpful instructor and all around good guy has set up the base level of the program for you; it can be found here:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.box.net/shared/p2gx5ecl5b"&gt;http://www.box.net/shared/p2gx5ecl5b&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;the file is named JavaMenus. Please download it and compile it and make sure it runs. Got it? K3WLLLLLLL!!!!! Let's go!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) first, let's understand some concepts. A "MenuBar" is just that: a bar that contains menus. It's like the different toolbars you can have in IE or Firefox, and they can hold many&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;"Menus". Menus have some sort of text label, such as FILE, EDIT, VIEW, so on and so forth. When you click on a Menu, you get to see a big list of&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;"MenuItems". Under FILE, you might see MenuItems such as NEW, OPEN, SAVE, PRINT, EXIT&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;B) OK, so let's start by declaring one MenuBar, one Menu and several MenuItems, like so:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;MenuBar myHouse;&lt;br /&gt;Menu myRoom;&lt;br /&gt;MenuItem inky,pinky,blue,quit;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;do so just below the line that declares your exit button:&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;Button exit; //declare button&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;C) Next, let's get into your constructor and actually create a menubar and a menu:&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;myHouse = new MenuBar(); //create a MenuBar&lt;br /&gt;myRoom = new Menu("FILE"); //create a Menu&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;do this right below where I added the "exit" button to the frame&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Gumby.add(exit);&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#000000;"&gt;D)&lt;/span&gt; &lt;span style="color:#000000;"&gt;Just below where you created&lt;/span&gt; &lt;/span&gt;&lt;span style="color:#000000;"&gt;the menubar and menu, you will create one menuitem, give it an actionListener, then add it to the menu, like so:&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;quit = new MenuItem("End the program"); //create a menu item&lt;br /&gt;quit.addActionListener(this);//give it a listener&lt;br /&gt;myRoom.add(quit); //add this menuitem to the menu&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;E) Just below that, add these two lines to add the menu to the menubar, and the menubar to the frame:&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;myHouse.add(myRoom);//add the menu to the menubar&lt;br /&gt;Gumby.setMenuBar(myHouse);//add the menubar to the frame&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;F) At this point, run the program to make sure you can see the menubar, its one menu and that menu's only menuitem. When you click on "End the program" notice that it doesn't do that. I now give you some time to figure out how to make that happen. Hint: all the code you need is sitting right in front of you.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;cheers,&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;Uncle Paulie&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-1946563825224756209?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/1946563825224756209/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/march-5-menus-part-one.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1946563825224756209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1946563825224756209'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/march-5-menus-part-one.html' title='March 5: Menus, part one'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-707468014865108041</id><published>2009-02-20T15:42:00.000-08:00</published><updated>2009-03-05T06:12:18.237-08:00</updated><title type='text'>Thurs March 5: importing custom classes, do your own thing</title><content type='html'>OK, so now we come to the part where you "do your own thing" You may make any combination of what we've learned in the past several days about creating your own classes with what you already knew from before. As always, do the following:&lt;br /&gt;&lt;br /&gt;A) send me your updated program by email, with your name and "custom classes" in the subject line&lt;br /&gt;&lt;br /&gt;B) Post a discussion on our Google group telling me what you did. Be sure to label it "custom classes"&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PS Today was the day back in 1953 that Josef Stalin died.&lt;br /&gt;&lt;br /&gt;"I am Ozymandias, king of kings....."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-707468014865108041?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/707468014865108041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/thurs-march-5-importing-custom-classes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/707468014865108041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/707468014865108041'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/thurs-march-5-importing-custom-classes.html' title='Thurs March 5: importing custom classes, do your own thing'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-3431512094015167837</id><published>2009-02-20T12:23:00.001-08:00</published><updated>2009-03-04T04:46:07.368-08:00</updated><title type='text'>Wed March 4: importing custom classes, part three</title><content type='html'>OK, so now we've made a class that creates a method we can use. Can we do the same for components? For instance, can we create a custom Panel with buttons already on it that we can stick onto any program we want.&lt;br /&gt;&lt;br /&gt;You betcha we can!&lt;br /&gt;&lt;br /&gt;Here's how we do it:&lt;br /&gt;&lt;br /&gt;A) In the same folder as your other two classes, you will create a new class. Let's call it "ButtonPanel"; it'll start off looking like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;import java.awt.*;&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;import java.awt.event.*;&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;class ButtonPanel extends Panel&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;}//end class&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;B) compile it and make sure its OK, then we'll declare three buttons in between those curly braces:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;Button a,b,c;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;C) next, we will make a constructor for this class, right below where we declared those buttons:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;ButtonPanel()&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;D) Inside the curly braces for that constructor, lets give this custom Panel a GridLayout:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;setLayout(new GridLayout(1,3));&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and then add in those three buttons we declared. Here's how you do the first one:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;a = new Button("Button A");&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;add(a);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;E) COMPILE that new ButtonPanel class, an when you get no errors, get back to your main program. Declare a new object based on the Button Panel class by entering this line:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;ButtonPanel myNewPanel;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;below this line:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;int firstNum, secondNum;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;F) Finally, create this new object inside your main program by entering these two lines:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;myNewPanel = new ButtonPanel();&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;Valhalla.add(myNewPanel);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;above this final line in your constructor:&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;Valhalla.show();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Compile, then run the program. Does the custom panel with three buttons show up in your program? Hurrah!&lt;br /&gt;&lt;br /&gt;"think good thoughts"&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-3431512094015167837?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/3431512094015167837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/wed-march-4-importing-custom-classes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3431512094015167837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3431512094015167837'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/wed-march-4-importing-custom-classes.html' title='Wed March 4: importing custom classes, part three'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-483316470825265764</id><published>2009-02-20T12:22:00.000-08:00</published><updated>2009-02-27T09:24:20.546-08:00</updated><title type='text'>Fried A Feb 27: importing custom classes, part two</title><content type='html'>OK, let's review what we just saw:&lt;br /&gt;&lt;br /&gt;1) you can create a class, and give it a method&lt;br /&gt;&lt;br /&gt;2) you can create an object in another class based on that first class&lt;br /&gt;&lt;br /&gt;3) once you've done that, then use the method from the first class to do stuff in the second class&lt;br /&gt;&lt;br /&gt;OK, so let's make this program a little more useful. Right now, all it does is print the number 6 to the screen!&lt;br /&gt;&lt;br /&gt;Here's what we do:&lt;br /&gt;&lt;br /&gt;A) right below this line&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;CalcOne myAdd; //a new object named myAdd based on CalcOne class&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;add these two lines to declare two TextFields and two ints&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;TextField numOne, numTwo;&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;int firstNum, secondNum;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;B) in the constructor, just below this line:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;myAdd = new CalcOne();//put this new object in memory&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;put both those TextFields into memory and add them to the Frame. Also, set both ints equal to zero (the number 0 that is)&lt;br /&gt;&lt;br /&gt;C) Lastly, we are going to use the Integer.parseInt method to make an int out of whatever number is typed into those textFields, then add those two ints. To do that, we are going to need to change your "else if" statement from this:&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;System.out.println(myAdd.addTwo(3,3));&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;to this&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;firstNum = Integer.parseInt(numOne.getText());&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;secondNum = Integer.parseInt(numTwo.getText());&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;System.out.println(myAdd.addTwo(firstNum,secondNum));&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This way, your new method from another class is going to use whatever integers you type into the two TextFields. Try it and see what you get!&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-483316470825265764?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/483316470825265764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/fried-feb-27-importing-custom-classes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/483316470825265764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/483316470825265764'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/fried-feb-27-importing-custom-classes.html' title='Fried A Feb 27: importing custom classes, part two'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-3062171569126493731</id><published>2009-02-20T12:21:00.000-08:00</published><updated>2009-02-27T05:50:52.790-08:00</updated><title type='text'>Fried Hay, Feb 26: importing custom classes, part one</title><content type='html'>Greetings, Java-Nation!&lt;br /&gt;&lt;br /&gt;Today, we are going to start exploring a concept that is at the very heart of JAVA: the class. Java, as they say, is class-based; everything in it is derived from a class that you create, or from a class that's been there from the beginning, one that's written into the language. Today, we are going to learn how to create two separate classes, each of which does something completely different, and then import these classes into a main program, create objects out of them, and do something with each one. So let's get going by downloading your starter program from here:&lt;br /&gt;&lt;a href="http://www.box.net/shared/inp8pt71ph"&gt;http://www.box.net/shared/inp8pt71ph&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It should be a file called "FunWithClasses" Download it to a folder named after yourself, PLUS the phrase "fun with classes". Compile it and run it just to make sure its A-OK. I'll wait right here.&lt;br /&gt;&lt;br /&gt;zzzz.......&lt;br /&gt;zzzz............&lt;br /&gt;zzz.....huh?&lt;br /&gt;Oh, you're all set; GREAT! Now let's get down to business.&lt;br /&gt;&lt;br /&gt;The first thing you will have to do is create a separate class file in TextPad by clicking File then New. Call it "CalcOne" like so:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;class CalcOne&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;}//end CalcOne&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;then save it IN THE SAME FOLDER AS YOUR MAIN PROGRAM. make sure the filename matches the class name -- duh!&lt;br /&gt;&lt;br /&gt;The next thing is to give this class something to do. Let's make it add two integers and return the result, like so:&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;int addTwo(int stuffOne, int stuffTwo)&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;return stuffOne + stuffTwo;&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;}//end int add method&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You need to put this int add method ABOVE the closing line of this new class. SAVE, COMPILE, then get back into your main program&lt;br /&gt;&lt;br /&gt;The next step is to make an object from this new class, and put this object into your program. We do it in the same way we've added other classes; let's sing along with Uncle Paulie, OK?&lt;br /&gt;&lt;br /&gt;beneath this line&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;Button exit; //declare button&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;add this line&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;CalcOne myAdd; //a new object named myAdd based on CalcOne class&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The next step is to actually put this new object into your program. Go to this line:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;Valhalla.add(exit);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and add this line&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;myAdd = new CalcOne();//put this new object in memory&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;RE-COMPILE, then run the program. Hmmmmmmm...it doesn't LOOK any different! Well that's because this class has no visible components, just one method for adding numbers. So let's add some stuff that can make use of this method:&lt;br /&gt;Below this line&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;Button exit; //declare button&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;type in this line to create a second button&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;Button AddEm; //a button to add stuff&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Just ABOVE this line:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;myAdd = new CalcOne();//put this new object in memory&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;create this new button you've just declared, give it an actionListener, add it to the Frame&lt;br /&gt;&lt;br /&gt;Now for the good stuff: you are going to add an "else if" to your actionPerformed. This else if will make use of the one method found in your new class to add two ints together. Here's what it looks like:&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;else if (e.getSource() == AddEm)&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;System.out.println(myAdd.addTwo(3,3));&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;}// lets add&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This uses the "addTwo" method from the class called "CalcOne". Since myAdd is based on that class, your new "myAdd" object can use ANY METHOD IN THAT CLASS.&lt;br /&gt;&lt;br /&gt;After that, we pass this method two integers, and print the result to the System console. Hint: you should see the number "6"&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-3062171569126493731?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/3062171569126493731/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/thurs-feb-26-importing-custom-classes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3062171569126493731'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3062171569126493731'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/thurs-feb-26-importing-custom-classes.html' title='Fried Hay, Feb 26: importing custom classes, part one'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-6729014206769841064</id><published>2009-02-19T11:08:00.002-08:00</published><updated>2009-02-26T05:03:26.229-08:00</updated><title type='text'>arrays and vectors, part four</title><content type='html'>&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:100%;"&gt;Alrighty then, I said I would explain the difference between size and capacity, so here it is:&lt;br /&gt;&lt;br /&gt;"capacity is how much room for elements there is in a Vector, while size is how many actual elements there are"&lt;br /&gt;&lt;br /&gt;It's kind of like an egg carton: you can have space for 6 or 12 or 18 eggs, but its possible that NONE of those spaces have been filled. Right now, we have an empty egg carton. SO, the next step is to FILL the carton. Here's how:&lt;br /&gt;&lt;br /&gt;A) the first step is to dcelare a button we can click and add an element to the Vector:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;Button newOne;//a button for making new vector elements&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;B) we will also need another TextField, so we can create some stuff that will go in the Vector:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;TextField newElement;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,0)"&gt;C) Next, we will need to create both this button and the TextField, and add them to the Frame. This oughta be easy for you by now, so I won't spell it out. The only thing I ask is that your TextField's initial text should read something like this:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;"type here to add to Vector"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;D) Last, add yet another "else if" to your actionPerformed, like so:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;else if (e.getSource() == newOne)&lt;/span&gt;&lt;br style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;{&lt;/span&gt;&lt;br style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;vNess.addElement(new String(newElement.getText() ) );&lt;/span&gt;&lt;br style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;//take what is typed in TextField and make it a Vector element&lt;/span&gt;&lt;br style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;}//add element to Vector&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;&lt;span style="COLOR: rgb(0,0,0)"&gt;What this does is to take whatever you type into the new TextField, and add it as an element in your Vector!!&lt;br /&gt;&lt;br /&gt;OK, re-compile, and run the program. Type some stuff into the new TextField, and use the "newOne" button to add that String to your Vector.&lt;br /&gt;&lt;br /&gt;After you've played with that, use the "howMany" button to see if the size of your Vector has increased&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold"&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-6729014206769841064?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/6729014206769841064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/arrays-and-vectors-part-four.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/6729014206769841064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/6729014206769841064'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/arrays-and-vectors-part-four.html' title='arrays and vectors, part four'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-7140137449259441565</id><published>2009-02-19T11:08:00.001-08:00</published><updated>2009-02-26T04:45:11.683-08:00</updated><title type='text'>Tues Feb 24: arrays and vectors part three</title><content type='html'>OK, now for the new stuff: we are going to create and use a &lt;span style="FONT-WEIGHT: bold; COLOR: rgb(51,102,255)"&gt;VECTOR&lt;/span&gt; (cue dramatic theme music!). A Vector is like an Array, only you can add elements to it while the program is running. You can also subtract elements, or change the value of elements, all while the program is running. It's like having an array with an elastic waistband: very stretchy, very useful. So let's add one, OK?&lt;br /&gt;&lt;br /&gt;A) the first step is to add an import statement at the very top of your program; vectors come from quite a different country than arrays:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;import java.util.*;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;B) just below where we declared our int variable, declare your Vector:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;Vector vNess;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;D) just below declared the "show" button, declare another button:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;Button howMany; //a button to see how big our Vector is&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;E) in the constructor, just below where we created that TextField, create both the button and the Vector, like so:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;howMany = new Button("how Many?");&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;howMany.addActionListener(this);&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;Area52.add( howMany);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;vNess = new Vector(3);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;F) Lastly, add another "else if" to our actionPerformed, like so:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;else if (e.getSource() == howMany)&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;System.out.println("Vector vNess has this capacity " + vNess.capacity() );&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;System.out.println("Vector vNess is this big " + vNess.size() );&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;}//size and capacity of vector?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;&lt;/span&gt;&lt;br /&gt;Re-compile the program, and run it to see if your new button works. In the next segment, I'll explain the difference between "size" and "capacity" for those of you who are struggling to get a grasp on that.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-7140137449259441565?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/7140137449259441565/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/tues-feb-24-arrays-and-vectors-part.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/7140137449259441565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/7140137449259441565'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/tues-feb-24-arrays-and-vectors-part.html' title='Tues Feb 24: arrays and vectors part three'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-1984025288336974521</id><published>2009-02-19T09:01:00.000-08:00</published><updated>2009-02-24T08:50:38.275-08:00</updated><title type='text'>Tues Feb 24: arrays and vectors, part two</title><content type='html'>OK, so now we've got "back in the saddle" with Arrays. Now it's time to combine what we just (re)learned with something we looked at just before the vacation: getting a number from a TextField, and making use of it.&lt;br /&gt;&lt;br /&gt;You may recall that there is a method called "Integer.parseInt( )" which allows you to take what looks like an integer from a TextField, and make it a real honest to GOD int. Kind of like changing Pinocchio from a puppet to a real boy. What we will do here with our program is to create a TextField, get an int value from it, assign that value to an int variable, and then use that variable to choose an element from our array. Here we go:&lt;br /&gt;&lt;br /&gt;A) just below where you set up your Array, declare a TextField and an int variable, like so:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;TextField whichOne;&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;int whichQuote;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;B) inside the constructor, just below the button we just created, create the TextField, like so:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;whichOne = new TextField("type in an integer from 0 to 2");&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;Area52.add(whichOne);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;C) in the "else if" for your "show" button, add these lines of code:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;//get number from TextField and change it to an Integer&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;whichQuote = Integer.parseInt(whichOne.getText() );&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;//pick out that element from array &amp;amp; print it to System console&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;System.out.println(quotes[whichQuote]);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Recompile, then run the program. See if you can choose which element of the array will print out to the System console!&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-1984025288336974521?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/1984025288336974521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/tues-feb-24-arrays-and-vectors-part-two.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1984025288336974521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1984025288336974521'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/tues-feb-24-arrays-and-vectors-part-two.html' title='Tues Feb 24: arrays and vectors, part two'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-3989100669925746845</id><published>2009-02-19T08:58:00.001-08:00</published><updated>2009-02-24T08:35:03.166-08:00</updated><title type='text'>Tues Feb 24: arrays and vectors, part one</title><content type='html'>In today's lesson, we are going to work with our old friend the Array --yup, they got 'em in Java too!-- and his close personal friend, the Vector. But before we go any further, let's get you a copy of the starting program we will use to explore this new concept; go to this folder and download the file inside:&lt;br /&gt;&lt;a href="http://www.box.net/shared/knh8a5evxt"&gt;http://www.box.net/shared/knh8a5evxt&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;OK, you got it? Good; let's get going!&lt;br /&gt;&lt;br /&gt;If you recall, we met the Array way back in the fall. An Array is just a collection of variables that are grouped together. In most languages, all the elements of the Array are the same type. To make it simpler, we will be using a String Array, plus a TextField, plus a Button for retrieving elements of that array and putting them into the TextField. Here's how we do it:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) First off, let's add an Array, and put some elements in it (do it under the place where declared the "exit" button):&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;String quotes[] = {"hello","hola","bonjour"};&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;B) next, let's declare a button just below that Array, so we can stuff with our new Array:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Button show;//a button for playing with arrays&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#000000;"&gt;C)&lt;/span&gt; &lt;/span&gt;&lt;span style="color:#000000;"&gt;The next step is to add that button to your frame, and give it an ActionListener. You can see how to do that from the button that's already in the program; so just add this new Button named "show" in the same way and inside the constructor.&lt;br /&gt;&lt;br /&gt;D) Lastly, you'll need to say what that new button will do with your Array. You will need to add an "else if" statement below the first "if". Here is what I made my button do:&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;else if (e.getSource() == show)&lt;/span&gt;&lt;br style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;{&lt;/span&gt;&lt;br style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;System.out.println(quotes[0]);&lt;/span&gt;&lt;br style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;}// show the quote&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Essentially, I took the zero element in the array (that would be the very first element, kimo sabe) and printed it to the System console.&lt;br /&gt;&lt;br /&gt;OK, see if you can make that happen!&lt;br /&gt;&lt;br /&gt;Uncle Paulie&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-3989100669925746845?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/3989100669925746845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/tues-feb-24-arrays-and-vectors-part-one.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3989100669925746845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3989100669925746845'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/tues-feb-24-arrays-and-vectors-part-one.html' title='Tues Feb 24: arrays and vectors, part one'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-3182495619591387095</id><published>2009-02-19T08:57:00.003-08:00</published><updated>2009-02-23T07:23:01.658-08:00</updated><title type='text'>Tues Feb 24: Panels and layouts, part four, do something unique</title><content type='html'>&lt;span style="font-size:130%;"&gt;&lt;span style="FONT-WEIGHT: bold"&gt;OK chilluns, here's the part where I ask you to show me what you can do. Combine your new found knowledge of Panels and layouts with stuff you already knew before.&lt;br /&gt;&lt;br /&gt;When you're done:&lt;/span&gt; &lt;/span&gt;&lt;span style="FONT-WEIGHT: bold"&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;A) email to me your completed program, with your name and "Panels and Layouts" in the subject line&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt; &lt;strong&gt;(if you didnt already do that yesterday)&lt;/strong&gt;&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;B) make a discussion post on our Google group detailing what you did. Remember to also label this with your name and the phrase "Panels and Layouts"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;"vegetarians...if you cook 'em right, they're delicious!"&lt;/span&gt; &lt;/span&gt;&lt;span style="FONT-WEIGHT: bold"&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Uncle Paulie&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-3182495619591387095?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/3182495619591387095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/tues-feb-24-panels-and-layouts-part.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3182495619591387095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3182495619591387095'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/tues-feb-24-panels-and-layouts-part.html' title='Tues Feb 24: Panels and layouts, part four, do something unique'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-5465467569578281910</id><published>2009-02-19T08:57:00.001-08:00</published><updated>2009-02-23T06:03:23.777-08:00</updated><title type='text'>Mon Feb 23: Panels and layouts, part three</title><content type='html'>By now, we've established two basic propositions:&lt;br /&gt;1) Panels are containers for holding other components&lt;br /&gt;2) there are layouts besides the old "flow" layout&lt;br /&gt;&lt;br /&gt;So let's explore these ideas a little longer. Another type of layout is called the "border": you have the four points of the compass -- north south east west -- as well as a region called the center. Let's add a second Panel to our frame, give it a border layout, then add some buttons to that panel to see what a border layout looks like&lt;br /&gt;&lt;br /&gt;Here's how you do it:&lt;br /&gt;&lt;br /&gt;A) declare a second Panel -- just copy it the way you already did it, and give it a different name&lt;br /&gt;&lt;br /&gt;B) declare some buttons, like so:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;Button uno, dos, tres, quattro; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;C) just below the line that dded the first Panel to the frame:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;onePanel.add(myFirstPanel); //add panel to frame&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Add a second Panel, pretty much the same way you added the first one, only DONT use a grid layout, use a border layout, like so:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;panelTwo.setLayout(new BorderLayout());&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;assuming that you named your Panel "panelTwo"; if you called it something else, then use YOUR name, m'OK?&lt;br /&gt;&lt;br /&gt;D) add the first button to the "north" part of your border, like so:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;uno = new Button("one");&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;panelTwo.add("North", uno);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and add one of the other buttons to the south border in a similar fashion; c'mon, its not THAT hard!&lt;br /&gt;&lt;br /&gt;re-compile, and see what you get. If it works, then add buttons to the other parts of your border layout.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-5465467569578281910?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/5465467569578281910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/mon-feb-23-panels-and-layouts-part.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/5465467569578281910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/5465467569578281910'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/mon-feb-23-panels-and-layouts-part.html' title='Mon Feb 23: Panels and layouts, part three'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-6519059215135193900</id><published>2009-02-19T08:54:00.001-08:00</published><updated>2009-02-23T05:52:40.700-08:00</updated><title type='text'>Mon Feb 23: Panels and layouts, part two</title><content type='html'>Alrighty then, let's add the rest of those TextFields to your Panel:&lt;br /&gt;&lt;br /&gt;right below these lines:&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;one = new TextField("hello");&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;myFirstPanel.add(one);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Add five more sets of lines just like those two which will add the other five TextFields to your Panel.&lt;br /&gt;&lt;br /&gt;Re-compile, then run the program and see what you get!&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-6519059215135193900?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/6519059215135193900/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/mon-feb-23-panels-and-layouts-part-two.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/6519059215135193900'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/6519059215135193900'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/mon-feb-23-panels-and-layouts-part-two.html' title='Mon Feb 23: Panels and layouts, part two'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-2613488083104070221</id><published>2009-02-19T08:51:00.001-08:00</published><updated>2009-02-23T05:15:07.238-08:00</updated><title type='text'>Mon Feb 23: Panels and layouts, part one</title><content type='html'>OK, to begin with, lets set up a new program that is very basic: one frame, one button, and the button can only make the program close. I have treeware handouts; aditionally, you can download this "startup" program at this address:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.box.net/shared/iia5r6npe3"&gt;http://www.box.net/shared/iia5r6npe3&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;there's only one file in this folder and its called "FebPanel.java". Download it to your Java folder now, then save it, compile it and run it, just to make sure we got the easy stuff done.&lt;br /&gt;&lt;br /&gt;You ready? OK, let's go then:&lt;br /&gt;&lt;br /&gt;the first thing you will want to do is declare your Panel, like so:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;Panel myFirstPanel;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I would put that line right below where you declared your Button&lt;br /&gt;&lt;br /&gt;just below that, you will declare six TextFields, like so:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;TextField one, two, three, four, five, six;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;OK, now its time to actually create your Panel, add one TextField to it, and then ADD THE PANEL TO THE FRAME. Here's how it gets done:&lt;br /&gt;&lt;br /&gt;A) just below this line:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;onePanel.add(exit);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;add this block of code:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;myFirstPanel = new Panel();&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;//create the panel&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;//set a background color for the Panel&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;myFirstPanel.setBackground(Color.yellow);&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;//set different layout for Panel&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;myFirstPanel.setLayout(new GridLayout(2,3));&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This creates a new Panel and gives it a yellow back color. MOST IMPORTANTLY, it gives this Panel a different layout than the rest of your frame. A grid layout lines stuff up using a well, a &lt;span style="FONT-WEIGHT: bold"&gt;GRID&lt;/span&gt;. In this case, you will eventually end up with two rows of three TextFields each.&lt;br /&gt;&lt;br /&gt;B) For now, lets just add one TextField, right below the code block you just added:&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;one = new TextField("hello"); //make a new textField&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;myFirstPanel.add(one); //add that TextField to Panel&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;C) Finally , add the Panel to the Frame by adding this line:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;onePanel.add(myFirstPanel); //add panel to frame&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;just above this line:&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold; COLOR: rgb(255,0,0)"&gt;onePanel.show();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;OK, re-compile, then run the program, and see what you get!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-2613488083104070221?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/2613488083104070221/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/mon-feb-23-panels-and-layouts-part-one.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/2613488083104070221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/2613488083104070221'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/mon-feb-23-panels-and-layouts-part-one.html' title='Mon Feb 23: Panels and layouts, part one'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-9086620962966167743</id><published>2009-02-12T09:30:00.000-08:00</published><updated>2009-02-12T10:09:39.239-08:00</updated><title type='text'>Thursday FEB 12: exploration time</title><content type='html'>OK, so now we've reached the last part before we bid each other bon voyage into the vacation. Here is all I want you to be able to do:&lt;br /&gt;&lt;br /&gt;A) apply some other techniques I've shown you from a previous class to the lessons learned yesterday and today&lt;br /&gt;&lt;br /&gt;B) send those program(s) to me by email, with the Subject line being your name and "last programs before the Feb break"&lt;br /&gt;&lt;br /&gt;C) post a discussion to our Google group discussing what you did today beyond what I showed you.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-9086620962966167743?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/9086620962966167743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/thursday-feb-12-exploration-time.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/9086620962966167743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/9086620962966167743'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/thursday-feb-12-exploration-time.html' title='Thursday FEB 12: exploration time'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-1008142413750928876</id><published>2009-02-11T07:17:00.000-08:00</published><updated>2009-02-12T05:18:52.930-08:00</updated><title type='text'>thurs feb 12, part four: actually transferring data</title><content type='html'>right below this line of code in your actionPerformed:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;else if (e.getSource() == passItOn)&lt;br /&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;add this code block:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;wide= Integer.parseInt(across.getText()); //get the text convert it to an int&lt;br /&gt;tall= Integer.parseInt(up.getText()); //get the text convert it to an int&lt;br /&gt;one.setSize(wide,tall);&lt;/span&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-1008142413750928876?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/1008142413750928876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/thurs-feb-12-part-four-actually.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1008142413750928876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1008142413750928876'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/thurs-feb-12-part-four-actually.html' title='thurs feb 12, part four: actually transferring data'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-6171706901615896825</id><published>2009-02-10T17:04:00.001-08:00</published><updated>2009-02-11T07:10:01.364-08:00</updated><title type='text'>wed Feb 11, part three: transferring data</title><content type='html'>OK, now its time to get serious: you are going to declare and add two TextFields, declare and a add another button, and declare two integer variables. In the next poisting, I'll show you how to use these tools to do stuff. Here's what you do first:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) right below this line of code:&lt;br /&gt;Button exit;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;add this block of code:&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;Button passItOn;//declare another button&lt;br /&gt;int wide, tall; //declare two variables&lt;br /&gt;TextField across, up; //declare two TextFields&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;B) in your constructor, right below the three lines where added the exit button to your frame, you are going to add the three lines to add the "PassItOn" button&lt;br /&gt;&lt;br /&gt;C) just below that, add the two lines for each Textfield (they wont need an actionListener)&lt;br /&gt;&lt;br /&gt;D) just below that, set both int variables to 0 by typing in this:&lt;br /&gt;&lt;br /&gt;wide=0;&lt;br /&gt;tall=0;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;E) add an "else if" to your actionPerformed right below the first if. This else if should make the variables wide and tall print to the black screen. See if you can finagle that on your own first.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-6171706901615896825?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/6171706901615896825/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/wed-feb-11-part-three-transferring-data.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/6171706901615896825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/6171706901615896825'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/wed-feb-11-part-three-transferring-data.html' title='wed Feb 11, part three: transferring data'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-7651185571292060109</id><published>2009-02-10T10:47:00.001-08:00</published><updated>2009-02-11T06:50:11.001-08:00</updated><title type='text'>Wed Feb 11, part two: a button that closes the program!</title><content type='html'>OK, now you've got an application with a frame that cannot close itself and doesnt do anything EVEN THOUGH it has an "actionPerformed" statement. Let's fix that, and give it a button that can shut down the program in a simple way. Here's what you need to do:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) just below the line where you declared a Frame:&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Frame one;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;add this line to declare a button&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Button exit;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#000000;"&gt;B)&lt;/span&gt;&lt;strong&gt; &lt;/strong&gt;&lt;span style="color:#000000;"&gt;add the button to the frame. &lt;strong&gt;&lt;span style="color:#000000;"&gt;&lt;em&gt;You should know&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt; the three important lines of code used to add a button to a frame by now; just make you type them in directly below this line:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;one.setLayout(new FlowLayout());&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&lt;span style="color:#000000;"&gt;C) Tell this button how to close the whole program by adding this code block to the actionPerformed method:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;if (e.getSource() == exit)&lt;br /&gt;{//add&lt;br /&gt;System.exit(0); //thats a zero in there, not an O&lt;br /&gt;}// All over, let's quit&lt;/span&gt;&lt;/strong&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Re-compile your program then run it to see if the button shuts it all down!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-7651185571292060109?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/7651185571292060109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/wed-feb-11-part-two-button-that-closes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/7651185571292060109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/7651185571292060109'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/wed-feb-11-part-two-button-that-closes.html' title='Wed Feb 11, part two: a button that closes the program!'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-668867725755212126</id><published>2009-02-10T10:31:00.001-08:00</published><updated>2009-02-11T06:37:30.321-08:00</updated><title type='text'>Wed Feb 11, part one: a whole new world, a whole new program!</title><content type='html'>OK, before we begin, lets start with making a fresh program. It will be an application GUI, so the bare bones of it will look like this (I will have treeware copies for those who need one):&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;import java.awt.*;&lt;br /&gt;import java.awt.event.*;&lt;br /&gt;&lt;br /&gt;public class FebGui implements ActionListener&lt;br /&gt;{&lt;br /&gt;Frame one;&lt;br /&gt;FebGui( )&lt;br /&gt;{&lt;br /&gt;one = new Frame();&lt;br /&gt;one.setBounds(120,149,400,450);&lt;br /&gt;one.setTitle("Wowsers");&lt;br /&gt;one.setLayout(new FlowLayout());&lt;br /&gt;one.show( );&lt;br /&gt;}//end constructor&lt;br /&gt;&lt;br /&gt;public void actionPerformed(ActionEvent e)&lt;br /&gt;{&lt;br /&gt;System.out.println("java lava!");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;static public void main(String[] args)&lt;br /&gt;{&lt;br /&gt;new FebGui(); //make a new "FebGui" object&lt;br /&gt;}//end main&lt;br /&gt;&lt;br /&gt;} //end class&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-668867725755212126?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/668867725755212126/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/wed-feb-11-part-one-whole-new-world.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/668867725755212126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/668867725755212126'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/wed-feb-11-part-one-whole-new-world.html' title='Wed Feb 11, part one: a whole new world, a whole new program!'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-524977844597724408</id><published>2009-02-09T09:48:00.001-08:00</published><updated>2009-02-10T05:03:05.585-08:00</updated><title type='text'>tues Feb 10: now show me what you can do! (part 4)</title><content type='html'>OK, now y'all have some "free exploration" time. Do something with our current program that is based on what we've learned here in the past, but haven't done with this particular program. When you are done, do these two things:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) email this program, with your name and "show and hide frames" in the subject line&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;B) make a discussion post in our Google group, labeled with your name and the phrase "now for something completely different"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-524977844597724408?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/524977844597724408/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/tues-feb-10-now-show-me-what-you-can-do.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/524977844597724408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/524977844597724408'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/tues-feb-10-now-show-me-what-you-can-do.html' title='tues Feb 10: now show me what you can do! (part 4)'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-3227573354192689225</id><published>2009-02-06T07:09:00.000-08:00</published><updated>2009-02-10T04:52:26.924-08:00</updated><title type='text'>Tues feb 10, show and hide frames part three</title><content type='html'>OK, now to make your second button do something different from the first button: we will make it hide the second frame! What you have to do is this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) add an &lt;strong&gt;&lt;span style="color:#3333ff;"&gt;if statement&lt;/span&gt;&lt;/strong&gt; to your actionPerformed method, so that the program can can distinguish between the two buttons&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;B) make it so that the second button can can HIDE the second frame&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here's all you need to do to make that happen:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;REPLACE EVERYTHING IN YOUR ACTION PERFORMED METHOD WITH THIS CODE BLOCK:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if (e.getSource( )== btn )&lt;br /&gt;{&lt;br /&gt;sayWhat = typeText.getText( );//get the text in textfield&lt;br /&gt;System.out.println(sayWhat); //pass it to console&lt;br /&gt;System.out.println("JAVA IS WAY BETTER THAN VB!");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;else if (e.getSource( )== peek )&lt;br /&gt;{&lt;br /&gt;wazzup.hide( ); //hide the second frame&lt;br /&gt;}//end if statement&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;th-th-thats all folks!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-3227573354192689225?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/3227573354192689225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/tues-feb-10-show-and-hide-frames-part_06.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3227573354192689225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3227573354192689225'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/tues-feb-10-show-and-hide-frames-part_06.html' title='Tues feb 10, show and hide frames part three'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-8396605107445975062</id><published>2009-02-05T10:30:00.000-08:00</published><updated>2009-02-10T04:43:11.075-08:00</updated><title type='text'>Tues feb 10: show and hide frames, part two</title><content type='html'>OK, now that you have two frames, how's about we do something with them? For starters, lets make it possible for a button on one frame to make another frame hide itself. Here is how you do it:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) Declare a second button by adding this line&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;Button peek;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;right below this line&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Button b;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;B) Add this second button to your first frame by adding this block of code into your constructor:&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;peek = new Button("PEEKABOO!"); //declare button&lt;br /&gt;peek.addActionListener(this); //give it some action&lt;br /&gt;f1.add(peek); //add to frame&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#330000;"&gt;C) SAVE, COMPILE THEN RUN THE PROGRAM. Both buttons should do the same thing; we will fix that in the final blog post&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#330000;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-8396605107445975062?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/8396605107445975062/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/tues-feb-10-show-and-hide-frames-part.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/8396605107445975062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/8396605107445975062'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/tues-feb-10-show-and-hide-frames-part.html' title='Tues feb 10: show and hide frames, part two'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-6873003558531061244</id><published>2009-02-05T10:26:00.000-08:00</published><updated>2009-02-10T04:32:01.234-08:00</updated><title type='text'>Tues feb 10: show and hide frames, part one</title><content type='html'>As I mentioned in another class, it is more than possible to have many more than just one frame. Today, we are going to prove the point. Here is how you do it:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) create another frame just like your first frame, only give it different location and size coordinates. Here are the steps to do that:&lt;br /&gt;&lt;br /&gt;1) declare a second frame by changing this line&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;Frame f1;&lt;/span&gt;&lt;br /&gt;to look like this&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;Frame f1, wazzup;&lt;/span&gt;&lt;br /&gt;notice that all you did was another name followed by a comma!&lt;br /&gt;&lt;br /&gt;2) give it a&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;B) save compile and run the program.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Voila! Now you have a multiple frame program!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-6873003558531061244?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/6873003558531061244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/fri-feb-6-show-and-hide-frames-part-one.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/6873003558531061244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/6873003558531061244'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/fri-feb-6-show-and-hide-frames-part-one.html' title='Tues feb 10: show and hide frames, part one'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-4447956080412323854</id><published>2009-02-05T10:25:00.000-08:00</published><updated>2009-02-06T06:57:03.507-08:00</updated><title type='text'>Friday Feb 6: step one, finish up from yesterday!</title><content type='html'>Hello one and all,&lt;br /&gt;Our first order of business is to get back on track from yesterday. I am on hand to figure out all the stuff that ain't a-workin', so that you can send them all to me by email. I also have a printout of my working copy of this program.&lt;br /&gt;&lt;br /&gt;simple, no?&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-4447956080412323854?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/4447956080412323854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/friday-feb-6-step-one-finish-up-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/4447956080412323854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/4447956080412323854'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/friday-feb-6-step-one-finish-up-from.html' title='Friday Feb 6: step one, finish up from yesterday!'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-4441072052207407524</id><published>2009-02-04T23:54:00.000-08:00</published><updated>2009-02-04T23:57:56.822-08:00</updated><title type='text'>Thurs Feb 4, Free Exploration time</title><content type='html'>OK, now we will try this once again: I want you to apply what you have learned today, and use it with other stuff I've already taught you to create something new. Whatever you create, please be sure to do the following:&lt;br /&gt;&lt;br /&gt;A) upload all your files to me by email&lt;br /&gt;&lt;br /&gt;B) post a discussion in our Google group, even if you didn't quite get it to work&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-4441072052207407524?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/4441072052207407524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/thurs-feb-4-free-exploration-time.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/4441072052207407524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/4441072052207407524'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/thurs-feb-4-free-exploration-time.html' title='Thurs Feb 4, Free Exploration time'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-5604024576871485756</id><published>2009-02-04T23:43:00.000-08:00</published><updated>2009-02-04T23:54:22.549-08:00</updated><title type='text'>Thurs Feb 5, Part Three: TextField Printing</title><content type='html'>OK, so now you've got a TextField, and you're wondering what you can do with it. Well here's one thing: you can use it to determine what gets printed to the system console. All you need is a variable and a way of getting the text from your TextField. Here is how its done:&lt;br /&gt;&lt;br /&gt;A) just above your constructor, add a String variable, like so:&lt;br /&gt;&lt;br /&gt;String sayWhat;&lt;br /&gt;&lt;br /&gt;B) just before f1.show( ), add this line to make this variable empty:&lt;br /&gt;sayWhat=""; //empty string&lt;br /&gt;&lt;br /&gt;C ) Inside your actionPerformed statement, add these two lines:&lt;br /&gt;&lt;br /&gt;sayWhat = typeText.getText( );//get the text in textfield&lt;br /&gt;System.out.println(sayWhat); //pass it to console&lt;br /&gt;&lt;br /&gt;this takes whatever you've typed into the TextField, and then passes that stuff to your String variable. This String is then sent to your system console&lt;br /&gt;&lt;br /&gt;voila!&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-5604024576871485756?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/5604024576871485756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/thurs-feb-5-textfield-printing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/5604024576871485756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/5604024576871485756'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/thurs-feb-5-textfield-printing.html' title='Thurs Feb 5, Part Three: TextField Printing'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-6977078832215322551</id><published>2009-02-04T23:34:00.000-08:00</published><updated>2009-02-04T23:42:34.452-08:00</updated><title type='text'>Thurs Feb 5,Part Two: TextFields!</title><content type='html'>OK, for our next trick, we are going to create a place where you can make words appear in your program,other than in the system console. That place is called a TextField. Here is how you add one to your program:&lt;br /&gt;&lt;br /&gt;A) add this line of code just above your constructor -- you know, that thing that's named the same as your file, but has the ( ) after it&lt;br /&gt;&lt;br /&gt;TextField typeText;&lt;br /&gt;&lt;br /&gt;B) go just above "f1.show( )" and add these two lines of code to place the TextField into your program:&lt;br /&gt;&lt;br /&gt;typeText = new TextField("hello there"); &lt;br /&gt;f1.add(typeText);&lt;br /&gt;&lt;br /&gt;Run your program,and make sure that you can get a TextField to show up in your program&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-6977078832215322551?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/6977078832215322551/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/thurs-feb-5part-two-textfields.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/6977078832215322551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/6977078832215322551'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/thurs-feb-5part-two-textfields.html' title='Thurs Feb 5,Part Two: TextFields!'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-1935180504418705102</id><published>2009-02-04T23:21:00.000-08:00</published><updated>2009-02-04T23:34:14.393-08:00</updated><title type='text'>Thurs Feb 5,Part One: Console Printing</title><content type='html'>Greetings,caffeinated codewarriors!&lt;br /&gt;&lt;br /&gt;When last we met, you were engaged in some exploration time,attempting to extend the usefulness of your first GUI application.There were varying degrees of success, so to further help this process, I have included several different techniques that you will use.Here is the first:&lt;br /&gt;&lt;br /&gt;Open up the GUI application we made yesterday -- the one with the main method. Inside your "actionPerformed" statement,add this line:&lt;br /&gt;&lt;br /&gt;System.out.println("JAVA IS WAY BETTER THAN VB!");&lt;br /&gt;&lt;br /&gt;What this should do is to have this line of text print to your system console every time you click the button in your program&lt;br /&gt;&lt;br /&gt;Try it, and then when you're ready, add other lines of text to this message by using the newline character "\n" to add new lines&lt;br /&gt;&lt;br /&gt;more is on the way,&lt;br /&gt;&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-1935180504418705102?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/1935180504418705102/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/thurs-feb-5part-one-console-printing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1935180504418705102'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1935180504418705102'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/thurs-feb-5part-one-console-printing.html' title='Thurs Feb 5,Part One: Console Printing'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-1634882432973190242</id><published>2009-02-02T10:34:00.000-08:00</published><updated>2009-02-03T10:36:31.217-08:00</updated><title type='text'>Tues Feb 3: let's see what you can do! # 3</title><content type='html'>OK, I've shown you how to make a basic JAVA gui application; now let's see what you can do with it. Combine &lt;span style="color:#ff0000;"&gt;any of the lessons I've shown you until now&lt;/span&gt; to make a JAVA application which DOES something when you press the button. I'm giving you the whole rest of the period to get it done, and of course you can colloborate with each other.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When you have something, please demonstrate it for me, then make sure to send me all your files. Also,&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;MAKE A DISCUSSION POST STATING WHAT YOU DID WITH YOUR PROGRAM&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Please make the subject header your name, plus the phrase "my program can do this". Write in the body a one or two sentence description of what your program does.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-1634882432973190242?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/1634882432973190242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/tues-feb-3-lets-see-what-you-can-do-3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1634882432973190242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/1634882432973190242'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/tues-feb-3-lets-see-what-you-can-do-3.html' title='Tues Feb 3: let&apos;s see what you can do! # 3'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-5370070890884350449</id><published>2009-02-02T10:24:00.000-08:00</published><updated>2009-02-03T10:19:52.751-08:00</updated><title type='text'>Tues Feb 3: first GUI application with a button! #2</title><content type='html'>Just like we did yesterday, we are going to add a button to our program. It seems simple enough that all we would need to do is to add this line of code&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;b = new Button("Zoinks!"); //declare button &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;f1.add(b); //add button to frame&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;just above this line of code&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;f1.show( );&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;but unfortunately its not that simple. To put any sort of compoent on an application GUI, you have to use a LAYOUT MANAGER. The simplest kind is a "Flow Layout"; this is what you would type:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;f1.setLayout(new FlowLayout());&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;and you should write inside the constructor area, preferably ABOVE where you typed in the code for adding a Button&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OK, let's put all this together, and see what we get!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;cheers,&lt;br /&gt;&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-5370070890884350449?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/5370070890884350449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/tues-feb-3-first-gui-application-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/5370070890884350449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/5370070890884350449'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/tues-feb-3-first-gui-application-with.html' title='Tues Feb 3: first GUI application with a button! #2'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-7304028139641501318</id><published>2009-02-02T09:37:00.000-08:00</published><updated>2009-02-03T09:48:26.803-08:00</updated><title type='text'>Tues Feb 3: first GUI application! #1</title><content type='html'>OK Java Koderz, as promised, today we will be working with a GUI application. This is a program which doesn't need a webpage to run inside; besides that there are several other differences:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) An applet just sort of EXISTS; to have an application, you need a "Frame". You declare a frame like this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Frame f1;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;B) applets have init methods; applications have &lt;strong&gt;constructors. &lt;/strong&gt;A constructor is easy to write: you just take your class name and stick a ( ) at the end of it. Throw in an opening and closing curly brace { and }, and you've got a constructor. It looks something like this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;FirstFrame( ) &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;C) An applet made in textPad automatically sizes itself; in an application, you need to declare the size AND the location, kind of like this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;f1.setSize(400,450); &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;f1.setLocation(120,149);&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;btw, the two lines of code above would go inside the constructor!&lt;/p&gt;&lt;p&gt;D) an applet just shows up when you view the webpage; for an application to be visible, you have to SHOW it. You can declare a frame and size it, but it still won't show until you add this line to your constructor:&lt;br /&gt;&lt;strong&gt;f1.show( );&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;E) all applications have main methods, and this one is no exception. The main method here will do only one thing: make a new object from the class you've &lt;strong&gt;declared&lt;/strong&gt; and &lt;strong&gt;constructed&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;Fear not: I will be giving you a complete code sheet, so you won't have to figure out where everything goes. Let's do this one, then move on to code where our application can actually DO something&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-7304028139641501318?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/7304028139641501318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/tues-feb-3-first-gui-application-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/7304028139641501318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/7304028139641501318'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/tues-feb-3-first-gui-application-1.html' title='Tues Feb 3: first GUI application! #1'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-117198380250633430</id><published>2009-02-01T07:18:00.000-08:00</published><updated>2009-02-02T07:33:08.496-08:00</updated><title type='text'>Mon Feb 2, part four:  one button, many random colors!</title><content type='html'>OK, here's a final lesson of the day: how do you make the button display colors other than black? Simple: use "rgb" values, three random number generators that create values from 0 to 255, and a little thing called "typecasting". Plus, we'll make use of the "new" keyword, and the Java Color class. Allow me to explain them all first, then I'll show you how to mod your program using these new techniques:&lt;br /&gt;&lt;br /&gt;A) &lt;strong&gt;rgb&lt;/strong&gt; -- this is a way of combining values for red, green and blue to make any of about 16,000,000 colors. Each value has a range from 0 to 255&lt;br /&gt;&lt;br /&gt;B) &lt;strong&gt;random numbers&lt;/strong&gt; -- making random numbers is pretty simple in Java, and pretty close to how we did it in VB; we just invoke a method called &lt;strong&gt;Math.random().&lt;/strong&gt; We also have to have a way of chopping off all that useless stuff to the right of the decimal, and an easy way of doing that is to pass it to the Java &lt;strong&gt;Math.round()&lt;/strong&gt; method. Also, we would want to multiply the result by whatever value we want to set as our highest possible number, in this case, 255.&lt;br /&gt;&lt;br /&gt;C) &lt;strong&gt;typecasting &lt;/strong&gt;-- in Java, you can convert different variable types into other compatible type by using typcasting. All you do is put the varibale type inside parantheses, like so: &lt;strong&gt;(int). &lt;/strong&gt;We need to do that in our current program because the &lt;strong&gt;random()&lt;/strong&gt; method doesn't create intgers, but that's what we need.&lt;br /&gt;&lt;br /&gt;OK, so now let's mod your app, OK? Here are the steps to do it:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;0) add this import statement at the top of your code:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;import java.awt.Color; //allows use of rgb Color values&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1) in your actionPerformed method, add these three lines:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;int r = (int)Math.round(Math.random()*255);&lt;br /&gt;int g = (int)Math.round(Math.random()*255);&lt;br /&gt;int b = (int)Math.round(Math.random()*255);&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;they&lt;strong&gt; &lt;/strong&gt;create three random integer values between 0 and 255 every time the button is pushed&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2) In your "setBackground" method, replace everything inside the parentheses with this line of code:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;new Color (r,g,b)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Essentially, you are passing those int values to a new Color object. That Color object is then passed to the setBackground method, which uses it to change the background color&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-117198380250633430?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/117198380250633430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/mon-feb-2-part-four-one-button-many.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/117198380250633430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/117198380250633430'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/mon-feb-2-part-four-one-button-many.html' title='Mon Feb 2, part four:  one button, many random colors!'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-6731200628514213117</id><published>2009-02-01T07:01:00.000-08:00</published><updated>2009-02-02T07:19:17.512-08:00</updated><title type='text'>Monday Feb 2, part three: an applet gui with a button that does something!</title><content type='html'>OK, so now maybe you're thinking: "this is cool, but how can I make my button DO something?" Well I'm glad you asked, because this is how you do it, and it all has to do with a little item called an "action listener":&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) first, you have to add another import statement at the very top of your program; it looks like this:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;import java.awt.event.*; // so you can make stuff happen&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;B) right after the public class declaration, where you see "extends Applet", you have to add this statement:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;implements ActionListener&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;this allows your program to make use of the event library&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C) to make your button able to performk an action, you have to give it access to an actionlistener. Without it, its kind of like having your cellphone on silent: you never hear it ring!&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;b.addActionListener(this);&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;D) Finally, you have to add an actionPerformed method. This is what dictates what happens when you click on that button:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;public void actionPerformed(ActionEvent e)&lt;br /&gt;{&lt;br /&gt;setBackground(Color.black);&lt;br /&gt;}&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;As you may have guessed, this button should now be able to make the background of the applet turn black. Don't worry, we will be upgrading this button's capabilities pretty soon!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;cheers,&lt;br /&gt;&lt;br /&gt;Uncle Paulie&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-6731200628514213117?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/6731200628514213117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/monday-feb-2-part-three-applet-gui-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/6731200628514213117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/6731200628514213117'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/monday-feb-2-part-three-applet-gui-with.html' title='Monday Feb 2, part three: an applet gui with a button that does something!'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-4171656714482309779</id><published>2009-02-01T06:43:00.001-08:00</published><updated>2009-02-02T07:03:37.999-08:00</updated><title type='text'>Monday Feb 2, part two: an applet gui with a button!</title><content type='html'>OK, so now we're caught up to where just gotta be... let's get down and dirty and GUI.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To make a GUI (graphical user interface, in case you were wondering) in JAVA, you need to make an import statement that brings in the Java "awt" library. "Awt" stands for "abstract windowing toolkit", and it contains all the stuff you need in order to make Java programs that look like, well, like programs.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;so here's the first step, adding the two import statements for this program:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;import java.awt.*;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;import java.applet.Applet;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;next, lets name our public class just below those two imports, then add the curly braces:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;public class OneButton extends Applet&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;}// end class&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;next, get in between those curly braces, and add an &lt;strong&gt;init method&lt;/strong&gt;. You need to use an init method in a JAVA applet to setup stuff that the rest of the program will use. Yours will add a button to your GUI:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;public void init( )&lt;br /&gt;{&lt;br /&gt;Button b = new Button("OK");&lt;br /&gt;add(b);&lt;br /&gt;}&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;OK, now you need to save the program -- remember, just copy the class name and use that for the file name. Then, compile it, and run it -- remember, it's an applet, so use Ctrl + 3&lt;/p&gt;&lt;br /&gt;&lt;p&gt;cheers,&lt;br /&gt;Uncle Paulie&lt;/p&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-4171656714482309779?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/4171656714482309779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/monday-feb-2-part-two-applet-gui-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/4171656714482309779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/4171656714482309779'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/monday-feb-2-part-two-applet-gui-with.html' title='Monday Feb 2, part two: an applet gui with a button!'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-626426932778596289</id><published>2009-02-01T06:37:00.000-08:00</published><updated>2009-02-02T06:00:19.688-08:00</updated><title type='text'>Monday Feb. 2, Part the First: finish up from last Friday!</title><content type='html'>greetings JAVAnoids!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Our first order of business is to two-fold:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) finish up the program we were working on last Friday&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;B) email to me as attachments ALL the programs you did last Friday&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Once that's done with, we will commence working on interfaces. Yep, you got it, it's time we got GUI! We will look at both the applet way of making a GUI -- since you've already got a little experience making applets now -- AND the application/main method way of doing it, which is a little bit different.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;cheers,&lt;br /&gt;Uncle Paulie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-626426932778596289?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/626426932778596289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/monday-feb-2-part-first-finish-up-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/626426932778596289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/626426932778596289'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/02/monday-feb-2-part-first-finish-up-from.html' title='Monday Feb. 2, Part the First: finish up from last Friday!'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-245844169737220168</id><published>2009-01-29T10:35:00.000-08:00</published><updated>2009-01-30T04:57:32.038-08:00</updated><title type='text'>Friday, Jan 30th , Fun with for loops: part the Second</title><content type='html'>OK, up until now, we've been working strictly with applications, and very simple ones too: no added bells or whistles. This will now change, and here are the differences:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1) we will be creating an applet, which needs a webpage, which TextPad creates for us (you'll see)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2) we will be doing some "import" statements. This means we will be bringing in some pre-defined classes from other parts of JAVA&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3) we will use those pre-defined classes to create objects&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4) we will "instantiate" those objects by naming them&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OK, let's get right to the program; here it is:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;import java.applet.*;&lt;br /&gt;&lt;br /&gt;import java.awt.Graphics;&lt;br /&gt;public class FirstFor extends Applet&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;public void paint( Graphics g )&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;for (int i=1; i  &lt; 100; i++)&lt;br /&gt;&lt;div&gt;g.drawLine( 10, 10, 250, 10 + i * 10 ); &lt;/div&gt;&lt;br /&gt;&lt;div&gt;} //end for loop&lt;/div&gt;&lt;br /&gt;&lt;div&gt;}//end paint&lt;br /&gt;}//end class FirstFor&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Save it, properly name it, then compile it&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Then, run this applet by hitting Ctrl + 3, then clicking OK&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Alrighty then, now for the explanation...&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Cheers,&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Uncle Paulie&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-245844169737220168?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/245844169737220168/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/01/friday-jan-30th-fun-with-for-loops-part_29.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/245844169737220168'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/245844169737220168'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/01/friday-jan-30th-fun-with-for-loops-part_29.html' title='Friday, Jan 30th , Fun with for loops: part the Second'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-2267665119256204626</id><published>2009-01-27T05:19:00.000-08:00</published><updated>2009-01-30T02:58:03.664-08:00</updated><title type='text'>Friday, Jan 30th , Fun with for loops: part the First</title><content type='html'>Last semester I showed you how to create a for loop in Visual Basic. It works in a pretty similar fashion in JAVA: you can use it to do the same action over and over, no matter what that action might be. Here is an example of how this works:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public class ForPrint&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;public static void main( String args[ ] )&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;for (int i=1; i &lt; 100; i++)&lt;br /&gt;&lt;div&gt;{ &lt;/div&gt;&lt;br /&gt;&lt;div&gt;System.out.println( "Hello World!" ); &lt;/div&gt;&lt;br /&gt;&lt;div&gt;} &lt;/div&gt;&lt;br /&gt;&lt;div&gt;//end for&lt;/div&gt;&lt;br /&gt;&lt;div&gt;}//end main&lt;br /&gt;}//end class ForPrint&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;You will notice that we are already starting to use a lot of "{" and "}" This can get confusing, ESPECIALLY if you simply type through a program from top to bottom. Here are two techniques that can help you with this right from the get go:&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;A) always type in your curly braces FIRST, then go back and type in the code that goes between them&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;B) If you get confused as to which "{" goes with which "}", then you can use this trick in TextPad --&gt; highlight a curly brace, then use the Ctrl + M keyboard shortcut. It will go to the other curly brace that is associated with the one you just used. If it doesn't go to the curly brace you thought it was supposed to go to, you've messed up somewhere, and you either have too many of them or too few.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Cheers,&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Uncle Paulie&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-2267665119256204626?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/2267665119256204626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/01/friday-jan-30th-fun-with-for-loops-part.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/2267665119256204626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/2267665119256204626'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/01/friday-jan-30th-fun-with-for-loops-part.html' title='Friday, Jan 30th , Fun with for loops: part the First'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-8066028112281479866</id><published>2009-01-26T18:38:00.000-08:00</published><updated>2009-01-27T06:07:14.682-08:00</updated><title type='text'>a new line on console printing</title><content type='html'>OK, so in the last application, you created a Java program that output one line of text to a screen. In this program, you learn to create multiple lines by using the newline character --&gt; "\n"&lt;br /&gt;&lt;br /&gt;The newline character forces the cursor inside the system console to go down to the next line. This can be useful if you want to display a column of number values, rather than have them all strung together on the same line.&lt;br /&gt;&lt;br /&gt;You will use the newline character in conjunction with a little device called a concatenator, which looks like a "+" sign. This concatenator can be used to glue together several different strings into one. It's also a cheap knock off way of converting a number in Java into text: anytime you have a String on either side of a concatenator, the whole thing automatically becomes a String.&lt;br /&gt;&lt;br /&gt;Anyway, here is the program:&lt;br /&gt;&lt;br /&gt;public class HelloPrime&lt;br /&gt;{&lt;br /&gt;public static void main( String args[] )&lt;br /&gt;{&lt;br /&gt;System.out.println( "1"&lt;br /&gt;+ "\n" + "2"&lt;br /&gt;+ "\n" + "3"&lt;br /&gt;+ "\n" + "5"&lt;br /&gt;+ "\n" + "7"&lt;br /&gt;+ "\n" + "11"&lt;br /&gt;+ "\n" + "13"&lt;br /&gt;+ "\n" + "17"&lt;br /&gt;);&lt;br /&gt;}&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-8066028112281479866?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/8066028112281479866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/01/new-line-on-console-printing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/8066028112281479866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/8066028112281479866'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/01/new-line-on-console-printing.html' title='a new line on console printing'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8428338415088381498.post-3861347659929418695</id><published>2009-01-23T08:53:00.000-08:00</published><updated>2009-01-27T03:42:27.935-08:00</updated><title type='text'>JAVA, day One Tuesday January 27th</title><content type='html'>Greetings, loyal code monkees!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OK, so today is a very big day in the history of this class: our first day of JAVA programming! Before we do anything, you all should probably make sure of these three things:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) &lt;strong&gt;JAVA FOLDER&lt;/strong&gt; that you have a folder somewhere on your desktop or in your My Documents folder thats named after yourself, plus the word JAVA. Please do NOT create it in the H drive. If you do, and you have problems, they become YOUR problems.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;B) &lt;strong&gt;TEXTPAD&lt;/strong&gt; Make sure that you have a shortcut to the TextPad program, and that it starts when you click on the shortcut. TextPad is the IDE (integrated Development environment) that we will be using, so its important that your copy works.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C) &lt;strong&gt;JAVA sdk&lt;/strong&gt; Make sure that TextPad is linked to JAVA properly. There are two things you have to do regarding that:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1) Make sure that when you click on the TOOLS menu item in TextPad, that you either see a submenu that says "External Tools" or you have the External Tools listed directly. These tools are as follows and I quote:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Compile Java Ctrl + 1&lt;br /&gt;&lt;br /&gt;Run Java Application Ctrl + 2&lt;br /&gt;&lt;br /&gt;Run Java Applet Ctrl + 3&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2) Make sure that these tools actually work by writing, saving, compiling and running a small sample program. Here is what you do:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;in TextPad, type in the following:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// the year’s first Java program&lt;br /&gt;&lt;br /&gt;// first name last name&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public class HelloWorld&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;public static void main( String args[] )&lt;br /&gt;{&lt;br /&gt;System.out.println( "Hello World!" );&lt;br /&gt;} //end main&lt;br /&gt;&lt;br /&gt;} //end class&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SAVE the program as a Java file in your Java folder.&lt;br /&gt;&lt;br /&gt;Make sure the file is named EXACTLY the same as the name of the public class&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Then, compile your program by hitting Ctrl + 1, or by clicking on the menu item.&lt;br /&gt;&lt;br /&gt;If this goes correctly, you will get a message "Tool completed successfully"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Also, you will notice that there is now a second file in your folder. It has a .class extension&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Then, run this program as an application by hitting Ctrl + 2 (You can always tell its an application and not an applet by the fact that it has a main method.)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If it works, then rejoice and be of good cheer. You've just taken your first step into a larger universe&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Mr. L&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8428338415088381498-3861347659929418695?l=krakatoasrevenge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://krakatoasrevenge.blogspot.com/feeds/3861347659929418695/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/01/java-day-one-tuesday-january-27th.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3861347659929418695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8428338415088381498/posts/default/3861347659929418695'/><link rel='alternate' type='text/html' href='http://krakatoasrevenge.blogspot.com/2009/01/java-day-one-tuesday-january-27th.html' title='JAVA, day One Tuesday January 27th'/><author><name>Uncle Paulie</name><uri>http://www.blogger.com/profile/06366961962380528547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_eplY-Gnu2QA/SLnW67NI6uI/AAAAAAAAAAM/M1qtsGGDIYo/S220/FarnsworthSmall.jpg'/></author><thr:total>0</thr:total></entry></feed>
