GUI, printing available Locales
Ok so Im trying to print out the available Locales on a machine in a text area
The lie of code output.setText(availableLocales); is giving the trouble.
Eclipse is giving out about it but Im not to sure on the problem why.
Can anyone shed some light please
Code:
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Calendar;
import java.util.Locale;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
/**
* @author B00022881 Mark Walsh
*
*/
public class localesTest extends JFrame implements ActionListener {
/**
*
*/
private static final long serialVersionUID = 1L;
JTextArea output = new JTextArea();
Locale[] availableLocales = Calendar.getAvailableLocales( );
public localesTest(){
super("Testing Available Locales");
Container c = getContentPane();
JPanel panel = new JPanel();
output.setText("Available Locales will Appear here..");
output.setEditable(false);
JButton listLocals = new JButton();
listLocals.setText("List All Locales");
listLocals.addActionListener(this);
JScrollPane outputPane = new JScrollPane(output);
panel.add(listLocals);
panel.add(outputPane);
c.add(panel);
setSize(250, 300);
setVisible(true);
setResizable(false);
}
public void actionPerformed(ActionEvent e) {
if(e.getActionCommand().equals("List All Locales")){
/**
* This Line is giving the Problems
*
*/
output.setText(availableLocales);
}
}
public static void main(String[] args) {
localesTest myLocalest = new localesTest();
myLocalest.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
Thanks in advance