Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Exploring the Project4:33 with Ben Deitch
In this video we get acquainted with what a Java project looks like in IntelliJ IDEA.
We've just created our first project using an IDE. 0:00 Now let's dive in and see how much better programming can be with the right tools. 0:04 But first, we've got the tip of the day. 0:09 You can turn this off by unchecking this box, but for 0:12 now, let's leave them on and just hit close. 0:16 Here we are in IntelliJ IDEA. 0:20 On the left is the Project pane, and on the right is where we write our code. 0:23 Let's start with the Project pane. 0:28 This area shows us all the files that make up our project. 0:30 If we drill into MyFirstProject, 0:34 we can see that our project is made up of on .idea folder, 0:37 an src folder, and on MyFirstProject.iml file. 0:42 The .idea folder and the MyFirstProject.iml file are just 0:47 setting for IntelliJ, leaving us with just the src folder. 0:52 Which stands for source and is where we keep our source code. 0:56 Inside this folder, we have two more folders, com and teamtreehouse. 1:01 But since the only thing in the com folder is the teamtreehouse folder, 1:08 it gets shortened to just com.teamtreehouse. 1:13 And inside the treehouse folder, We finally have our main.java file. 1:16 Though, since most of our files will be Java files, 1:21 it doesn't show the .java part in the Project pane. 1:24 To help remember all of that, let's look at it one more time in the File Explorer. 1:28 Let's right click on the top level my first project folder and 1:33 pick the option to open it in the File Explorer. 1:37 For me, it's Reveal in Finder, and here we can see all our project files. 1:40 Though the .idea folder is hidden by default since it starts with a period. 1:49 Digging in to our source folder, we can see that we do indeed have a com folder, 1:54 a teamtreehouse folder and a Main.java file, awesome. 2:00 Now that we know what files make up our project and 2:06 where those files are stored, let's get back to IntelliJ and start coding. 2:09 On the right side of the screen, let's delete the comment, 2:14 and then try printing the words, java is awesome, 2:18 using the print line function from System.out. 2:22 Let's delete the comment, and then start typing the word System with a capital S. 2:26 And notice that it's trying to guess what you're typing, 2:34 this is called code completion and it is awesome. 2:37 You can use the arrow keys to move up and down this list. 2:42 All you need to do is hit Enter on the right one. 2:47 So once you've got System highlighted, hit Enter to select it. 2:50 Then type a dot and an o and select out. 2:54 And for print line, add another dot, 3:00 and then you can either type it out or just type pl. 3:03 That's right, if you've got something that's more than one word, you can just 3:07 type the first letter of each word, and IntelliJ will figure out the rest. 3:12 So let's hit Enter, and it even adds the semicolon. 3:17 All we need to do is add our message as an argument. 3:21 So let's type, Java is awesome, end quotes and 3:25 then to run the program, click the Play button up here. 3:29 And at the bottom we'll see our message, Java is awesome. 3:38 This section at the bottom is the Run window. 3:43 It's where we'll see any output of our program. 3:46 You can hide and show the Run window by clicking this 3:50 button down here, or hitting Cmd or Ctrl+4, 3:54 You can also hit Cmd or Ctrl+1 to hide the Project pane. 4:02 Also you can toggle having all these buttons around the outside, 4:10 by clicking right here. 4:14 So if for some reason you're missing the project button, 4:20 just click down here to get it back, nice. 4:23 In the next video, we'll get more comfortable with IntelliJ by 4:27 adding a class and learning about packages. 4:30
You need to sign up for Treehouse in order to download course files.Sign up