Java 7 for Absolute Beginners
CHAPTER 11 ■ DEBUGGING WITH ECLIPSE Figure 11-2. Eclipse Debug perspective Let's look at this screen in more detail. You can see ...
CHAPTER 11 ■ DEBUGGING WITH ECLIPSE Line breakpoints Exception breakpoints Classloading breakpoints Watchpoints Method breakpoi ...
CHAPTER 11 ■ DEBUGGING WITH ECLIPSE Let's see what happens when we run the program (Figure 11-4). Figure 11-4. Execution suspend ...
CHAPTER 11 ■ DEBUGGING WITH ECLIPSE Figure 11-5. Expanded containing class value this As you can see, the expanded this listing ...
CHAPTER 11 ■ DEBUGGING WITH ECLIPSE Stepping Into When you step into a line, you advance to the first of whatever methods may be ...
CHAPTER 11 ■ DEBUGGING WITH ECLIPSE Making a Conditional Breakpoint Another common need is to make a breakpoint conditional:, su ...
CHAPTER 11 ■ DEBUGGING WITH ECLIPSE In the text field below the checkbox, type the code for your condition. This is generally a ...
CHAPTER 11 ■ DEBUGGING WITH ECLIPSE When you let the code run (and click the GGo button in the application to get the drawing st ...
CHAPTER 11 ■ DEBUGGING WITH ECLIPSE developers are good musicians, master video game players, or both. All three pursuits requir ...
CHAPTER 11 ■ DEBUGGING WITH ECLIPSE Figure 11-10. Incorrect values in the debugger The thing that tipped me off was that the end ...
CHAPTER 11 ■ DEBUGGING WITH ECLIPSE g.drawLine(burstX, burstY, endX, endY); } } currentStep++; } The parts I added are in bold. ...
CHAPTER 11 ■ DEBUGGING WITH ECLIPSE That you need to know what to expect before you can know what's wrong. How to use those exp ...
C H A P T E R 1 2 221 Video Games By “video games,” I mean games which have very limited controls and a primary interface that i ...
CHAPTER 12 ■ VIDEO GAMES However, there's always some point in the user interface code that triggers behavior in the logic code. ...
CHAPTER 12 ■ VIDEO GAMES Figure 12-1. The TargetClick game Wondering why the spots are different sizes? We'll see why that happe ...
CHAPTER 12 ■ VIDEO GAMES import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing ...
CHAPTER 12 ■ VIDEO GAMES targetClickPanel.setPreferredSize(new Dimension(400, 200)); targetClickPanel.setBackground(Color.WHITE) ...
CHAPTER 12 ■ VIDEO GAMES // game over? (part of step 2 in a game loop) // the rest of step 2 (processing the game logic) // is i ...
CHAPTER 12 ■ VIDEO GAMES The actionPerformed method also contains the game loop. That's not obvious because there's no actual lo ...
CHAPTER 12 ■ VIDEO GAMES if (!targets[i].isDone()) { // if not done, draw it in the game area targets[i].draw(g); } else { // if ...
«
7
8
9
10
11
12
13
14
15
16
»
Free download pdf