sd2054 software development. by the end of this lecture you should be able to: advanced graphics...

120
SD2054 Software Development

Upload: horace-walker

Post on 18-Jan-2016

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

SD2054

Software Development

Page 2: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes
Page 3: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

By the end of this lecture you should be able to:

Advanced Graphics Programming

• create pull down menus

• create combo boxes

• create option dialogues

• create message dialogues

• create input dialogues

• create confirm dialogues.

Page 4: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

import javax.swing.*;

Page 5: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

Making choices

pull-down menus

combo boxes

Page 6: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

Pull-down menus

Page 7: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

Pull-down menus

Page 8: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

Pull-down menus

Page 9: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

Pull-down menus

Page 10: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

Pull-down menus

Page 11: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

Pull-down menus

Page 12: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

Pull-down menus

JFrame

Page 13: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

JFrame

public class Flag extends JFrame implements ActionListener{

}

Page 14: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

Declare menu components as attributes of the Flag class

Page 15: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes
Page 16: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

JMenuBar

Page 17: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

private JMenuBar bar = new JMenuBar();

JMenuBar

Page 18: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes
Page 19: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

JMenu

Page 20: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

JMenu

private JMenu topStripeMenu = new JMenu("Top Colour");

Page 21: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

JMenu

Page 22: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

JMenu

private JMenu middleStripeMenu = new JMenu(“Middle Colour");

Page 23: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

JMenu

Page 24: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

JMenu

private JMenu bottomStripeMenu = new JMenu(“Bottom Colour");

Page 25: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes
Page 26: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

JMenuItem

Page 27: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

JMenuItem

private JMenuItem blueStripe = new JMenuItem("Blue");

Page 28: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

JMenuItem

Page 29: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

JMenuItem

private JMenuItem redStripe = new JMenuItem(“Red");

Page 30: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

Assemble menu components onto the screen in the Constructor

Page 31: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

public Flag( ){

setVisible(true);}

Page 32: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

First, add menu-items …..

Page 33: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

… to menu

Page 34: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

blueStripe

Page 35: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

topStripeMenu

blueStripe

Page 36: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

topStripeMenu.add(blueStripe);

topStripeMenu

blueStripe

Page 37: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

topStripeMenu

redStripe

Page 38: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

topStripeMenu

redStripe

topStripeMenu.add(redStripe);

Page 39: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

Then, add menu …..

Page 40: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

… to menu-bar

Page 41: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

bar

Page 42: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

topStripeMenu

bar

Page 43: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

topStripeMenu

bar

bar.add(topStripeMenu);

Page 44: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

Finally, add menu-bar …..

Page 45: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

…. to frame

Page 46: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

bar

Page 47: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

bar

setJMenuBar(bar);

Page 48: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

Processing menu choices…..

Page 49: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

..first, give each menu item a listener in the constructor.

Page 50: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

blueStripe

Page 51: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

blueStripe

blueStripe.addActionListener(this);

Page 52: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

..then write the code to process a menu item in the actionPerformed method.

Page 53: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

blueStripe

public void actionPerformed(ActionEvent e){

}

Page 54: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

blueStripe

public void actionPerformed(ActionEvent e){

}

if (e.getSource() == blueStripe){ // code to process menu choice here }

Page 55: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

JPanel

public void actionPerformed(ActionEvent e){

}

if (e.getSource() == blueStripe){ // code to process menu choice here }

Page 56: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

topPanel

public void actionPerformed(ActionEvent e){

}

if (e.getSource() == blueStripe){ // code to process menu choice here }

Page 57: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

topPanel

public void actionPerformed(ActionEvent e){

}

if (e.getSource() == blueStripe){ topPanel.setBackground(Color.blue); }

Page 58: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

public void actionPerformed(ActionEvent e){

}

if (e.getSource() == blueStripe){ topPanel.setBackground(Color.blue); }

Page 59: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

The JComboBox class

Page 60: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

The JComboBox class

Page 61: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

private String[ ] colours = {"Select colour","Red", "Blue", "Green"};

private JComboBox box = new JComboBox(colours);

Page 62: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

box.addActionListener(this);

Page 63: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

String item = box.getSelectedItem();

Page 64: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

String item = box.getSelectedItem();

Page 65: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

String item = (String) box.getSelectedItem();

Page 66: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

String item = (String) box.getSelectedItem();

Page 67: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

if (item.equals("Red")) { getContentPane().setBackground(Color.red); }

Page 68: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

if (item.equals("Red")) { getContentPane().setBackground(Color.red); }

Page 69: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

box.setSelectedIndex(0);

Page 70: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

box.setSelectedIndex(0);

Page 71: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

The JOption Class

• creating option dialogues

• creating message dialogues

• creating input dialogues

• creating confirm dialogues.

Page 72: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

The JOptionPane dialogue class

Page 73: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

The JOptionPane dialogue class

Option Dialogue

Page 74: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes
Page 75: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes
Page 76: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes
Page 77: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes
Page 78: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

String[ ] choice = {"Enter a word", "Find the secret", "Quit"};

Page 79: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

String[ ] choice = {"Enter a word", "Find the secret", "Quit"};

Page 80: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

result = JOptionPane.showOptionDialog (null, "Choose an option", "Magic Words",

JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, choice, "Enter a word");

Page 81: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

result = JOptionPane.showOptionDialog (null, "Choose an option", "Magic Words",

JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, choice, "Enter a word");

Page 82: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

result = JOptionPane.showOptionDialog (null, "Choose an option", "Magic Words",

JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, choice, "Enter a word");

indicates no parent

frame

Page 83: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

result = JOptionPane.showOptionDialog (null, "Choose an option", "Magic Words",

JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, choice, "Enter a word");

Could use the this keyword if

there is a parent frame.

Page 84: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

result = JOptionPane.showOptionDialog (null, "Choose an option", "Magic Words",

JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, choice, "Enter a word");

Page 85: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

result = JOptionPane.showOptionDialog (null, "Choose an option", "Magic Words",

JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, choice, "Enter a word");

Page 86: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

result = JOptionPane.showOptionDialog (null, "Choose an option", "Magic Words",

JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, choice, "Enter a word");

Page 87: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

result = JOptionPane.showOptionDialog (null, "Choose an option", "Magic Words",

JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, choice, "Enter a word");

Page 88: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

result = JOptionPane.showOptionDialog (null, "Choose an option", "Magic Words",

JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, choice, "Enter a word");

Page 89: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

result = JOptionPane.showOptionDialog (null, "Choose an option", "Magic Words",

JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, choice, "Enter a word");

or an icon of your choice

Page 90: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

result = JOptionPane.showOptionDialog (null, "Choose an option", "Magic Words",

JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, choice, "Enter a word");

Page 91: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

result = JOptionPane.showOptionDialog (null, "Choose an option", "Magic Words",

JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, choice, "Enter a word");

Page 92: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

result = JOptionPane.showOptionDialog (null, "Choose an option", "Magic Words",

JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, choice, "Enter a word");

Page 93: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

result = JOptionPane.showOptionDialog (null, "Choose an option", "Magic Words",

JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, choice, "Enter a word");

0 = button 11 = button 22 = button 3

Page 94: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

The JOptionPane dialogue class

Page 95: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

The JOptionPane dialogue class

Input Dialogue

Page 96: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes
Page 97: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

word = JOptionPane.showInputDialog (null,

"Enter a word", null, JOptionPane.PLAIN_MESSAGE);

Page 98: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

word = JOptionPane.showInputDialog (null,

"Enter a word", null, JOptionPane.PLAIN_MESSAGE);

Page 99: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

word = JOptionPane.showInputDialog (null,

"Enter a word", null, JOptionPane.PLAIN_MESSAGE);

Page 100: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

word = JOptionPane.showInputDialog (null,

"Enter a word", null, JOptionPane.PLAIN_MESSAGE);

Page 101: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

word = JOptionPane.showInputDialog (null,

"Enter a word", null, JOptionPane.PLAIN_MESSAGE);

Page 102: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

word = JOptionPane.showInputDialog (null,

"Enter a word", null, JOptionPane.PLAIN_MESSAGE);

Page 103: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

The JOptionPane dialogue class

Page 104: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

The JOptionPane dialogue class

Message Dialogue

Page 105: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes
Page 106: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

JOptionPane.showMessageDialog (null, “You did not enter a magic word”,

null, JOptionPane.INFORMATION_MESSAGE);

Page 107: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

JOptionPane.showMessageDialog (null, “You did not enter a magic word”,

null, JOptionPane.INFORMATION_MESSAGE);

Page 108: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

JOptionPane.showMessageDialog (null, “You did not enter a magic word”,

null, JOptionPane.INFORMATION_MESSAGE);

Page 109: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

JOptionPane.showMessageDialog (null, “You did not enter a word”, null,

JOptionPane.INFORMATION_MESSAGE);

Page 110: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

JOptionPane.showMessageDialog (null, “You did not enter a word”, null,

JOptionPane.INFORMATION_MESSAGE);

Page 111: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

JOptionPane.showMessageDialog (null, “You did not enter a word”, null,

JOptionPane.ERROR_MESSAGE);

Page 112: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

The JOptionPane dialogue class

Page 113: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

The JOptionPane dialogue class

Confirm Dialogue

Page 114: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

answer = JOptionPane.showConfirmDialog (null, "Are you sure you want to know the secret?", null, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);

Page 115: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

answer = JOptionPane.showConfirmDialog (null, "Are you sure you want to know the secret?", null, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);

Page 116: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

answer = JOptionPane.showConfirmDialog (null, "Are you sure you want to know the secret?", null, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);

Page 117: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

answer = JOptionPane.showConfirmDialog (null, "Are you sure you want to know the secret?", null, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);

Page 118: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

answer = JOptionPane.showConfirmDialog (null, "Are you sure you want to know the secret?", null, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);

Page 119: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes

if(answer == JOptionPane.YES_OPTION){

// process choice here

}

Page 120: SD2054 Software Development. By the end of this lecture you should be able to: Advanced Graphics Programming create pull down menus create combo boxes