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

📄 downloadingdialog.java

📁 这是Java编程艺术一书附带的源代码
💻 JAVA
字号:
import java.awt.*;
import javax.swing.*;

/* This class displays a simple dialog instructing the user
   that messages are being downloaded. */
public class DownloadingDialog extends JDialog
{
  // Constructor for dialog.
  public DownloadingDialog(Frame parent)
  {
    // Call super constructor, specifying that dialog is modal.
    super(parent, true);

    // Set dialog title.
    setTitle("E-mail Client");

    // Instruct window not to close when the "X" is clicked.
    setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);

    // Put a message with a nice border in this dialog.
    JPanel contentPane = new JPanel();
    contentPane.setBorder(
      BorderFactory.createEmptyBorder(5, 5, 5, 5));
    contentPane.add(new JLabel("Downloading messages..."));
    setContentPane(contentPane);

    // Size dialog to components.
    pack();

    // Center dialog over application.
    setLocationRelativeTo(parent);
  }
}

⌨️ 快捷键说明

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