当前位置: 代码迷 >> J2SE >> 各位救命呀
  详细解决方案

各位救命呀

热度:62   发布时间:2016-04-24 14:13:58.0
各位大虾救命呀
import   java.awt.*;
public   class   YourFrame   extends   Frame
{
        private   Panel   borderPanel;
        private   Panel   flowPanel;
        private   Panel   gridPanel;
        private   Panel   cardPanel;
        public   YourFrame(String   title)
        {
                super(title);
                setSize(600,400);
                setLocation(100,100);
                setBorderLayoutPanel();
                setFlowLayoutPanel();
                setGridLayoutPanel();
                setCardLayoutPanel();
                setLayout(new   GridLayout(2,2));
                add(borderPanel);
                add(flowPanel);
                add(gridPanel);
                add(cardPanel);
                addWindListener(new   WindowAdapter()
                                                        {
                                                                public   void   windowClosing(WindowEvent   e)
                                                                {
                                                                        System.exit(0);
                                                                }
                                                        });                            
        }
        public   void   setBorderLayoutPanel()
        {
                borderPanel=new   Panel();
                borderPanel.setLayout(new   BorderLayout());
                Button   btn1=new   Button( "North ");
                Button   btn2=new   Button( "South ");
  相关解决方案