Code example for JLabel

Methods: getIconsetIconsetText

0
	 * @param shape above. 
	 */ 
	private JComponent makeShapeIcon(JLabel label, String shape)
	{ 
		if (FigureUtil.SCRIBBLE_TYPE.equals(shape))
			label.setIcon(SCRIBBLE);
		else if (FigureUtil.LINE_TYPE.equals(shape)) 
			label.setIcon(LINE);
		else if (FigureUtil.LINE_CONNECTION_TYPE.equals(shape)) 
			label.setIcon(CONNECTION);
		else if (FigureUtil.POLYGON_TYPE.equals(shape)) 
			label.setIcon(POLYGON);
		else if (FigureUtil.POINT_TYPE.equals(shape)) 
			label.setIcon(POINT);
		else if (FigureUtil.RECTANGLE_TYPE.equals(shape)) 
			label.setIcon(RECTANGLE);
		else if (FigureUtil.ELLIPSE_TYPE.equals(shape)) 
			label.setIcon(ELLIPSE);
		else if (FigureUtil.TEXT_TYPE.equals(shape)) 
			label.setIcon(TEXT);
		else if (FigureUtil.MASK_TYPE.equals(shape)) 
			label.setIcon(MASK);
		else label.setText(shape);
		if (label.getIcon() != null) {
			JPanel p = new JPanel();
			FlowLayout layout = new FlowLayout(FlowLayout.CENTER);
			layout.setVgap(0);
			p.setBorder(BorderFactory.createEmptyBorder());
			p.setLayout(layout);