This chapter discusses graphical user interfaces (GUIs) and object-oriented design in Java programming. It covers basic GUI components like JFrame, JLabel, JTextField and JButton. It explains how events and listeners work in GUI applications and provides examples of designing classes and methods for a temperature converter program and a candy machine program. The chapter summary emphasizes the key concepts like creating windows with JFrame, using labels, text fields and buttons to build the GUI, handling events with listeners, and applying object-oriented principles to problem solving.
27. Sample Run for TempConversion Java Programming: From Problem Analysis to Program Design, 5e
28.
29.
30. class Rectangle with Data Members and Operations Java Programming: From Problem Analysis to Program Design, 5e
31.
32.
33. Object-Oriented Design Example 2 (continued) Java Programming: From Problem Analysis to Program Design, 5e
34. Object-Oriented Design Example 2 (continued) Java Programming: From Problem Analysis to Program Design, 5e
35.
36. The class Integer Java Programming: From Problem Analysis to Program Design, 5e
37. The class Integer (continued) Java Programming: From Problem Analysis to Program Design, 5e
38. The class Integer (continued) Java Programming: From Problem Analysis to Program Design, 5e
39. The class Integer (continued) Java Programming: From Problem Analysis to Program Design, 5e Integer num; num = new Integer(86)
40. The class Integer (continued) Java Programming: From Problem Analysis to Program Design, 5e int x; Integer num; num = 25; For the most part, this statement is similar to the statement: num = new Integer(25); The expression: num = 25; is referred to as autoboxing of the int type
41. The class Integer (continued) Java Programming: From Problem Analysis to Program Design, 5e int x; Integer num; The statement: x = num; This statement is equivalent to the statement: x = num.intValue(); This statement is referred to as auto-unboxing of the int type
42.
43. The class Integer (continued) Java Programming: From Problem Analysis to Program Design, 5e
44. The class Integer (continued) Java Programming: From Problem Analysis to Program Design, 5e