import javax.swing.*;
import java.awt.*;
public class keyboard
{
public static void main(String args[])
{
String s[] = {"esc","F1","F2","F3","F4","F5",
"F6","F7","F8","F9","F10","F11","F12",
"psc","slk","pau"};
JButton j[] = new JButton[s.length];
for(int i=0;i<s.length;i++)
j[i].setText(s[i]);
JFrame f = new JFrame();
for(int i=0;i<s.length;i++)
f.add(j[i],JFrame.LEFT_ALIGNMENT);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
}
}
I need Instant Help!. Code is giving me error of Null-Pointer Assignment, Please Any help me appreciated.