Join Todd Perkins for an in-depth discussion in this video Populate a table from an external file, part of Learning Java Applications.
- [Voiceover] So we've looked at populating a table…using a two dimensional array,…but what if we wanted to grab that data…from an external file?…So I'm here in Layout.java, and I've created…an additional text file and added it to my project.…So there it is, data.txt, it's a plain text file.…I've just added five rows and five columns.…Now if you're following along without the exercise files,…it might be easier to make three rows and three columns.…One, two, three, four, five, six, seven, eight, nine.…I made them two digit numbers so they would all be aligned…so it's easy to tell how many rows and columns that I have.…
But for the purpose of this exercise,…we want an equal amount of rows and columns.…Now you don't have to always have an equal amount…of rows and columns, but just for what we're doing right now…and how we're writing this code,…you're going to need equal rows and columns.…So back to Layout.java, and let's look…at what code is already here.…So we are reading from the allData array…for the row count and the column count…
- 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
Skill Level Beginner
1. Install Java and an IDE
2. Java Basics Review
3. Create a User Interface with Swing
4. Tables and Data Sources
5. Application Distribution and Deployment
Publish a runnable JAR file2m 32s
6. Server-Side Java: JSP and Databases
7. Android Development
Next steps1m 16s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.