CS 106A Lecture Notes - Lecture 25: Keyboard Shortcut, Mnemonic, Init
Document Summary
Announcements: assignment 7 can have late days used on it, however, the second late day only extends until sunday morning at. Recall: guis: setup differences extends program instead of graphicsprogram init instead of run add buttons to specific directions instead of entire screen addactionlisteners() instead of addmouselisteners() actionperformed instead of mouseevent/ mouseclicked. Icon: a picture that can appear inside a component, public class imageicon. Public imageicon (string filename) / (url address: then seticon. Mnemonics: mnemonic: a context-sensitive menu hotkey assigned to a specific button or other graphical component. Jtextfield: takes in any text as input, intfield and doublefield only accepts ints and doubles, jspinner has up and down buttons that increase/ decrease the value. To do something when the enter button is pressed, use textfield. setactioncommand( command string ) and textfield. addactionlistener(this) To distinguish between button clicking and text field entering, use event. getsource() method.