Sunday, July 29, 2012

The joys of Ctrl space

   I have recently found out about shortcuts in Eclipse  such as Control + space bar.  Can't remember the full name of a method? Hit control + space. It's great for filling in long names. Type main and then control space and it will give you the full static void main line. There are other shortcuts I am still exploring. I am still studying the book "Head First Java" and doing all the exercises. I have found a few errors and  flaws which I have been able to correct on my own. One was not having  the  EXIT_ON CLOSE for JFrame  in the code. Another one I added a clear checkboxes method. One error was so bad I could not figure it out and went to the publishers website and downloaded the code for the book. The code had been corrected  to make it work. A bit of a pain and frustrating  but I think I learned a bit more from it.

10,000 hour to mastery.    
10,000 - 177.5 = 9822.5 hours left  

Wednesday, July 25, 2012

Fun with JFrames

  I am really adding hours to my study time. It's much more interesting to learn about GUI and graphics then plain text. Time to play with JFrames , JPanels and widgets

   One thing you will notice is that I should have added space to the beginning and end of "Button clicked" or at least the end of it. I also have not added a title to the window.
   So we have a JFrame which make the window "frame". Then we add a JPanel to the frame. Then we add to the panel the widgets (components) like Check boxes ,Text fields, Buttons and the list goes on. In this one it has a JTextArea which you can type in with vertical scroll added and word-wrap. We also have a  button along the bottom. Fine tuning the look of the widgets is going to take a bit of practice.

  There are three basic layouts . BorderLayout ( which is the default for JFrame) it has  five areas. North, South, East, West and Center. They adjust automatically  for what is included. The second layout is FlowLayout ( which is default for JPanel) and it adds widgets left to right , top to bottom. All handled automatically. Then there is BoxLayout which just stacks top to bottom.

   As I understand it , you can add JPanels to JPanels  to rearrange the widgets and make them more presentable.  

10,000 hour to mastery.    
10,000 - 167.25 = 9832.75 hours left   

Sunday, July 22, 2012

More videos

   You have to love this guy's voice and the music in the beginning and end add a bit of professionalism to it. He does short  easy to understand  video examples for Java.

Thursday, July 19, 2012

Fun with Graphics

     I am now to the point where I am learning about graphics in Java.

  Now we are getting in to the fun part of programming, the visuals.
I have combined an image ( the trees) with an oval drawing ( top left) that randomly changes gradient colors whenever you re-size the window. Sort of looks like a UFO.

   One thing I learned from this is that the window is repainted whenever you change it. So what happens is it also calls the method for drawing the oval which changes the color each time. So something to keep in mind  if I ever need it to stay a constant color on re-sizing

Wednesday, July 18, 2012

Getting there

     It's been 152 days since I started keeping track of how many hours I have been studying  Java and Android. So far  148 hours of study with books, videos, programming and online reading. That is an average of about .974 hours per day or roughly 1 hour a day. I am happy that I have stuck with it  but also a bit down with how little I have been able to do. My goal now is to achieve an average of  1.5 hours per day. I use an kitchen  timer  set for 30 minutes. I study for 30 minutes then get up and walk a bit to get the blood flowing then reset the timer for another 30 minutes. The knowledge is starting to sink in. I catch on to what is being explained faster then I was before though most days it can be a struggle. I think that is a sign of pushing my limits as long as I am making progress.

10,000 hour to mastery.    
10,000 - 148 = 9852 hours left   

Saturday, July 14, 2012

A few  website about  programming  that you may enjoy.
(has links to good learning sites)
(Funny site about programming)
(Interesting perspective on computer science)

Wednesday, July 11, 2012

More Videos

I came across this series of videos that are short and  to the point  for explaining Java and a bit of Netbeans which is another program like Eclipse for making Java programs. The sound in the videos is not very good but you can understand it.

10,000 hour to mastery.    
10,000 - 140.75 = 9859.25 hours left  

Thursday, July 5, 2012

Clearing problems list

   I am using Eclipse SDK 3.7.2 and had a list of warnings in my problems window. I had either removed the classes that were a problem or fixed them but the problem window kept  this list and never cleared it> If I remember correctly , older versions had a red X you could click to clear it. Not finding that on this version I had to google it and for a help forum which had the answer. Basically you click on one of the problems and delete it or you select all and delete. Either way  I am not sure why the developers of Eclipse would make it a pain ( other than they want to make sure you don't delete by accident but that would not matter to much considering that once you save a file it will list all the problems there still are)

10,000 hour to mastery.    
10,000 - 132.75 = 9867.25 hours left  
(It's taking longer then I thought it would)