Chapter 10 - Code Snippets Sample Application p. 372 Step 11. Drop in a LoginDlg component. Change the dataItemNameproperty to reference the infoSession component. Add the following line to the imports section: import oracle.dacf.control.LoginFailureException; Step 12. Add the following lines after the call to loginDlg1.setDataItemName()in jbInit(). if (loginDlg1.showDialog() == JOptionPane.CANCEL_OPTION) { throw new LoginFailureException(); } ------------------------------------------------------------------ Building a Menu - Phase II: Set the Menu Element Properties p. 379 Step 5. ...For example, look in the Source Editor for the saveMenuItem.setMnemonic(); that you just wrote and add the following lines under it: saveMenuItem.setAccelerator(KeyStroke.getKeyStroke( KeyEvent.VK_S, ActionEvent.CTRL_MASK)); ------------------------------------------------------------------- p. 382 Phase III: Write the Menu Item Code Step 6. In the Source Pane, the new event-handler method stub should look like the following: void exitEvent(ActionEvent e) { } Add the following line above this method. // Menu event handlers Step 12. Replace the blank line between the curly braces with the following line of code. masterNavBar.doClick(NavigationBar.BUTTON_COMMIT); ---------------------------------------------------------------------------- p. 383-4 Step 17. Enter the following inside the blank method stub: JOptionPane.showMessageDialog( this, aboutMessage, aboutTitle, JOptionPane.INFORMATION_MESSAGE); Step 18. Go to the end of the declaration section by locating the line JMenuItem aboutMenuItem = new JMenuItem();. Add the following right after this line. This code declares variables for the dialog box and assigns values to those variables. String productName = "Departments Browser"; String productVersion = "Version 1.0"; String productCopyright = "Copyright (c) 2001"; String[] aboutMessage = {productName, productVersion, productCopyright}; String aboutTitle = "About " + productName; -------------------------------------------------------------------- Building a Popup Menu - Phase II: Write the Menu Code p. 386-387 Step 2. ...Replace the blank line between the curly brackets with the following: formPanel.add(mainPopupMenu); if (e.getModifiers() == Event.META_MASK) mainPopupMenu.show(formPanel, e.getX(), e.getY()); Step 3. (bottom of page) ... with the following: masterNavBar.doClick(NavigationBar.BUTTON_COMMIT); ----------------------------------------------------------------- Phase III: Write the Button Code p. 395 Step 3. ... with the following: masterNavBar.doClick(NavigationBar.BUTTON_COMMIT); -----------------------------------------------------------------