Fork me on GitHub

2017年4月3日

Group Layout

摘要: ----------------siwuxie095 将根面板 contentPane 的布局切换为 Group Layout Group Layout 即 分组布局 Group Layout 是 Swing 中最强大的布局管理器,它非常灵活、动态, 支持元素对齐、边界吸附,控件的大小动态调整 ... 当做好... 阅读全文

posted @ 2017-04-03 21:37 siwuxie095 阅读(376) 评论(0) 推荐(0) 编辑

Grid Layout

摘要: ----------------siwuxie095 将根面板 contentPane 的布局切换为 Grid Layout Grid Layout 即 网格布局 先向 contentPane 中添加一个 JButton,填满了整个区域 如果继续添加,可以在这个 JButton 的... 阅读全文

posted @ 2017-04-03 21:00 siwuxie095 阅读(420) 评论(0) 推荐(0) 编辑

Border Layout

摘要: ------------------siwuxie095 根面板 contentPane 的默认布局就是 Border Layout Border Layout 即 边界布局 边界布局 共有 5 个区域: North、West、Center、East、South 「注意:分界线处(即 边界)是 」 ... 阅读全文

posted @ 2017-04-03 20:20 siwuxie095 阅读(350) 评论(0) 推荐(0) 编辑

Flow Layout

摘要: --------------siwuxie095 将根面板 contentPane 的布局切换为 Flow Layout Flow Layout 即 浮动布局,即 所有的控件都是可以浮动的 不是指 相互叠加,而是指 它们在窗体大小发送变化时之间的相对位置可以改变 如:向 contentPane 中添加 ... 阅读全文

posted @ 2017-04-03 19:31 siwuxie095 阅读(301) 评论(0) 推荐(0) 编辑

Absolute Layout

摘要: siwuxie095 根面板 contentPane 的默认布局为 Border Layout,将其 切换为 Absolute Layout Absolute Layout 即 绝对布局,即 它没有任何的限制,可以 在界面中任意摆放控件的位置 在将控件拖动到面板上时,会出现参考线,参考线仅仅是 为了 阅读全文

posted @ 2017-04-03 18:36 siwuxie095 阅读(306) 评论(0) 推荐(0) 编辑

Swing界面组件的通用属性

摘要: ----------------siwuxie095 Swing 界面组件(控件)的通用属性: (1)enabled:启用/禁用某组件(控件) 「某些 Container 也有这个选项,如果将其 enabled 设为 false, 则该 Container 里的组件(控件)依然可用」 (2)foreground:前... 阅读全文

posted @ 2017-04-03 14:19 siwuxie095 阅读(231) 评论(0) 推荐(0) 编辑

数字调节控件JSpinner的使用

摘要: ---------------siwuxie095 工程名:TestUI 包名:com.siwuxie095.ui 类名:TestList.java 工程结构目录如下: 在根面板 contentPane 的上方添加一个 JSpinner, 在其 model 属性中选择 Number 「model 还可以... 阅读全文

posted @ 2017-04-03 13:06 siwuxie095 阅读(527) 评论(0) 推荐(0) 编辑

进度条控件JProgressBar的使用

摘要: ----------------siwuxie095 工程名:TestUI 包名:com.siwuxie095.ui 类名:TestList.java 工程结构目录如下: 在根面板 contentPane 的下方添加一个 JProgressBar, 可以在 value 属性中设定初始值,可以在 maxi... 阅读全文

posted @ 2017-04-03 13:03 siwuxie095 阅读(494) 评论(0) 推荐(0) 编辑

下拉菜单控件JComboBox的使用

摘要: ---------------siwuxie095 工程名:TestUI 包名:com.siwuxie095.ui 类名:TestList.java 工程结构目录如下: 在根面板 contentPane 的上方添加一个 JComboBox, 在 model 属性的第二个选项 ComboBox model... 阅读全文

posted @ 2017-04-03 11:47 siwuxie095 阅读(2597) 评论(0) 推荐(0) 编辑

列表控件JList的使用

摘要: --------------siwuxie095 工程名:TestUI 包名:com.siwuxie095.ui 类名:TestList.java 工程结构目录如下: 切换到 Design,在根面板 contentPane 的上方添加一个 JList, 为其 model 属性添加值,指定 J... 阅读全文

posted @ 2017-04-03 11:16 siwuxie095 阅读(4388) 评论(0) 推荐(0) 编辑

导航