Dynamically changing the font size of a JComboBox

Main.java:

import javax.swing.event.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
import java.awt.*;
 
public class Main extends JFrame
{
   public Main() {
      addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent we) {
            System.exit(0);
         }
      });
 
      Vector v = new Vector();
      for (int i=10; i<100; i+=5) {
         v.addElement(""+i);
      }
 
      final JComboBox combobox = new JComboBox(v);
      getContentPane().setLayout(new FlowLayout(FlowLayout.LEFT));
      getContentPane().add(new JLabel("Select font size:"));
      getContentPane().add(combobox);
 
      Font f = combobox.getFont();
      combobox.setFont(f.deriveFont(10.0f));
  
      combobox.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent ae) {
            Font f = combobox.getFont();
            combobox.setFont(f.deriveFont(
                                new Float(""+combobox.getSelectedItem()).
                                          floatValue()));
         }
      });
   }
 
   public static void main(String []args) {
      Main main = new Main();
      main.setSize(200, 200);
      main.setVisible(true);
   }
}