if you don't have the 'Tall Paul' font, change to another
import javax.swing.*;
import java.awt.*;
class Testing
{
public Testing()
{
JFrame.setDefaultLookAndFeelDecorated(true);
JFrame f = new JFrame("Hello World");
f.getLayeredPane().getComponent(1).setFont(new Font("Tall Paul",Font.ITALIC,24));
f.setSize(300,100);
f.setLocation(400,200);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
}
public static void main(String[] args){new Testing();}
}
Michael,
Thanks. It works!
But there was a problem. I was not using the :-
JFrame.setDefaultLookAndFeelDecorated(true);
so I have to use it now.
Is it possible to do it without the default decorated look and feel? Because the default LNF title bar has too much height and I am cramped for space.
I know that's no excuse. I tried but it doesn't work.. I am using a extended JFrame like this:-
class Testing extends JFrame
{
public Testing()
{
setSize(300,100);
setLocation(400,200);
Container container = getContentPane();
/* add components to this container here */
setVisible(true);
}
}
When I use getComponent() for the container, I get an ArrayIndexOutOfBound Exception.
When I set the argument to getComponent(0), the font in the title bar is not changed.
What else should I do?
Thanks.
Niteen.