Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Still needs some work on making it easier to load fonts but it works for me. :D
- Changed out the file path that was there for a fake one. Put in one of your choosing.
- public static void FontTester()
- {
- try
- {
- Font f = Font.createFont(Font.TRUETYPE_FONT, new FileInputStream(new File("File\\path\\to\\font\\filename"))).deriveFont(Font.PLAIN, 75);
- JLabel testLabel = new JLabel ("Looky Me I can Load Fonts In Java \"" + f.getName() + "\"");
- testLabel.setFont (f);
- JFrame frame = new JFrame ("Font Loading Demo");
- frame.getContentPane().add (testLabel);
- frame.pack(); frame.setVisible(true);
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement