Help setting the some font properties of a TitledBorder's title
Hi, what's wrong with my code? I'm still learning Java, so my problem could arise from something different from a swing misunderstanding.
I'm trying to set to green the color of a TitledBorder object's title and a bold weight, but Java compiler gives:
PhoneBookGUI.java:114: cannot resolve symbol
symbol : method createTitledBorder (javax.swing.border.Border,int,int,java.awt.Font,java.awt.Color)
location: class javax.swing.BorderFactory
tb = BorderFactory.createTitledBorder(border, TitledBorder.LEFT, TitledBorder.TOP, font, green);
The ^ is under the first dot (between BorderFactory and createTitledBorder)
HashMap fontAttributes =new HashMap();
fontAttributes.put("WEIGHT", TextAttribute.WEIGHT_BOLD);
Border border;
border = BorderFactory.createEmptyBorder();
Font font =new Font(fontAttributes);
Color green = Color.GREEN;
TitledBorder tb;
tb = BorderFactory.createTitledBorder(border, TitledBorder.LEFT, TitledBorder.TOP, font, green);
Thanks!

