FileDocCategorySizeDatePackage
JWhichUI.javaAPI DocGlassfish v2 API4263Fri May 04 22:34:58 BST 2007com.sun.enterprise.tools.common.util

JWhichUI

public class JWhichUI extends JFrame implements ActionListener
author
administrator
version

Fields Summary
private JButton
searchButton
private JTextField
searchString
private JTextArea
textArea
private JScrollPane
scrollPane
private static final String
title
Constructors Summary
public JWhichUI()

  
		addButtonPanel();
		addTextPanel();

		setTitle(title);
		setSize(900, 300);

		addWindowListener(new WindowAdapter()
		{  
			public void windowClosing(WindowEvent e)
			{  
				System.exit(0);
			}
		} );

		show();
	
Methods Summary
public voidactionPerformed(java.awt.event.ActionEvent evt)

  
		Object source = evt.getSource();
	
		if(source == searchButton)
		{
			String what = searchString.getText();
			
			if(what == null || what.length() <= 0)
				return;
			
			JWhich jw = new JWhich(what);
			pr(jw.getResult());
		}
	
private voidaddButtonPanel()

		JPanel panel = new JPanel();
		searchButton = new JButton("Search");//NOI18N
		panel.add(searchButton);
		searchButton.addActionListener(this);
		Dimension d = searchButton.getPreferredSize();
		d.setSize(450, d.getHeight());
		searchString = new JTextField();
		searchString.setPreferredSize(d);
		panel.add(searchString);
		searchString.addActionListener(this);
		
		getContentPane().add(panel, "South");//NOI18N
	
private voidaddTextPanel()

		textArea	= new JTextArea(800, 50);
		scrollPane	= new JScrollPane(textArea);
		getContentPane().add(scrollPane, "Center");//NOI18N
	
public static voidmain(java.lang.String[] args)

		JWhichUI jwui = new JWhichUI();
		jwui.show();
	
public voidpr(java.lang.String s)

		//textArea.setText(textArea.getText() + s + "\n");//NOI18N
		textArea.append(s + "\n");//NOI18N