/// <summary> /// Sets up the GUI. /// </summary> private void setupGUI() { __fileJList = new JList(); __fileJList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); __fileJList.addListSelectionListener(this); __fileJList.setToolTipText("<HTML>To view an output file, select a file and press " + "View/Edit.<br>Notepad will be used to view the file.</HTML>"); // REVISIT - SAM 2003-10-26 if a better help system is enabled. //__helpJButton = new JButton(__BUTTON_HELP); //__helpJButton.setEnabled(false); __closeJButton = new JButton(__BUTTON_CLOSE); __viewEditJButton = new JButton(__BUTTON_VIEW_EDIT); __viewEditJButton.setToolTipText("<HTML>Use Notepad to view/edit the selected file.</HTML>"); GridBagLayout gb = new GridBagLayout(); JPanel mainPanel = new JPanel(); mainPanel.setLayout(gb); FlowLayout fl = new FlowLayout(FlowLayout.CENTER); JPanel final_panel = new JPanel(); final_panel.setLayout(fl); Font orig = __fileJList.getFont(); Font @fixed = null; if (orig != null) { @fixed = new Font("Courier", orig.getStyle(), orig.getSize()); } else { @fixed = new Font("Courier", Font.PLAIN, 11); } __fileJList.setFont(@fixed); __fileJList.addMouseListener(this); JGUIUtil.addComponent(mainPanel, new JScrollPane(__fileJList), 0, 0, 10, 12, 1, 1, GridBagConstraints.BOTH, GridBagConstraints.CENTER); // add contents to the list box fillFileJListContents(); final_panel.add(__viewEditJButton); __viewEditJButton.addActionListener(this); __viewEditJButton.setEnabled(false); // Change state when something // is selected. //final_panel.add(__helpJButton); //__helpJButton.addActionListener(this); final_panel.add(__closeJButton); __closeJButton.addActionListener(this); JGUIUtil.addComponent(mainPanel, final_panel, 0, 12, 10, 5, 0, 0, GridBagConstraints.NONE, GridBagConstraints.SOUTH); getContentPane().add("Center", mainPanel); pack(); setSize(700, 300); JGUIUtil.center(this); setVisible(true); }