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>




Reply With Quote