lecture-9 - CPSC 324 Topics in Java Programming Lecture 9...

Info icon This preview shows pages 1–4. Sign up to view the full content.

2/12/10 1 CPSC 324 Topics in Java Programming Lecture 9 Today … Assignments Program 2 due today Program 3 Finish up Lab 1 “Anatomy” of Lab 1 Start on best practices Lab 2 CPSC 324 ‐‐ Spring 2010 2
Image of page 1

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

2/12/10 2 Take 15 minutes and finish Lab 1 CPSC 324 ‐‐ Spring 2010 3 Lab1 Class File public class HelloWorld2 extends JApplet implements ActionListener { private JButton setTextButton; private JTextField textField; private JLabel label; public void init() { Runnable r = new Runnable() { public void run() { createGUI(); } }; try { SwingUtilities.invokeAndWait(r); } catch (Exception e) { e.printStackTrace(); } } ... CPSC 324 ‐‐ Spring 2010 4 The class name The superclass An interface that we are implementing Like a superclass ... what is the difference?
Image of page 2
2/12/10 3 Lab1 Class File public class HelloWorld2 extends JApplet implements ActionListener { private JButton setTextButton; private JTextField textField; private JLabel label; public void init() { Runnable r = new Runnable() { public void run() { createGUI(); } }; try { SwingUtilities.invokeAndWait(r); } catch (Exception e) { e.printStackTrace(); } } ... CPSC 324 ‐‐ Spring 2010 5 A Java button widget A Java text field widget A Java label widget What type of variables are these? Lab1 Class File public class HelloWorld2 extends JApplet implements ActionListener { private JButton setTextButton; private JTextField textField; private JLabel label; public void init() { Runnable r = new Runnable() {
Image of page 3

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

Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern