<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[木生火]]></title><description><![CDATA[起舞弄清影，人间近黄昏;今夕是何年，点亮一盏灯]]></description><link>https://blog.csdn.net/msh2016</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; msh2016]]></copyright><item><title><![CDATA[Java GUI编程(14)---弹性布局SpringLayout]]></title><link>https://blog.csdn.net/msh2016/article/details/104612077</link><guid>https://blog.csdn.net/msh2016/article/details/104612077</guid><author>msh2016</author><pubDate>Mon, 02 Mar 2020 15:07:18 +0800</pubDate><description><![CDATA[SpringLayout，弹性布局

特点: 改变窗体的大小时, 自动调整组件的大小布满整个窗体(不改变组件间相对位置)。

如下图，组件A、组件B与容器各边距保持约束距离不变（位置不变），组件的大小可变,是一种约束关系，类SpringLayout 、SpringLayout.Constraints 、Spring 配合使用用来管理。



1,SpringLayout类

获取组件或容器的约束...]]></description><category></category></item><item><title><![CDATA[Java GUI编程(13)---网格袋布局GridBagLayout]]></title><link>https://blog.csdn.net/msh2016/article/details/104559101</link><guid>https://blog.csdn.net/msh2016/article/details/104559101</guid><author>msh2016</author><pubDate>Fri, 28 Feb 2020 16:33:32 +0800</pubDate><description><![CDATA[GridBagLayout()，网格袋布局，维持一个动态的矩形单元的网格，矩形单元格被称为显示区域。

组件可占用一个或多个的矩形单元格，组件不要求相同尺寸。

组件由GridBagLayou管理，关联一个约束GridBagConstraints类。

约束组件属性，比如：位置，大小，外部填充，内部填充等。

GridBagConstraints Class

约束属性与值

int gridx,...]]></description><category></category></item><item><title><![CDATA[Java GUI编程(12)---分组布局GroupLayout]]></title><link>https://blog.csdn.net/msh2016/article/details/104538464</link><guid>https://blog.csdn.net/msh2016/article/details/104538464</guid><author>msh2016</author><pubDate>Thu, 27 Feb 2020 16:11:15 +0800</pubDate><description><![CDATA[GroupLayout。

把多个组件按区域划分到不同的Group，,再根据各个Group相对于水平轴(Horizontal)和垂直轴(Vertical)的排列方式来管理。



GroupLayout布局特征对 X轴（水平方向）和 Y轴（竖直方向）独立的，因此在水平和竖直方向上分别指定一个组，来分别确定组件在水平方向 和 竖直方向 上的位置。



//确定组件在 X轴 方向上的位置, 指定...]]></description><category></category></item><item><title><![CDATA[Java GUI编程(11)---箱式布局BoxLayout]]></title><link>https://blog.csdn.net/msh2016/article/details/104499485</link><guid>https://blog.csdn.net/msh2016/article/details/104499485</guid><author>msh2016</author><pubDate>Tue, 25 Feb 2020 16:15:09 +0800</pubDate><description><![CDATA[箱式布局BoxLayout, 把若干组件按水平或垂直方向依次排列放置.

实现原理就是快速创建水平/垂直箱容器(Box)

Box hB = Box.createHorizontalBox(); //创建一个水平箱

Box vB = Box.createVerticalBox(); //创建一个垂直箱

箱内的组件之间默认没有空隙并居中, 添加空隙则可创建用于填充空隙的不可见组件：glue、st...]]></description><category></category></item><item><title><![CDATA[Java GUI编程(10)---卡片布局CardLayout]]></title><link>https://blog.csdn.net/msh2016/article/details/104492408</link><guid>https://blog.csdn.net/msh2016/article/details/104492408</guid><author>msh2016</author><pubDate>Tue, 25 Feb 2020 10:55:03 +0800</pubDate><description><![CDATA[类CardLayout选项卡，一个窗口切换显示多页不同的内容。把容器中的每个组件看作一张卡片，默认显示第一张。

构造函数

CardLayout() 

CardLayout(int hgap, int vgap)

常用方法

first(Container parent); //显示第一张

last(Container parent); //显示最后一张

next(Contain...]]></description><category></category></item><item><title><![CDATA[Java GUI编程(9)---绝对定位布局null]]></title><link>https://blog.csdn.net/msh2016/article/details/104429215</link><guid>https://blog.csdn.net/msh2016/article/details/104429215</guid><author>msh2016</author><pubDate>Fri, 21 Feb 2020 15:54:03 +0800</pubDate><description><![CDATA[绝对点位布局, 给容器布局管理器设置为 null,然后通过设置组件的坐标和宽高来布置组件。

setLayout(null);

组件设置坐标

void setLocation(int x, int y)

void setLocation(Point p)

组件设置宽高

void setSize(int width, int height)

void setSize(Dimension ...]]></description><category></category></item><item><title><![CDATA[Java GUI编程(8)---网格布局GridLayout]]></title><link>https://blog.csdn.net/msh2016/article/details/104419701</link><guid>https://blog.csdn.net/msh2016/article/details/104419701</guid><author>msh2016</author><pubDate>Thu, 20 Feb 2020 22:30:45 +0800</pubDate><description><![CDATA[GridLayout最常用的布局, 以表格的形式进行, 设置显示的行数和列数.

演示代码


package com.msh.util;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.WindowConstants;
public clas...]]></description><category></category></item><item><title><![CDATA[Java GUI编程(7)---边界布局BorderLayout]]></title><link>https://blog.csdn.net/msh2016/article/details/104414993</link><guid>https://blog.csdn.net/msh2016/article/details/104414993</guid><author>msh2016</author><pubDate>Thu, 20 Feb 2020 18:00:05 +0800</pubDate><description><![CDATA[BorderLayout把容器的的布局分为五个位置：依次对应为：

上北（NORTH）、下南（SOUTH）、左西（WEST）、右东（EAST），中（CENTER）



BorderLayout特征

1若东、西、南、北位置无控件，则中间控件将自动布满整个屏幕。

2若东、西、南、北位置中无论哪个位置没有控件，则中间位置控件将自动占据没有控件的位置。

3南、北位置控件各占据一行，控件宽度将自动布...]]></description><category></category></item><item><title><![CDATA[Java GUI编程(6)---流式布局FlowLayout]]></title><link>https://blog.csdn.net/msh2016/article/details/104412937</link><guid>https://blog.csdn.net/msh2016/article/details/104412937</guid><author>msh2016</author><pubDate>Thu, 20 Feb 2020 16:28:02 +0800</pubDate><description><![CDATA[java提供布局管理器编写的GUI界面程式具有平台无关性.

FlowLayout（流式布局）特征

不管对齐方式，组件均按照从左到右的方式进行排列，一行排满，转到下一行。

构造函数

FlowLayout() //创建FlowLayout对象，默认居中对齐的，默认水平和垂直间隙是5个像素

FlowLayout(int align) //自定义容器中的控件对齐方式

align参数值

0或...]]></description><category></category></item><item><title><![CDATA[Java GUI编程(5)---按钮组件JButton]]></title><link>https://blog.csdn.net/msh2016/article/details/104411735</link><guid>https://blog.csdn.net/msh2016/article/details/104411735</guid><author>msh2016</author><pubDate>Thu, 20 Feb 2020 15:36:51 +0800</pubDate><description><![CDATA[JButton是一个可以点击的按键.

构造函数

JButton() //无文本、无图标的按钮

JButton(Icon icon) //有图标的按钮

JButton(String text) //有文本的按钮

JButton(String text,Icon icon)

常用方法

void setEnable(boolean flag) 启用或禁用按扭

void set...]]></description><category></category></item><item><title><![CDATA[Java GUI编程(4)---组件中设置字体Font]]></title><link>https://blog.csdn.net/msh2016/article/details/104410383</link><guid>https://blog.csdn.net/msh2016/article/details/104410383</guid><author>msh2016</author><pubDate>Thu, 20 Feb 2020 14:34:15 +0800</pubDate><description><![CDATA[Font类设置GUI界面的字体样式, 包括字体类型（宋体、仿宋）、字体风格（斜体字、加粗）、 字号大小（默认单位pt）。

构造函数

Font(String familyName,int style,int size)

Font f = new Font("仿宋", Font.BOLD+ Font.ITALIC,12);

style值，常用

Font.PLAIN //普通

Font.BO...]]></description><category></category></item><item><title><![CDATA[Java GUI编程(3)---JLabel设置图片]]></title><link>https://blog.csdn.net/msh2016/article/details/104407083</link><guid>https://blog.csdn.net/msh2016/article/details/104407083</guid><author>msh2016</author><pubDate>Thu, 20 Feb 2020 11:11:33 +0800</pubDate><description><![CDATA[1打开NetBeans,新建项目demoJLabel1,主类com.msh.util. DemoJLabel1

2项目下新建文件夹img，放图片文件Search.gif



3演示代码


package com.msh.util;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.Icon;
im...]]></description><category></category></item><item><title><![CDATA[Java GUI编程(2)---JLabel]]></title><link>https://blog.csdn.net/msh2016/article/details/104405755</link><guid>https://blog.csdn.net/msh2016/article/details/104405755</guid><author>msh2016</author><pubDate>Thu, 20 Feb 2020 10:07:03 +0800</pubDate><description><![CDATA[JLabel对象创建完成后显示一个标签。

标签可以显示文本、图像，可设置垂直和水平对齐方式, 默认内垂直居中对齐。

1，只显示文本的标签是开始边对齐；

2，只显示图像的标签则水平居中对齐。

3，二者都显示，文本位于图像的结尾边上，文本和图像都垂直对齐。

构造方法

JLabel()

JLabel(String text)

JLabel(String text, int horizon...]]></description><category></category></item><item><title><![CDATA[Java GUI编程(1)---JFrame]]></title><link>https://blog.csdn.net/msh2016/article/details/104402260</link><guid>https://blog.csdn.net/msh2016/article/details/104402260</guid><author>msh2016</author><pubDate>Wed, 19 Feb 2020 22:33:53 +0800</pubDate><description><![CDATA[JFrame对象创建完成后,显示是一个窗口框架, 当调用getContentPane()方法将窗体转换为容器，这个容器用来包含和显示组件。调用Container类的add()方法将组件添加至容器。

我们来看个简单代码

1，打开NetBeans，新建项目demoJFrame,主类com.msh.util.DemoJFrame



2点击完成,如下:



3,代码如下



package c...]]></description><category></category></item><item><title><![CDATA[swing窗口事件（WindowLIstener）监听器]]></title><link>https://blog.csdn.net/msh2016/article/details/104385353</link><guid>https://blog.csdn.net/msh2016/article/details/104385353</guid><author>msh2016</author><pubDate>Tue, 18 Feb 2020 23:57:25 +0800</pubDate><description><![CDATA[一个窗体的所有变化，窗口的打开、关闭等都可以使用这个WindowListener接口进行监听

windowOpened(WindowEvent e) 窗体被打开

windowClosing(WindowEvent e) 窗体关闭

windowIconified(WindowEvent e) 窗体最小化

windowDeiconified(WindowEvent e) 窗体从最小化恢复

...]]></description><category></category></item><item><title><![CDATA[swing鼠标事件（MouseEvent）监听器]]></title><link>https://blog.csdn.net/msh2016/article/details/104384309</link><guid>https://blog.csdn.net/msh2016/article/details/104384309</guid><author>msh2016</author><pubDate>Tue, 18 Feb 2020 22:32:31 +0800</pubDate><description><![CDATA[鼠标的操作与监听通过MouseListener接口,主要4个方法

mouseEntered(MouseEvent e) 鼠标移入组件

mouseExited(MouseEvent e) 鼠标移出组件

mousePressed(MouseEvent e) 鼠标按下

mouseReleased(MouseEvent e) 鼠标松开

完整代码演示

监听器类MouseListe...]]></description><category></category></item><item><title><![CDATA[swing键盘事件（KeyEvent）监听器]]></title><link>https://blog.csdn.net/msh2016/article/details/104377249</link><guid>https://blog.csdn.net/msh2016/article/details/104377249</guid><author>msh2016</author><pubDate>Tue, 18 Feb 2020 16:17:06 +0800</pubDate><description><![CDATA[当一个组件处于激活状态时，按下、释放或敲击键盘上的某个键时就会发生键盘事件。通过KeyListener接口实现,KeyListener接口有3个方法:

keyPressed(KeyEvent e)：键盘上某个键被按下

keyReleased(KeyEvent e)：键盘上某个键被按下，又释放

keyTyped(KeyEvent e)：keyPressed和keyReleased两个方法的组合...]]></description><category></category></item><item><title><![CDATA[swing动作事件（ActionEvent）监听器]]></title><link>https://blog.csdn.net/msh2016/article/details/104362494</link><guid>https://blog.csdn.net/msh2016/article/details/104362494</guid><author>msh2016</author><pubDate>Mon, 17 Feb 2020 18:18:53 +0800</pubDate><description><![CDATA[动作事件由ActionEvent类定义，最常用的是当单击按钮后将产生动作事件.

ActionEvent类中有两个常用的方法

1）getSource()：用来获得触发此次事件的组件对象，返回值类型为Object；

2）getActionCommand()：用来获得与当前动作相关的命令字符串，返回值类型为String。



//创建响应动作监听器的类，重写ActionListener接口的a...]]></description><category></category></item><item><title><![CDATA[Java Swing GUI事件处理模型]]></title><link>https://blog.csdn.net/msh2016/article/details/104357438</link><guid>https://blog.csdn.net/msh2016/article/details/104357438</guid><author>msh2016</author><pubDate>Mon, 17 Feb 2020 14:10:19 +0800</pubDate><description><![CDATA[GUI界面程式启动后，Java虚拟机就启动三个线程:主线程、系统工具包线程和事件派发线程。

1主线程 ：负责创建并显示该程序的初始界面；

2系统工具包线程 ：负责将从系统事件队列捕获在该程序界面上的鼠标和键盘操作等底层事件，并把这些事件转换成Swing的相应对应事件对象放入Swing的事件队列中，并循环该线程；

3事件派发线程 ：负责GUI组件的绘制和更新，通过不断从Swing的事件队列中获...]]></description><category></category></item><item><title><![CDATA[了解java的gui]]></title><link>https://blog.csdn.net/msh2016/article/details/104306246</link><guid>https://blog.csdn.net/msh2016/article/details/104306246</guid><author>msh2016</author><pubDate>Fri, 14 Feb 2020 06:39:53 +0800</pubDate><description><![CDATA[三个主要包做GUI开发

java.awt.event 事件处理，后台功能的实现。

java.awt 主要提供字体/布局管理器

javax.swing 主要提供各种组件(窗口/按钮/文本框)

swing组件主要三个部分

顶层容器:：常用有JFrame，JDialog

中间容器：JPanel，JOptionPane，JScrollPane，JLayeredPane ，主要panel结尾。
...]]></description><category></category></item></channel></rss>