import java.awt.*;
import javax.swing.*;
public class Example1 {
public static void main(String[] argv)
{
var jFrame=new JFrame("Example1");
jFrame.setSize(500,300);
JButton[] jButtons=new JButton[5];
jButtons[0].setText("Up");
jButtons[1].setText("Left");
jButtons[2].setText("Center");
jButtons[3].setText("Right");
jButtons[4].setText("Down");
jFrame.add(jButtons[0],BorderLayout.NORTH);
jFrame.add(jButtons[1],BorderLayout.WEST);
jFrame.add(jButtons[2],BorderLayout.CENTER);
jFrame.add(jButtons[3],BorderLayout.EAST);
jFrame.add(jButtons[4],BorderLayout.SOUTH);
jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jFrame.setVisible(true);
}
}
Exception in thread "main" java.lang.NullPointerException
at Example1.main(Example1.java:9)
Process finished with exit code 1