Codename One Developer Guide part 1

Page 3

Table of Contents ................................................................................................................................. xiii About This Guide .................................................................................................... xiv 1. Introduction ............................................................................................................ 1 1.1. How Does Codename One Work? ............................................................. 1 1.1.1. Why Build Servers? .......................................................................... 2 1.1.2. Versions In Codename One ............................................................. 5 1.2. History ......................................................................................................... 6 1.3. Installation ................................................................................................... 7 1.3.1. Installing Codename One In NetBeans ............................................. 7 1.3.2. Installing Codename One In Eclipse ................................................. 9 1.3.3. Installing Codename One In IntelliJ IDEA ....................................... 11 1.4. Hello World Application ............................................................................. 12 1.4.1. The Source Code Of The Hello World App ..................................... 16 1.4.2. Building & Deploying On Devices ................................................... 27 1.5. Application Lifecycle .................................................................................. 30 1.5.1. Suspend/Resume ............................................................................ 31 2. Basics: Themes, Styles, Components & Layouts ................................................ 32 2.1. What Is A Theme, What Is A Style & What Is a Component? ................... 32 2.2. Native Theme ............................................................................................ 33 2.3. Component/Container Hierarchy ............................................................... 37 2.4. Layout Managers ...................................................................................... 38 2.4.1. Constraint Based Layout Managers ................................................ 39 2.4.2. Understanding Preferred Size ......................................................... 40 2.4.3. Flow Layout ..................................................................................... 42 2.4.4. Box Layout ...................................................................................... 47 2.4.5. Border Layout ................................................................................. 51 2.4.6. Grid Layout ..................................................................................... 53 2.4.7. Table Layout ................................................................................... 57 2.4.8. Layered Layout ............................................................................... 62 2.4.9. GridBag Layout ............................................................................... 65 2.4.10. Group Layout ................................................................................ 67 2.4.11. Mig Layout .................................................................................... 71 3. Theme Basics ..................................................................................................... 73 3.1. Understanding Codename One Themes ................................................... 73 3.2. Customizing Your Theme .......................................................................... 74 3.3. Customizing The Title ............................................................................... 79

iii


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.