Java 7 for Absolute Beginners
CHAPTER 6 ■ OBJECT-ORIENTED PROGRAMMING The Herbivore interface is parallel to the Carnivore and Scavenger interfaces, but herbi ...
CHAPTER 6 ■ OBJECT-ORIENTED PROGRAMMING as predator or herbivore). Making multiple classes and interfaces greatly aids debugging ...
CHAPTER 6 ■ OBJECT-ORIENTED PROGRAMMING When you pass a primitive to a method, the JVM preserves the original value and makes a ...
CHAPTER 6 ■ OBJECT-ORIENTED PROGRAMMING such an object, and how much memory and processing time gets chewed up trying to make a ...
C H A P T E R 7 111 Writing a User Interface Most of the people who want to develop software get into it to write programs that ...
CHAPTER 7 ■ WRITING A USER INTERFACE code in this book is not optimized for speed, by the way. I just show you the basics. To te ...
CHAPTER 7 ■ WRITING A USER INTERFACE Figure 7-1. Simple SwingDemo application All this program does is create and display an emp ...
CHAPTER 7 ■ WRITING A USER INTERFACE Swing includes the concept of .a “layout.” A layout. is an object that defines the relation ...
CHAPTER 7 ■ WRITING A USER INTERFACE menuBar.add(file); frame.setJMenuBar(menuBar); } private void createAndShowGUI() { frame.se ...
CHAPTER 7 ■ WRITING A USER INTERFACE That listing shows why some people complain that Swing is verbose. We added a lot of code j ...
CHAPTER 7 ■ WRITING A USER INTERFACE Listing 7-3. A more complex Swing program package com.apress.java7forabsolutebeginners.exam ...
CHAPTER 7 ■ WRITING A USER INTERFACE panel.add(sayButton); frame.add(panel); } private void createAndShowGUI() { frame.setDefaul ...
CHAPTER 7 ■ WRITING A USER INTERFACE Getting big, isn't it? Actually, no. It's a much bigger program than most of what we've don ...
CHAPTER 7 ■ WRITING A USER INTERFACE Table 7-1. MineSweeper classes Class Name Description MineSweeper The program class. It con ...
CHAPTER 7 ■ WRITING A USER INTERFACE Figure 7-4. The MineSweeper program Listing 7-4. The MineSweeper class package com.apress.j ...
CHAPTER 7 ■ WRITING A USER INTERFACE import javax.swing.JRadioButtonMenuItem; import javax.swing.border.Border; public class Min ...
CHAPTER 7 ■ WRITING A USER INTERFACE private void addAndArrangePanels(JFrame frame) { Border paddingBorder = BorderFactory.creat ...
CHAPTER 7 ■ WRITING A USER INTERFACE private void createAndShowGUI() { frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); fra ...
CHAPTER 7 ■ WRITING A USER INTERFACE decision that you'll often face as you develop your programs. In this case, both my editor ...
CHAPTER 7 ■ WRITING A USER INTERFACE After the constructor and the init method are done setting up the game, the main method pas ...
«
2
3
4
5
6
7
8
9
10
11
»
Free download pdf