114-13-gui-programming - GUI programming Graphical user interface-based programming Windchill Windchill There are several formulas for calculating the

114-13-gui-programming - GUI programming Graphical user...

This preview shows page 1 - 20 out of 51 pages.

GUI programming Graphical user interface-based programming
Image of page 1
Windchill • Windchill – There are several formulas for calculating the windchill temperature t wc – The one provided by U.S. National Weather Service and is applicable for a windspeed greater than four miles per hour – Where • Variable t is the Fahrenheit temperature • Variable v is the windspeed in miles per hour
Image of page 2
Console-based programming
Image of page 3
In use
Image of page 4
GUI-based programming
Image of page 5
Java support • JFrame – Represents a titled, bordered window • JLabel – Represents a display area suitable for one or both of a single-line text or image. • JTextField – Represents an editable single-line text entry component • JButton – Represents a push button • JTextArea – Represents an editable multiline text entry component
Image of page 6
Instance variables private JFrame window – References the window containing the other components of the GUI
Image of page 7
Instance variables private JTextArea legendArea – References the text display for the multiline program legend
Image of page 8
Instance variables private JLabel fahrTag – References the label for the data entry area supplying the temperature
Image of page 9
Instance variables private JTextField fahrText – References the data area supplying the temperature
Image of page 10
Instance variables private JLabel windTag – References the label for the data entry area supplying the windspeed
Image of page 11
Instance variables private JTextField windText – References the data area supplying the windspeed
Image of page 12
Instance variables private JLabel chillTag – References the label for the data area giving the windchill
Image of page 13
Instance variables private JTextField chillText – References the data area giving the windchill
Image of page 14
Class constants private static final String LEGEND = "This windchill calculator" + "is intended for velocities greater than 4 mph.“ – Program legend text
Image of page 15
Class constants private static final int WINDOW_WIDTH = 350 – Initial width of the GUI
Image of page 16
Class constants private static final int WINDOW_HEIGHT = 185 – Initial height of the GUI
Image of page 17
Class constants private static final int AREA_WIDTH = 40 – Width of the program legend in characters
Image of page 18
Class constants private static final int FIELD_WIDTH = 40 – Number of characters per data entry area
Image of page 19
Image of page 20

You've reached the end of your free preview.

Want to read all 51 pages?

  • Fall '09
  • Design pattern, Wind chill

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes