1 package net.sf.openrocket.gui.components;
4 import javax.swing.JLabel;
7 * A resizeable JLabel. The method resizeFont(float) changes the current font size by the
8 * given (positive or negative) amount. The change is relative to the current font size.
10 * A nice small text is achievable by <code>new ResizeLabel("My text", -2);</code>
12 * @author Sampo Niskanen <sampo.niskanen@iki.fi>
15 public class ResizeLabel extends JLabel {
17 public ResizeLabel() {
21 public ResizeLabel(String text) {
25 public ResizeLabel(float size) {
30 public ResizeLabel(String text, float size) {
35 public ResizeLabel(String text, int horizontalAlignment, float size) {
36 super(text, horizontalAlignment);
41 public void resizeFont(float size) {
42 Font font = this.getFont();
43 font = font.deriveFont(font.getSize2D()+size);