Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 G54PRG Programming Lecture 1 Amadeo Ascó Adam Moore 29 Organising Code: Packages & Archives.

Similar presentations


Presentation on theme: "1 G54PRG Programming Lecture 1 Amadeo Ascó Adam Moore 29 Organising Code: Packages & Archives."— Presentation transcript:

1 1 G54PRG Programming Lecture 1 Amadeo Ascó Adam Moore 29 Organising Code: Packages & Archives

2 2 Amadeo Ascó, Adam Moore Previously Panels & Layout Manager – Positioning Elements – Layout Managers – Using Layout Managers

3 3 Amadeo Ascó, Adam Moore Overview Packages Packages Views

4 4 Amadeo Ascó, Adam Moore Packages Projects in Java are structured in packages Packages are directories with subdirectories With.java files (development) With.class file (in.jar file) src com aaz sample0 src\com\aaz\sample0 Windows Eclipse view Java src.com.aaz.sample0 Windows view

5 5 Amadeo Ascó, Adam Moore Packages Name of package meaningful Java classes maybe grouped into "Packages Packages have hierarchical names The core class libraries are all in packages that start with java The GUI classes are in the packages and sub- packages of java.awt and java.swing

6 6 Amadeo Ascó, Adam Moore Packages Consider our Switch project – We have the project itself com.. – The class(es) to start the application would be in the base package for the project com.. – There are classes specific to generate the GUI for this project so added them into their own package, e.g. gui com...gui – Other general useful classes could be added in a general package com..util

7 7 Amadeo Ascó, Adam Moore Packages Views The application

8 8 Amadeo Ascó, Adam Moore Packages Views Eclipse Windows Explorer

9 9 Amadeo Ascó, Adam Moore Packages Views If you open the bin directory then you will get the same structure than in the src directory – bin directory for.class files – compiled files – src directory for.java files – code files


Download ppt "1 G54PRG Programming Lecture 1 Amadeo Ascó Adam Moore 29 Organising Code: Packages & Archives."

Similar presentations


Ads by Google