IB Computer Science Unit 1
IB Computer Science Unit 2
IB Computer Science Unit 3
IB Computer Science Unit 4
IB Computer Science Unit 5
IB Computer Science Unit 6

IB Computer Science Introduction to Java

IB Computer Science Learning Goals

In this IB Computer Science lesson you will be learning about:

  • Installing Java
  • Using an Integrated Development Environment

Installing Java

In this course you will learn to write computer programs. A computer program must be written in a programming language. I have decided to use the Java Programming Language in this course. Java programs are written in a development environment.

We will be using the Netbeans development environment.
You will need to install the following software on your computer.

STEP #1 – INSTALL THE LATEST VERSION OF THE JAVA DEVELOPMENT KIT

IB-Computer-Science-Intro Image (1)

STEP #2 – INSTALL THE LATEST VERSION OF NETBEANS
(ONLY DO THIS AFTER INSTALLING THE JAVA DEVELOPMENT KIT IF YOU WANT TO MAKE YOUR LIFE EASIER)

  •  https://netbeans.org/downloads/
  • Pick whatever installation you wish but the first one is all you need for the course
  • Choose all default options when installing
    Example Screen of what you might see
IB-Computer-Science-Intro Image (2)

Organizing Your Java Programs

You should create a folder on your computer to save all your programs / projects.

  • Create 1 project and then create individual .java files for each program I ask you write this year
    • Will work well for
    • Simple 1 file programs with text output
    • Simple 1 file GUI’s that require no external resources (image or text files)
    • When submitting work to the dropbox you can simply find the .java file on your computer and just upload that single file. (A GUI will create a .form file as well, feel free to hand that in as well)
    • You need to make sure to hand in the .java file NOT the .class file.
    • The .java file contains what you wrote, so I need to mark that, the .class file is just the byte code. I don’t need that as I will just recompile and test your code on my computer.

Don’t worry if this sounds complicated, it will make a lot more sense when we start writing some computer programs, and the course material will teach you how to do all of this.

Creating Java Programs with Netbeans

Create a New Project

IB-Computer-Science-Intro Image (3)

Select Java Application

IB-Computer-Science-Intro Image (4)

Name Your Project, navigate to the correct file folder where you want everything to be saved, Unclick Create Main Class

IB-Computer-Science-Intro Image (5)

Your Screen Should look something like this

IB-Computer-Science-Intro Image (9)

To create java programs, right click on source packages. There are generally two types of files we will be using. A Java Class and a JFrame Form. A JFrame Form will make it easier to write Graphical Interfaces (GUI’s), but most of the time you will just use a regular Java Class

IB-Computer-Science-Intro Image (6)

If you choose “Java Class” it will open up a blank program and you can start writing code

IB-Computer-Science-Intro Image (7)

If you choose “JFrame Form” it will open up a blank GUI designer form

IB-Computer-Science-Intro Image (8)

You can create as many java programs as you want all under one project

IB-Computer-Science-Intro Image (10)

To execute an individual program just right click on the .java file and click run file

IB-Computer-Science-Intro Image (11)

Looking to Learn More about Computer Science and Coding?

Check out our programing in python courses that focus on high school level coding.  

  • Grade 11 Computer Science ICS3U
  • Grade 12 Computer Science ICS4U

These courses are complete with interactive coding lessons, teacher led videos, and more practice questions with complete solutions

Return To International Baccalaureate Computer Science Main Page