Index: trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient/PreferencesDialog.java
===================================================================
--- trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient/PreferencesDialog.java	(revision 2185)
+++ trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient/PreferencesDialog.java	(revision 2185)
@@ -0,0 +1,130 @@
+/*
+
+ *    PreferencesDialogt.java
+ *    Copyright (C) 2001 New Zealand Digital Library Project
+
+ *
+
+ *    This program is free software; you can redistribute it and/or modify
+
+ *    it under the terms of the GNU General Public License as published by
+
+ *    the Free Software Foundation; either version 2 of the License, or
+
+ *    (at your option) any later version.
+
+ *
+
+ *    This program is distributed in the hope that it will be useful,
+
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+
+ *    GNU General Public License for more details.
+
+ *
+
+ *    You should have received a copy of the GNU General Public License
+
+ *    along with this program; if not, write to the Free Software
+
+ *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ */
+
+
+package org.nzdl.gsdl.SimpleGraphicalClient;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.util.*;
+
+
+
+public class PreferencesDialog extends JDialog implements ActionListener {
+
+private JButton okButton, cancelButton;
+private JPanel  buttonPanel, holderPanel;
+private Box contentBox;
+
+
+PreferencesDialog(Frame f, String title, boolean modal) {
+    super(f, title, modal );
+
+    contentBox = Box.createVerticalBox();
+    //  contentPanel = new JPanel();
+    //  GridLayout grid = new GridLayout(0,2,5,5);
+	  		
+    buttonPanel = new JPanel();
+
+    //editPanel.setLayout(new GridLayout(0,1,5,5));
+			
+
+    JLabel prefTitle = new JLabel("Preferences", SwingConstants.CENTER);
+    prefTitle.setAlignmentX(JLabel.CENTER_ALIGNMENT);
+    JPanel prefTitlePanel = new JPanel();
+    prefTitlePanel.add(prefTitle);
+
+    //contentBox.add();
+    // the preferences themselves ...
+
+    JCheckBox showFirstDocCheckBox = new JCheckBox("Automatically display the document contents of the first result", true); //should read initial value from preferences data structure
+    showFirstDocCheckBox.setHorizontalAlignment(SwingConstants.LEFT);
+
+    JCheckBox showAsTextCheckBox = new JCheckBox("Always display raw text (don't interpret HTML)", false); //should read initial value from preferences data structure
+    showAsTextCheckBox.setHorizontalAlignment(SwingConstants.LEFT);
+
+
+
+    // add the preferences ...
+
+    contentBox.add(prefTitlePanel);
+    contentBox.add(showFirstDocCheckBox);
+    contentBox.add(showAsTextCheckBox);
+
+    okButton = new JButton("Ok");
+    cancelButton = new JButton("Cancel");
+    okButton.setPreferredSize(new Dimension(80,20));
+    cancelButton.setPreferredSize(new Dimension(80,20));
+    okButton.addActionListener(this);
+    cancelButton.addActionListener(this);
+    buttonPanel.add( okButton );
+    buttonPanel.add( cancelButton );
+    getRootPane().setDefaultButton(okButton);
+
+    holderPanel = new JPanel();
+    holderPanel.setBorder(BorderFactory.createEmptyBorder(10,10,2,10));
+    holderPanel.setLayout( new BorderLayout());
+    holderPanel.add( contentBox, BorderLayout.NORTH);
+    holderPanel.add( buttonPanel, BorderLayout.SOUTH);
+    getContentPane().add(holderPanel);
+    //setSize(new Dimension(300,300));
+
+    pack();
+    setVisible(true);
+} //end PreferencesDialog constructor
+
+
+
+public void actionPerformed(ActionEvent e) {
+    Object source = e.getSource();
+    if (source == okButton)
+	{
+	    //System.err.println("ok button pressed!");
+
+	    dispose(); //close window
+	}
+    else
+	{
+	    if (source == cancelButton)
+		{
+		    dispose();
+		}					
+	    else
+		System.err.println("event not processed in PreferencesDialog");
+	}
+} //end actionPerformed
+
+} // end PreferencesDialog class
