Results 1 to 3 of 3

Thread: does this compile on your machine?

Threaded View

  1. #1

    Thread Starter
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Resolved does this compile on your machine?

    I have this simple code with what I think is no flaws, but yet it won't compile. I think it's just my compiler being gay again, but I wanted to see if you guys could compile it.

    Code:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    
    public class CurrencyConverter extends JApplet implements ActionListener
    {
    	JComboBox cbFrom;
    	JTextField txtAmount;
    	JList list;
    	String[] strCurrency = {"US Dollar", "Canadian Dollar", "Mexican Pesos", "Australain Dollar"};
    	
    	public void init()
    	{
    		Container pane = getContentPane();
    		pane.setLayout(new FlowLayout());
    		
    		JPanel row1 = new JPanel();
    		JLabel lblAmount = new JLabel();
    		txtAmount = new JTextField(10);
    		row1.add(lblAmount);
    		row1.add(txtAmount);
    		
    		JPanel row2 = new JPanel();
    		JLabel lblFrom = new JLabel("From");
    		cbFrom = new JComboBox();
    		cbFrom.add(strCurrency);
    		row2.add(lblFrom);
    		row2.add(cbFrom);
    		
    		JPanel row3 = new JPanel();
    		list = new JList("---------Results---------");
    		row3.add(list);
    		
    		pane.add(row1);
    		pane.add(row2);
    		pane.add(row3);
    		setVisible(true);
    		setContentPane(pane);
    		
    		
    	}
            public void actionPerformed(ActionEvent ae)
    	{
    	}
    }


    <Moderator added green checkmark in the first thread>
    Last edited by NoteMe; Feb 17th, 2005 at 07:25 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width