Default fonts for JTextArea and JLabel

Does anybody knows what are the default fonts for JTextArea and JLabel?It seems they use different fonts, and I'd like to set both with the same font to have the a pattern on a frame I created.thanks in advance
[232 byte] By [Valerianoa] at [2007-11-26 21:37:45]
# 1
[url= http://www.rgagnon.com/javadetails/java-0335.html]How to change default fonts for Swing components[/url]I think the actual default fonts depend on the platform you're using.
kevjavaa at 2007-7-10 3:20:15 > top of Java-index,Java Essentials,Java Programming...
# 2

import java.awt.*;

import javax.swing.*;

public class FontExample implements Runnable {

public void run() {

Font labelFont = UIManager.getFont("Label.font");

System.out.println("Label.font is " + labelFont);

Font textareaFont = UIManager.getFont("TextArea.font");

System.out.println("TextArea.font is " + textareaFont);

//tweak:

UIManager.put("Label.font", textareaFont);

JPanel p = new JPanel();

p.add(new JLabel("here is a label"));

p.add(new JTextField("and here is a text field"));

JFrame f = new JFrame("ButtonExample");

f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

f.setContentPane(p);

f.pack();

f.setLocationRelativeTo(null);

f.setVisible(true);

}

public static void main(String[] args) {

SwingUtilities.invokeLater(new FontExample());

}

}

DrLaszloJamfa at 2007-7-10 3:20:15 > top of Java-index,Java Essentials,Java Programming...
# 3
^-- The usual page from the com.examples.DrLaszloJamf spellbook :).
kevjavaa at 2007-7-10 3:20:15 > top of Java-index,Java Essentials,Java Programming...
# 4

> import java.awt.*;

> import javax.swing.*;

>

> public class FontExample implements Runnable {

>public void run() {

> Font labelFont =

> UIManager.getFont("Label.font");

> System.out.println("Label.font is " +

> labelFont);

> Font textareaFont =

> UIManager.getFont("TextArea.font");

> System.out.println("TextArea.font is " +

> textareaFont);

> //tweak:

> UIManager.put("Label.font", textareaFont);

>

> JPanel p = new JPanel();

> p.add(new JLabel("here is a label"));

> p.add(new JTextField("and here is a text

> field"));

>

> JFrame f = new JFrame("ButtonExample");

> f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

> f.setContentPane(p);

> f.pack();

> f.setLocationRelativeTo(null);

> f.setVisible(true);

>}

>public static void main(String[] args) {

>SwingUtilities.invokeLater(new FontExample());

>

> }

Thanks for the help

=)

Valerianoa at 2007-7-10 3:20:15 > top of Java-index,Java Essentials,Java Programming...