• java面板


    package java1;
    //面板Panel
    import javax.swing.*;

    import java.awt.Color;
    import java.awt.FlowLayout;
    import java.awt.Panel;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;

     

    public class Atn extends JFrame {
      Panel panel =new Panel();
      Panel panel2 =new Panel();
      JButton jButton1 = new JButton("Button1");
      JButton jButton2 = new JButton("Button2");
      JButton jButton3 = new JButton("Button3");
      JButton jButton4 = new JButton("Button3");

      public Atn()
      {
        setSize(900,500);
        setVisible(true);
        setTitle("面板容器示例");
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setLayout(new FlowLayout());

        add(panel);
        add(panel2);

        panel.add(jButton1);
        panel.add(jButton2);
        panel2.add(jButton3);
        panel2.add(jButton4);
        panel.setBackground(Color.red);
        panel2.setBackground(Color.green);

        validate();
       }
    }

     

     

    package java1;

    public class Text {
         public static void main(String[] args) {
           new Atn();
        }
    }

  • 相关阅读:
    C+= concurrent_queue 线程安全测试
    c++ 枚举 在函数中的应用
    shell脚本积累
    hibernate+spring整合增删改事务错误
    checkbox批量删除功能
    html全选和取消全选JS
    hibernate+pageBean实现分页dao层功能代码
    table样式
    WebStorm 11 Lisence server
    Kb,KB,Kbps,Mb,Mbps等一些列概念
  • 原文地址:https://www.cnblogs.com/nanfengnan/p/12727937.html
Copyright © 2020-2023  润新知