Java Programming: Access Privileges, Final Instance Fields, and Swing Components, Slides of Java Programming

An overview of access privileges in java, focusing on public and private access modifiers. It also covers the concepts of final fields and immutable classes. Additionally, it introduces the swing components in java, explaining how to build a user interface from the bottom up.

Typology: Slides

2011/2012

Uploaded on 07/07/2012

proo
proo 🇮🇳

4.4

(26)

96 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Programming
Swings
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Java Programming: Access Privileges, Final Instance Fields, and Swing Components and more Slides Java Programming in PDF only on Docsity!

Programming

Swings

Access Privileges

  • Public
  • Private
    • A method can access the private data of all objects of its class.
  • Example

class Box{ private int L,W,H; public void test(Box b){ b.H=10; } }

Java Swings

  • A group of 14 packages to do with the UI
  • 451 classes as at 1.4 (!)
  • Part of JFC Java Foundation Classes (compare now defunct MFC)

Build from bottom up

  • Create:
    • Frame
    • Panel
    • Components
    • Listeners
  • Add: (bottom up)
    • listeners into components
    • components into panel
    • panel into frame

JPanel

JButton

Listener

JFrame

JLabel