I am working on some code and was trying to add a border to a JPanel. I finally figured it out after someone told me, but I am not sure why my first line did not work. Can someone give me some insight? Here is the snip-it of code:
private Container currCntr;
currCntr = new JPanel();
currCntr.setBorder(new LineBorder(Color.BLACK)); //Doesn't work (cannot find symbol)
((JPanel)currCntr).setBorder(new LineBorder(Color.BLACK)); //Works