⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 popupcalculatorapplet.java

📁 Java核心技术 卷一 的配套源代码!!绝对全
💻 JAVA
字号:
/**
   @version 1.31 2004-05-07
   @author Cay Horstmann
*/

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class PopupCalculatorApplet extends JApplet
{  
   public void init()
   {  
      // create a frame with a calculator panel
      
      final JFrame frame = new JFrame();
      frame.setTitle("Calculator");
      frame.setSize(200, 200);
      frame.add(new CalculatorPanel());

      // add a button that pops up or hides the calculator
      
      JButton calcButton = new JButton("Calculator");
      add(calcButton);

      calcButton.addActionListener(new
         ActionListener()
         {
            public void actionPerformed(ActionEvent event)
            {  
               frame.setVisible(!frame.isVisible());
            }
         });
   }
}



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -