I am adding a java swing border into my existing code. I have referred online and put in my code which I got from a site, but on running it I get an error, and when highlighting in my intellij this pops up : cannot resolve symbol 'p'. Where am I going wrong ?
private class AnotherBorderTest extends JFrame {
public AnotherBorderTest() {
setTitle("Border Test");
setSize(450, 450);
JPanel content = (JPanel) getContentPane();
content.setLayout(new GridLayout(6, 2, 3, 3));
p = new JPanel();
p.setBorder(new MatteBorder(new ImageIcon("BALL.GIF")));
p.add(new JLabel("MatteBorder"));
content.add(p);
setVisible(true);
}
public void main(String args[]) {
new AnotherBorderTest();
}
}