Docstoc

Graphical user interfaces (PowerPoint)

Document Sample
Graphical user interfaces (PowerPoint) Powered By Docstoc
					IB103 week 7 Graphical user
interfaces 2 Layout
Chapter 17 of Bell & Parr
Some GUI already used in text
   scrollbars, labels, textfields, buttons
  Selection: Checkbox, Choice
  New Ones:
  textboxes, canvasses, panels, layout
  managers
For each GUI component:
  The implements class
  Declaration and initialization
  Registration
  The event handling
  See Demo program in chapter for various GUI
  (checkboxes, checkbox groups)
  Note method …public void
  itemStateChanged(ItemEvent e) {
Consider the program user
  Text areas: text in a window that has
  scrollbars left/right and up/down as
  needed
  Canvasses – See program CanvasDemo
  Panels
  Layout Managers Flow layout managers
TextArea
 TextArea textArea = new TextArea(5, 25);
 textArea.setText("place your message here");
 add(textArea);
….
t.setText("This is part of a message ");
t.append("and this is the rest of it.");
String theText = t.getText();
BorderLayout
public void init() {
setLayout(new BorderLayout());
add("South", new
  Scrollbar(Scrollbar.HORIZONTAL));
add("East", new
  Scrollbar(Scrollbar.VERTICAL));
}
4. Case Study (Continued)
 Use a TextArea as the text message (sms)
 editor in your mobile phone, and simulate the
 function that is the sending of a text
 message.
 Task 4.1 Produce a text messaging function
 interface for the mobile, using atext area for
 editing/creating the message and include a
 text field for the contact name (or number) a
 button for 'send'. Use border layout to
 improve its appearance.

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:2
posted:11/29/2011
language:English
pages:7