0

i am learning Swing in JAVA.. i've try simple label by this way

package testswing;

import java.awt.EventQueue;
public class tt {

    private JFrame frame;

    /**
     * Launch the application.
     */
    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    tt window = new tt();
                    window.frame.setVisible(true);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }

    /**
     * Create the application.
     */
    public tt() {
        initialize();
    }

    /**
     * Initialize the contents of the frame.
     */
    private void initialize() {
        frame = new JFrame();
        frame.setBounds(100, 100, 450, 300);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        JLabel Pragna = new JLabel("Lblll");
        frame.getContentPane().add(Pragna, BorderLayout.NORTH);
    }

}

i am getting this error

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
    at com.ibm.icu.text.BreakDictionary.main(BreakDictionary.java:44)
Android
  • 8,995
  • 9
  • 67
  • 108
  • 1
    I think the error you have posted has nothing to do with this program, you have accidentally run something else. It works fine for me. And besides, where would the `ArrayIndexOutOfBoundsException` come from? There is **no array** here. Try re-running the program. – JavaNewbie_M107 Sep 27 '13 at 09:22

1 Answers1

0

You are running the main method of BreakDictionary. In other words: you are running a completely different program and not the code you posted.

Matteo Gatto
  • 616
  • 11
  • 28