Join Todd Perkins for an in-depth discussion in this video Using the exercise files, part of Learning Java Applications.
- [Voiceover] If you have the exercise files for this course, you can follow along with each movie. The exercise files for this course are organized by chapters. Each chapter contains the appropriate exercise files that are contained within that chapter. Each movie gets its own sub-folder in most cases. For example, in Chapter 03, there are seven different sub-folders. Each one being associated with one movie. Chapter 01 folder doesn't have any exercise files in it because there are no exercise files necessary for that chapter.
There's also the Assets folder that contains a text file. And if I highlight that, you'll see that there is just some text inside of the file. We'll use that during the course. In this course, we're actually going to be using three different IDEs. Eclipse, NetBeans, and Android Studio. Though the files are set up in the same way for each IDE, the way that you interact with them and load them in to follow along is different by the way each IDE.
So let's look at how you're going to load these files in with Eclipse to start out with. So I'm going to go to Chapter 03, and let's say we're going to follow along with the buttons movie. So I'll click on this buttons sub-folder. And inside of there are final and start folders. And these correspond to the final and start states of the exercise files for that particular movie. So as you're following along, you're actually going to be opening up the start files. The final files are there just for your convenience.
So in case you get lost during the movie, you have those as a reference. So inside of the start or final folders, you're going to see the project sub-folder. And this is the project that we want to open up in Eclipse. However, there is a little bit of a process to that. So I'll open up Eclipse, and in Eclipse I'm going to either right click inside of the Project Explorer and choose Import. Or go to File, and then Import. Now once you're in here, you're going to expand General, and then click on Existing Projects into Workspace.
Select that and click Next. And then you want to make sure that you have Select root directory selected, and then click Browse. So we'll navigate into the Exercise Files folder, Chapter 03, buttons and start. Now you can actually either click on start, or on the name of the project folder. Either one will work in the same way, so it doesn't matter. Just make sure you have start selected, and then click Open.
You should then see the name of the project in the Projects section. You can leave all of these Options unchecked, and then hit Finish. The project is then imported into your workspace. Now in Eclipse, it doesn't really matter which workspace you're using. You can use any workspace you want, just import the projects in. Right now, I'm just using a folder inside of my documents folder. So, once you have the project open, you can click the arrows to expand the different sections.
The code files are gonna be within the src folder, so you can expand that, expand the package. And then you double click the Java files to open up those and look at the code inside. So again, to load the files in, you're just going to go to File, Import, or right click and choose Import, and Import an existing project into Eclipse. Now, that being said, some of the projects have the same name, so you might get a conflict. If you see a conflict and cannot import a file because the different projects have the same name, just un-import the project in your workspace by right clicking the project and choosing Delete.
You're going to then see a popup menu that asks you if you want to delete the project contents on disk. Do not check that box unless you want to delete your project. All we're doing is just disassociating this project with my workspace. So, uncheck that box, and then click OK. And then the project's gone. Let's look at NetBeans. In NetBeans, to open a project, go to File, Open Project. From here, you can use the dropdown menu to navigate to the appropriate folder.
In this case, it'll be Chapter 06, connect_database, and then I've chosen final. So inside of that folder, you're going to see the projects that are inside of the folder. Click on the project you want to open, and then click Open Project. When you do that, the project opens up. And you'll see the files in the Project Panel. So now I'll close NetBeans. Let's look at Android Studio. To open a project in Android Studio, choose Open an existing Android Studio project.
So I'll navigate to my Desktop, Exercise Files, Chapter 07, ui, start, and then unlike Eclipse where we would just choose this folder, we're actually going to choose the name of the project, which in this case is HelloWorldAndroid. Then I'll click Choose. Then the Android Studio interface will open up, and I've loaded my project. I can see my project by clicking the project button. And there's my app folder, and the folders that are parts of my project. So I'll close Android Studio now. Even if you don't have the exercise files, you can still follow along.
We're going to create everything from scratch. With the exception of that text file that I showed at the beginning of this movie. And you don't need to copy the text that we write even, line by line. I'll show you what code to add to your text files and your other files so that you can have the same experience in following along with the course. And finally, if you ever get stuck in opening one of the files in this course, just come back to this movie, watch it again, and see how you can open up the files in a particular IDE.
- Installing Java and Eclipse
- Understanding basic Java syntax
- Handling Java errors
- Creating a UI with Swing
- Creating tables and connecting to data sources for tables
- Publishing a JAR file
- Installing NetBeans
- Creating JSP pages
- Setting up and connecting to databases
- Creating Java-based Android Studio projects