All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.webswing.demo.fonts.FontsPanel Maven / Gradle / Ivy

There is a newer version: 2.6.5
Show newest version
package org.webswing.demo.fonts;

import java.awt.Dimension;
import java.awt.Font;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

public class FontsPanel extends JPanel {

	public FontsPanel(String initialText,Font f) {
		JLabel theLabel = new JLabel(initialText) {
			public Dimension getPreferredSize() {
				return new Dimension(600, 300);
			}

			public Dimension getMinimumSize() {
				return new Dimension(600, 300);
			}

			public Dimension getMaximumSize() {
				return new Dimension(600, 300);
			}
		};
		theLabel.setFont(f);
		theLabel.setVerticalAlignment(SwingConstants.CENTER);
        theLabel.setHorizontalAlignment(SwingConstants.CENTER);
		add(theLabel);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy