Java Code Examples for org.jdesktop.swingx.JXLabel#setLineWrap()

The following examples show how to use org.jdesktop.swingx.JXLabel#setLineWrap() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GedEntryComponent.java    From MtgDesktopCompanion with GNU General Public License v3.0 5 votes vote down vote up
public GedEntryComponent(GedEntry e, int w,int h) 
{
	setBorder(new LineBorder(new Color(0, 0, 0), 1, true));
	setLayout(new BorderLayout(0, 0));
	this.w=w;
	this.h=h;
	lblDelete = new JLabel("X");
	lblDelete.setHorizontalAlignment(SwingConstants.RIGHT);
	add(lblDelete, BorderLayout.NORTH);
	
	
	JXLabel l = new JXLabel();
	l.setHorizontalAlignment(SwingConstants.CENTER);
	this.entry = e;
	l.setText(entry.getName());
	l.setIcon(entry.getIcon());
	l.setLineWrap(true);
	defaultColor = getBackground();
	
	if(entry.isImage())
		l.setIcon(getThumbnail());
	
	l.setVerticalTextPosition(SwingConstants.BOTTOM);
	l.setHorizontalTextPosition(SwingConstants.CENTER);
	
	setToolTipText(e.getName());
	setOpaque(true);
	setPreferredSize(new Dimension(w,h));
	
	add(l);
	
}
 
Example 2
Source File: DependecyWPanel.java    From BART with MIT License 5 votes vote down vote up
private void initJXLabelDependency()   {
    fadeInTimeline = new Timeline(this); 
    labelDependency = new JXLabel();
    labelDependency.setOpaque(true);
    labelDependency.setMinimumSize(new Dimension(589, 200));
    labelDependency.setPreferredSize(new Dimension(589, 200));
    labelDependency.setLineWrap(false);
    labelDependency.setTextAlignment(JXLabel.TextAlignment.JUSTIFY);       
    labelDependency.setIcon(ImageUtilities.image2Icon(ImageUtilities.loadImage(R.IMAGE_NODE_DCS)));
    labelDependency.setIconTextGap(20);
}