Elizabeth Sugar Boese

Computer Science

Colorado State University

Book Preface


This book is a gentle introduction to the art of programming, focusing on giving you the tools to create sophisticated programs fast. It assumes you have never programmed before, and explains the necessary concepts to get up and running but avoids the drudgery of understanding all the minute details going on behind the scenes. It is intended to motivate and excite you to the fun of programming. Everything is based on graphics and specifically applets, which enable you to put all of your work up on the Internet. And the last chapter explains how and where to put your applets on the Internet.

There has been a nation-wide trend of dis-interest in computer science. This book excites students by having them create very cool and impressive programs, giving them the tools to create whatever they envision. The concentration is on getting them to succeed with interesting examples, and not dwell on nitty gritty details that tend to frustrate new programmers and lead to their dis-interest.

Outstanding Features

Pedagogical Features

The book includes lots of examples in every chapter and exercises at the end of each chapter. Examples are shown with graphical display of the output. There are also boxed pointers for nuances and important reminders throughout the book.


Code examples in the book are available for download from the Internet. A supplemental workbook will be finished by the author by mid-March 2006. The workbook will contain the slides with fill-in-the-blanks for the student to fill in during lecture, and lab exercises that walk the student through full programs and additional ideas for expanding on the lab program and/or other lab ideas. PowerPoint slides will also be available by mid-March 2006 but should only be accessible by instructors. Quiz/Test question set will be available for instructors, as well as a WebCT quiz bank available by mid-April. A simplified API will also become available by summer for students to easily look up methods available for each class.

I will also be a very available author, as I have become a strong supporter of authors such as John Lewis "Java Software Solutions" partly because he is nice and responsive in emails. This is such a relief as an instructor compared to other authors I have tried to deal with in the past.


This book is intended for introductory programming courses and works well for non-majors and/or middle/high-school students, and also ideal for CIS/MIS information systems courses.


I have used half the material in Spring 2005 and 90% of the material Fall 2005 and 100% in Spring 2006 in my intro to programming course for non-majors (computer science department). Will be using it again this Spring 2006 semester as well.

It was very successful; the students commented on their excitement of being able to do such cool programs when they are not even computer science majors (history, education, natural resources, etc). Most students taking the majors course (no graphics) were very jealous. The students raved how they emailed their friends and families the link to their semester projects available on the Internet. We've also had many students convert to computer science or our ACT degree in the computer science department, or pick up computer science as a minor. Examples of programs students did last semester include a "Where's Waldo", "Stephanie's Closet" where the user can rotate through her clothes to see how outfits can be matched (including a slideshow), a word-search, Jeopardy and an audio mixer. These applets are available over the Internet at the site: http://www.cs.colostate.edu/~cs150/home.html


Chapter 1 introduces the programming process. This begins with explaining why programming is important, even if your major is not computer science. Describes the different languages: machine, assembly, high-level and how the source code compiles to bytecode and interpreter translates to machine code before executing. Introduces the fundamental structure of the Java applet code. Steps through creating the first applet based on a Linux machine (using pico).

Chapter 2 explains drawing shapes and text on the applet. Introduces the coordinate system, how to draw lines, rectangles, ovals, arcs and write text with different fonts on the applet. Also explains how to change colors while drawing/writing.

Chapter 3 discusses some basics of variables and how to segment the code in to methods. Explains basics of variables: declaration and initialization, assignment, reference, and scope. Explains the structure of the method, and three reasons for using methods including examples.

Chapter 4 discusses the use and manipulation of images, an essential media in applets. Discusses the differences between .jpg, .gif and .png. Explores how to minimize file size.

Chapter 5 introduces form widgets such as labels, buttons, lists and text boxes. Includes basic HTML that can be used inside these widgets. Explains how to add images to these widgets.

Chapter 6 discusses the different layout managers to display the widgets. Presents a way to structure a program with methods based on a BorderLayout format, with methods for each region.

Chapter 7 talks about design, including how to layout an applet on paper designating all the panels and layout managers before attempting to program it.

Chapter 8 explores the tabbed pane and how to extend the JPanel class to create custom components (including custom fonts).

Chapter 9 revists variables in more detail and mathematical operations. Explains instance variables. Shows how to convert between text and numbers.

Chapter 10 discusses the if and if-else conditional statements.

Chapter 11 introduces events and method stubs.

Chapter 12 explores how to pop up a new frame and discusses some common methods

that can be used on widgets.

Chapter 13 explains loops.

Chapter 14 explores some problem solving techniques as well as GUI design.

Chapter 15 covers arrays and tables.

Chapter 16 discusses enhancements with borders and tooltips.

Chapter 17 explains audio.

Chapter 18 details how to display web pages inside the applet with JEditorPane.

Chapter 19 explains threads and timers for slideshows and animation.

Chapter 20 contains some nifty tricks such as background images on panels, flipping through tabs in a JTabbedPane via buttons, and buttons with state.

Chapter 21 introduces the concept of game programming, based on simple sprites.

Chapter 22 concludes with a discussion about Java and comparing it to other languages, what object-oriented is, how to host applets on the Internet, and some additional third-party libraries that could be integrated into the programming environment to extend the capabilities of development.


I graduated with a Bachelor's degree in Computer Science from Penn State University in 1995. I then worked as a consultant for almost 2 years, before spending 7 months travelling around the world. Fell in love with New Zealand so I found a job as a Systems Analyst (glorified programmer) for just over 2.5 years before jetting off to be a ski/snowboard instructor for the season in Fernie. Upon returning to the United States, I began teaching at DTC (now DeVry) in Denver and at Colorado State University while I worked on my Master's degree. Finished a master's in computer science last Spring 2005 and now continuing to work towards a Ph.D.

I have been teaching at CSU as a full-time faculty member since January of 2002. We first introduced this course in Fall of 2003 and I have taught it each semester and half of one summer session. I also teach two other courses each semester, usually in the introductory range in computer science.

© E.S.Boese. All rights reserved.