I would just like to know how you get a JComboBox to display all the fonts currently on the system without having to type it one by one.

Urgent help would greatly appreciated.

Hi,
Add

//
      GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment();
         Font[] fonts = e.getAllFonts(); // Get the fonts
         for (Font f : fonts) {
               jComboBox.add(f.getFontName());
}
//

to your code. I think you have got the solution.

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.