java中常用的swing组件 (2013-10-27-163 写的日志迁移

五种布局:
 
流式布局(FlowLayout)边界布局(borderLayout)网格布局(GridLayout)  盒子布局(BoxLaYout)  空布局(null)  常用的几种
卡片布局(CardLayout)网格包布局(GridBagLayout)不常用的两种
 
JFrame 窗体(默认的borderLayout布局)
JPanel 面板 (默认的FlowLayout布局)
JButton   按钮
JRadioButton 单选框(一定要把单选放在ButtonGroup当中形成互斥)
JCheckBox 复选框
JLabel 标签
JTextField 文本框
JTextArea  多行文本域(一定要放在JScrollPane中才能形成滚动效果)
JScrollPane 滚动面板
JList 多行显示(也要放在JScrollPane中才能形成滚动效果)
JComboBox<String>  下拉框(里面传数组)
JPasswordField 密码框
JSplitPane  拆分窗格
JTabbedPane 选项卡
JOptionPane 消息提示面板(如:JOptionPane.showMessageDialog(this/*指代当前窗体*/, "输入框不能为空!");)
JMenuBar 菜单条组件 (this.setJMenuBar() /*菜单添加到窗体上*/)
JMenu    菜单组件
JMenuItem 菜单项组件
JMenu里面可以嵌套JMenu() //二级菜单
JToolBar  容器类组件
 
this.setIconImage(new ImageIcon("images/note.png").getImage()) //设置标题图片
 
// 更多请自行研究
原文地址:https://www.cnblogs.com/jiang-xy/p/9340747.html