[jsword-svn] bibledesktop/java/main/org/crosswire/bibledesktop/book s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Wed Feb 16 20:40:21 MST 2005


Update of /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book
In directory www.crosswire.org:/tmp/cvs-serv10130/java/main/org/crosswire/bibledesktop/book

Modified Files:
	DisplaySelectPane.java 
Log Message:
Fix for JS-9.

Index: DisplaySelectPane.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/DisplaySelectPane.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** DisplaySelectPane.java	15 Feb 2005 02:08:59 -0000	1.19
--- DisplaySelectPane.java	17 Feb 2005 03:40:19 -0000	1.20
***************
*** 8,11 ****
--- 8,13 ----
  import java.awt.SystemColor;
  import java.awt.Toolkit;
+ import java.awt.event.ActionEvent;
+ import java.awt.event.ActionListener;
  import java.awt.event.ItemEvent;
  import java.awt.event.ItemListener;
***************
*** 96,99 ****
--- 98,107 ----
              cboBible.setToolTipText(selected.toString());
          }
+         else
+         {
+             // The application has started and there are no installed bibles.
+             // So make the combo box a reasonable size.
+             cboBible.setPrototypeDisplayValue("                                                            "); //$NON-NLS-1$
+         }
          cboBible.setRenderer(new BookListCellRenderer());
          cboBible.addItemListener(new ItemListener()
***************
*** 109,112 ****
--- 117,131 ----
              }
          });
+         cboBible.addActionListener(new ActionListener()
+         {
+             public void actionPerformed(ActionEvent e)
+             {
+                 JComboBox cbo = (JComboBox)e.getSource();
+                 if (cbo.getSelectedIndex() == -1 && cbo.getItemCount() > 0)
+                 {
+                     cbo.setSelectedIndex(0);
+                 }
+             }
+         });
          JLabel lblBible = actions.createJLabel(BIBLE);
          lblBible.setLabelFor(cboBible);



More information about the jsword-svn mailing list