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

📄 window.java

📁 java技术内幕源代码,配合书籍看有事半功倍的效果
💻 JAVA
字号:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

/*
<APPLET
    CODE = window.class
    WIDTH = 350
    HEIGHT = 280 >
</APPLET>
*/

public class window extends JApplet implements ActionListener
{
    JWindow jwindow = new JWindow();

    public void init()
    {
        Container contentPane = getContentPane();
        JButton jbutton = new JButton("Display window");
        JButton jwindowbutton = new JButton("Close");

        contentPane.setLayout(new FlowLayout());

        contentPane.add(jbutton);

        jwindow.getRootPane().setBorder(
            BorderFactory.createRaisedBevelBorder()
        );

        Container windowContentPane = jwindow.getContentPane();
        windowContentPane.setLayout(new FlowLayout());
        windowContentPane.add(jwindowbutton);

        jwindowbutton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) 
            {
                jwindow.dispose();
            }
        });

        jbutton.addActionListener(this);

    }

    public void actionPerformed(ActionEvent e) 
    {
        jwindow.setBounds(200, 200, 100, 100);

        jwindow.show();
    }
}

⌨️ 快捷键说明

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