1 package net.sf.openrocket.gui.components;
3 import java.awt.Dimension;
5 import javax.swing.JLabel;
8 * A JLabel that limits the minimum and maximum height of the label to the
9 * initial preferred height of the label. This is required in labels that use HTML
10 * since these often cause the panels to expand too much in height.
12 * @author Sampo Niskanen <sampo.niskanen@iki.fi>
14 public class HtmlLabel extends JLabel {
21 public HtmlLabel(String text) {
26 public HtmlLabel(String text, int horizontalAlignment) {
27 super(text, horizontalAlignment);
32 private void limitSize() {
33 Dimension dim = this.getPreferredSize();
34 this.setMinimumSize(new Dimension(0, dim.height));
35 this.setMaximumSize(new Dimension(Integer.MAX_VALUE, dim.height));