Icon in titledBorder title
- by Venno
Hi is it possible to place an icon in the title of a titledBorder for example the following code:
import java.awt.GridLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.TitledBorder;
public class TitledExample extends JPanel {
public TitledExample() {
super(true);
this.setLayout(new GridLayout(1, 1, 5, 5));
JLabel label = new JLabel("Titled Border");
label.setHorizontalAlignment(JLabel.CENTER);
TitledBorder titled = new TitledBorder("Image here ?? Title");
label.setBorder(titled);
add(label);
}
Thanks , Cheers