CCNA学习有感,认识cisco认证体系
2007-09-07 11:05
211 查看
范例2-flowlayout
一:
import java.awt.*;
import java.awt.event.*;
public class flowlayout
{
Frame myf;
Button b1,b2,b3,b4,b5,b6;
public static void main(String args[])
{
flowlayout myfl=new flowlayout();
myfl.init();
}
public void init()
{
myf=new Frame();
myf.setLayout(new FlowLayout(FlowLayout.LEFT,20,40));
myf.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
b1=new Button("b1");
b2=new Button("b2");
b3=new Button("b3");
b4=new Button("b4");
b5=new Button("b5");
b6=new Button("b6");
myf.add(b1);
myf.add(b2);
myf.add(b3);
myf.add(b4);
myf.add(b5);
myf.add(b6);
myf.setSize(100,100);
myf.setVisible(true);
}
}
二.
import java.awt.*;
import java.awt.event.*;
public class flowlayout
{
public static void main(String args[])
{
Frame myf;
Button b1,b2,b3,b4,b5,b6;
myf=new Frame();
myf.setLayout(new FlowLayout(FlowLayout.LEFT,20,40));
myf.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
b1=new Button("b1");
b2=new Button("b2");
b3=new Button("b3");
b4=new Button("b4");
b5=new Button("b5");
b6=new Button("b6");
myf.add(b1);
myf.add(b2);
myf.add(b3);
myf.add(b4);
myf.add(b5);
myf.add(b6);
myf.setSize(100,100);
myf.setVisible(true);
}
}
一:
import java.awt.*;
import java.awt.event.*;
public class flowlayout
{
Frame myf;
Button b1,b2,b3,b4,b5,b6;
public static void main(String args[])
{
flowlayout myfl=new flowlayout();
myfl.init();
}
public void init()
{
myf=new Frame();
myf.setLayout(new FlowLayout(FlowLayout.LEFT,20,40));
myf.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
b1=new Button("b1");
b2=new Button("b2");
b3=new Button("b3");
b4=new Button("b4");
b5=new Button("b5");
b6=new Button("b6");
myf.add(b1);
myf.add(b2);
myf.add(b3);
myf.add(b4);
myf.add(b5);
myf.add(b6);
myf.setSize(100,100);
myf.setVisible(true);
}
}
二.
import java.awt.*;
import java.awt.event.*;
public class flowlayout
{
public static void main(String args[])
{
Frame myf;
Button b1,b2,b3,b4,b5,b6;
myf=new Frame();
myf.setLayout(new FlowLayout(FlowLayout.LEFT,20,40));
myf.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
b1=new Button("b1");
b2=new Button("b2");
b3=new Button("b3");
b4=new Button("b4");
b5=new Button("b5");
b6=new Button("b6");
myf.add(b1);
myf.add(b2);
myf.add(b3);
myf.add(b4);
myf.add(b5);
myf.add(b6);
myf.setSize(100,100);
myf.setVisible(true);
}
}
//组件按照加入的先后顺序从左向右排列,一行排列满以后就会自动转到下一行,且每一行的组件都居中排列, //FlowLayout的属性:CENTER,LEFT,RIGHT, //FlowLayout的三个构造函数 1.FlowLayout();FlowLayout(int align):FlowLayout(int align,int hgap,int vgap) |
相关文章推荐
- CCNA学习笔记之网络体系结构
- Cisco认证(CCNA,CCNP,CCIE)体系中文书籍全集书籍
- 学习CCNA和CCNP时 如何认识和提高英语水平
- CCNA学习笔记之网络体系结构
- 基础学习笔记之opencv(23):OpenCV坐标体系的初步认识
- 刚接触Cisco认证CCNA学习经验分享
- 刚接触Cisco认证:CCNA学习经验
- 学习CCNA和CCNP时 如何认识和提高英语水平
- 基础学习笔记之opencv(23):OpenCV坐标体系的初步认识
- 基础学习笔记之opencv(23):OpenCV坐标体系的初步认识
- Java学习笔记------认识Java标识符
- 图论-拓扑排序(学习数据结构与算法分析 C++第三版—clifford A.Shaffer著)有感
- react项目学习笔记四(redux和redux的中间件redux-thunk的认识)
- CCNA学习笔记7-----黄毛丫头篇
- java学习脚印: 泛型(Generics)认识之三
- 一步一步学习BI(1)-认识Integration Services
- 不错的CCNA学习网址
- 深入学习heritrix---体系结构(Overview of the crawler)
- WCF学习- 体系结构