一.String包中常用控件类

1.SWING菜单类

JMenuBar,JMenu,JMenuItem

2.文本窗格类

JTextPane

3.按钮类,标签类以及分割线控件

1)按钮类  JButton

2)图标类 ImageIcon

3)标签类 JLabel

4)分割线类JSeparator

二.布局管理器

(1)定义容器类对象

Container contentPane=getContentPane();

(2)对容器类对象设置布局
  contentPane.setLayout(null);

(3)设置控件的左上角坐标(x,y)和宽度w,高度h

[控件].setBounds(int x, int y, int w, int h)

(4)加入控件

[容器].add(控件)

三.字体类和颜色类

1.字体类Font

2.颜色类Color

1)Color(int rgb)

2)Color(int r, int g ,int b)

3)Color(float r,float g,float b)

四.表格控件

1.表格类JTable

2.滚动窗格类JScroolPane

3.默认表格模型类DefaultTableModel

五.SWING综合

相关文章:

  • 2021-11-10
  • 2021-09-19
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2021-11-22
  • 2021-12-21
猜你喜欢
  • 2022-02-12
  • 2022-01-25
  • 2021-11-21
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2021-07-02
相关资源
相似解决方案