Download presentation
Presentation is loading. Please wait.
Published byBritton Walker Modified over 8 years ago
1
Programming – Lecture 15 Going Beyond the ACM Library
2
The ACM Library So far, we have used the ACM library to write our programs. Most of our programs were instances of one of these classes: 2 ConsoleProgram DialogProgram GraphicsProgram Text-based Graphics-based
3
Alternatives 3 ConsoleProgram DialogProgram GraphicsProgram
4
Alternatives: Text-Based public class HelloWorld { public static void main (String[] args) { System.out.println("Hello World!"); } 4 Simple Java programs are text-based by default. Remember lecture 2:
5
Class Definition 5 ACM: public class Wubbel extends ConsoleProgram { //... } Java: No restrictions. Every class can have a main method.
6
Program Entry Point 6 ACM: public void run() { //... } Java: public static void main(String[] args) { //... }
7
Console Output 7 ACM: println(...); Java: System.out.println(...);
8
Console Input 8 ACM: String s = readLine(); int i = readInt(); Java: Scanner scanner = new Scanner( System.in); String s = scanner.next(); int i = scanner.nextInt();
9
Alternatives 9 ConsoleProgram DialogProgram GraphicsProgram
10
Java AWT 10 This is the original Java GUI library. Very outdated. You shouldn’t use this one.
11
Java Swing 11 The second Java GUI library. Quite flexible and different visual styles available. Can still be used, but has been superseded. Web resource: Creating a GUI With JFC/Swing
12
JavaFX 12 The current Java GUI library. Themeable, support for animations. This is a good choice for your applications. Web resource: Java Client Technologies
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.