填空题 按注释完成程序
   import java.awt.*;
   import java.awt.event.*;
   import javax.swing.*;
   public class ButtonTestApplet extends JApplet
   {
           public void init()
           {
                 ButtonPanel buttonpanel = new ButtonPanel();
                 Container container = getContentPane();
                 container.add(buttonpane1);
         }
   }
   class ButtonPanel extends JPanel
   {
           private class ColorAction implements ActionListener
           {
                  private Color backgroundColor;
                  public void actionPerformed(ActionEvent actionevent)
         {
                  setBackground(backgroundColor);
                  repaint();
         }
         public ColorAction(Color color)
         {
                backgroundColor = color;
         }
   }
   public ButtonPanel()
   {
   JButton jbutton = new JButton("橙色");
            jbutton.setForeground(Color.blue);
            jbutton.setFont(( 1) ("隶书",Font.ITALIC,32))
            JButton jbutton1 = new JButton("蓝色");
   Jbutton1.setForeground(Color.blue);
           jbutton.setFont(( 2) ("隶书",Font.ITALIC,32))
           JButton jbutton2 = new JButton("红色");
   Jbutton2.setForeground(Color.blue);
           jbutton.setFont (( 3) ("隶书",Font.ITALIC,32) )
           add(jbutton) ;
           add(jbuttonl) ;
           add(jbutton2) ;
           ColorAction coloraction = new ColorAction(Color.orange);
           ColorAction coloractionl = new ColorAction(Color.blue);
           ColorAction coloraction2 = new ColorAction(Color.red);
           jbutton.addActionListener(( 4));
           jbuttonl.addActionListener(( 5));
           jbutton2.addActionListener(( 6));
    }
   }
  • 1、
【正确答案】 1、new Font new Font new Font coloraction coloraction1 coloraction2    
【答案解析】