// set up global window
frame.getContentPane().setLayout(new GridLayout(2,1));
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//frame.pack(); // an automatic setSize
frame.setSize(600,200);
//top panel additions
JPanel topPanel = new JPanel();
frame.getContentPane().add(topPanel);
//and now do the image and title
//and set up image
ImageIcon icon = new ImageIcon("duke.gif");
// and a label to put it in ...
// string, icon and position. string can contain HTML
JLabel imageLabel = new JLabel(
"<html><font color =red size =6 >Temperature Converter V1.0</font>"+
"<p><font color=black size =3 >Nairn Kennedy 2002</font></html>",
icon,JLabel.RIGHT); // set up image on label
topPanel.add(imageLabel);
JPanel bottomPanel = new JPanel();
frame.getContentPane().add(bottomPanel);
//bottom panel created
bottomPanel.setLayout(new GridLayout(1,3));
bottomPanel.add(numberWindow);//defined globally
ImageIcon fish = new ImageIcon("fishy01.gif");
JButton centButton = new JButton("To Centigrade",fish);
ImageIcon duck = new ImageIcon("duck01.gif");
JButton fahrButton = new JButton("To Fahrenheit",duck);
centButton.addActionListener(this);//set up listener. this is this object
fahrButton.addActionListener(this);// another listener
bottomPanel.add(fahrButton);
bottomPanel.add(centButton);
frame.setVisible(true);