zoukankan      html  css  js  c++  java
  • java设置窗体

    public class 设置窗体 extends JFrame {

    private JPanel contentPane;

    /**
    * Launch the application.
    */
    public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
    public void run() {
    try {
    设置窗体 frame = new 设置窗体();
    frame.setVisible(true);
    } catch (Exception e) {
    e.printStackTrace();
    }
    }
    });
    }

    /**
    * Create the frame.
    */
    public 设置窗体() {
    setTitle("u63A7u5236u7A97u4F53u52A0u8F7Du65F6u7684u4F4Du7F6E");
    addWindowListener(new WindowAdapter() {
    @Override
    public void windowOpened(WindowEvent e) {
    do_this_windowOpened(e);
    }
    });
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setBounds(100, 100, 450, 300);
    contentPane = new JPanel();
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    contentPane.setLayout(new BorderLayout(0, 0));
    setContentPane(contentPane);
    }

    protected void do_this_windowOpened(WindowEvent e) {
    setLocationRelativeTo(null);// 设置窗体居中
    }
    }

  • 相关阅读:
    hdu2037 经典贪心入门
    hdu1045 dfs
    poj2243 bfs
    poj2488 dfs
    poj1111 DFS
    单词统计
    冲刺第五天
    七周总结学习笔记
    冲刺第四天
    冲刺第三天
  • 原文地址:https://www.cnblogs.com/fanzhengzheng/p/7503032.html
Copyright © 2011-2022 走看看