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 Java. It also provides examples of identifying objects, classes and members from problem statements and designing classes with appropriate data and methods. The chapter summary emphasizes the key concepts of building a GUI with components, handling events, and applying object-oriented principles to problem solving.
27. Sample Run for TempConversion Java Programming: From Problem Analysis to Program Design, 4e
28.
29.
30. class Rectangle with Data Members and Operations Java Programming: From Problem Analysis to Program Design, 4e
31.
32.
33. Object-Oriented Design Example 2 (continued) Java Programming: From Problem Analysis to Program Design, 4e
34. Object-Oriented Design Example 2 (continued) Java Programming: From Problem Analysis to Program Design, 4e
35.
36. The class Integer Java Programming: From Problem Analysis to Program Design, 4e
37. The class Integer (continued) Java Programming: From Problem Analysis to Program Design, 4e
38. The class Integer (continued) Java Programming: From Problem Analysis to Program Design, 4e
39. The class Integer (continued) Java Programming: From Problem Analysis to Program Design, 4e Integer num; num = new Integer(86)
40. The class Integer (continued) Java Programming: From Problem Analysis to Program Design, 4e 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, 4e 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, 4e
44. The class Integer (continued) Java Programming: From Problem Analysis to Program Design, 4e