Lecture31 - Java Programming, 3e Concepts and Techniques...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Java Programming, 3e Concepts and Techniques The Homework Projects 9-11 ICTN 2730 Lecture 31 04/07/08
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Assignments Read chapter 7 and lecture notes. Homework 10 grades are available on Blackboard. Homework 11 is due Wednesday. Week 14 bonus assignment will be posted on Blackboard by Thursday. The assignment contains 40 questions (multiple choice and true/false). It is not a programming project.
Background image of page 2
3 Homework 11 Section A: Debugging Palindrome: “a word, verse, or sentence (as “Able was I ere I saw Elba”) or a number (as 1881) that reads the same backward or forward” Sample homepage: http://150.216.57.8/~testuser One error in PalindromeApplet.html. At least five (maybe more) errors in PalindromeApplet.java Make sure you understand LoginApplet.java. All variables must be initialized before being used. E.g. id=idField.getText();
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Homework 11 Section A: Debugging Examine error messages carefully. Fix the error one by one. Add a line comment after fixing each error. You might need to add a few lines of new code. Even if the source code compiles successfully, the program might not be error free. Check whether the program runs as expected. Examine the runtime error carefully.
Background image of page 4
5 Homework 11 Section B: Converting AWT to Swing Make sure you understand homework 9 and homework 10. Change Applet to JApplet Other AWT components (Label, TextField, Button etc.) must be converted. See Table 7-4. The background color must be orange How to add components. add(idField); //when to use this? keypad.add(keys[i]); //when to use this?
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Homework 11 Section B: Converting AWT to Swing Potential problem: The background color does not show. Why? In JApplet/JFrame, components should be added to a special purpose container (e.g. content pane) or a general purpose container (e.g. JPanel), not directly to the JApplet/JFrame. Other property changes (layout manager, background color, etc.) should be applied to content pane or JPanel. How to run an applet? appletviewer PalindromeApplet.html
Background image of page 6
7 Example: Using Panel //construct the panel object keypad Panel keypad=new Panel(); //set properties keypad.setLayout(new GridLayout(4,4,10,10)); keypad.setBackground(Color.cyan); //add low level components (Button, Label etc.) to the panel for (int i=0; i<=15; i++) keypad.add(keys[i]); //add the panel to the frame
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/29/2008 for the course ICTN 2730 taught by Professor Li during the Spring '08 term at East Carolina University .

Page1 / 33

Lecture31 - Java Programming, 3e Concepts and Techniques...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online