This chapter discusses graphical user interfaces (GUIs) and object-oriented design in Java. It covers basic GUI components like JFrame, JLabel, JTextField and JButton. It explains how to create windows and add components to them. It also discusses event-driven programming and handling events. Finally, it provides an overview of object-oriented design principles like identifying classes and methods from the problem statement.
27. Sample Run for TempConversion Java Programming: From Problem Analysis to Program Design, 3e
28.
29.
30. class Rectangle with Data Members and Operations Java Programming: From Problem Analysis to Program Design, 3e
31.
32.
33. Object-Oriented Design Example 2 (continued) Java Programming: From Problem Analysis to Program Design, 3e
34. Object-Oriented Design Example 2 (continued) Java Programming: From Problem Analysis to Program Design, 3e
35.
36. The class Integer Java Programming: From Problem Analysis to Program Design, 3e
37. The class Integer (continued) Java Programming: From Problem Analysis to Program Design, 3e
38. The class Integer (continued) Java Programming: From Problem Analysis to Program Design, 3e
39. The class Integer (continued) Java Programming: From Problem Analysis to Program Design, 3e Integer num; num = new Integer(86)
40. The class Integer (continued) Java Programming: From Problem Analysis to Program Design, 3e 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, 3e 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, 3e
44. The class Integer (continued) Java Programming: From Problem Analysis to Program Design, 3e