我正在用 JAVA 学习 Swing .. 我已经通过这种方式尝试了简单的标签
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);
}
}
我收到这个错误
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at com.ibm.icu.text.BreakDictionary.main(BreakDictionary.java:44)