1. 日期选择文本框
package com.example.mybatis;
import javax.imageio.ImageIO;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.plaf.ButtonUI;
import javax.swing.plaf.ComboBoxUI;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.Base64;
import java.util.Calendar;
import java.util.Date;
public class DateField extends JPanel {
private String buttonImg = "iVBORw0KGgoAAAANSUhEUgAAA0gAAANICAMAAADKOT/pAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAwBQTFRF+fn5z8/Pi4uLXl5eODg4KSkpHx8fKioqOzs7YGBgjY2N1dXV+/v74uLinZ2da2trQkJCLi4uISEhJiYmNDQ0VFRUf39/v7+/8vLyw8PDXV1dDg4OAAAAEhISyMjIeXl5AwMDRkZGqampwcHBKCgoycnJ6enpERER6urqRERETU1N9PT0ysrKuLi4CwsLExMT5ubmNzc3iYmJmJiYp6enZWVlj4+PoqKi2dnZVlZWpqamtbW16+vrBAQE4eHhCgoKMDAwpKSkLCwsOTk5e3t7jIyMnp6e2traSkpK8/PzDQ0NAgIC39/fGBgYaWlp7e3tzMzM2NjYh4eHMzMzLy8vR0dHioqKHh4eV1dX19fX8PDwBwcH7u7ur6+v29vbmpqazs7OFhYW/f39hYWFDAwMKysr/v7+PDw8+Pj4CQkJEBAQDw8P9vb2/Pz8IyMj8fHxSEhIBgYGHR0dMTEx9/f3Ojo6GxsbLS0tHBwcBQUFJCQkFxcX7+/vGhoaNTU1FBQUMjIyCAgIGRkZx8fHFRUVy8vLIiIiJSUl+vr6Q0NDxsbGAQEB9fX1vr6+JycnvLy8PT09Pz8/ICAgNjY2SUlJQEBA0tLS1tbW7Ozs4+PjdHR0rKysbm5uoKCg0NDQgICAb29vtra2rq6uhISEYmJi5eXlsLCwT09Pd3d3sbGxUVFR4ODgq6urfHx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FFwB6deL3/fTVzD8mqdW7LnpsD8eOhkJC16/e9Hcuy54raawHwiQLAQSU+fa4ZXVK+vXdoIG413i/Vt7xppnivGCCZCsBhJkSwEkgAQBJIAEASSABAEkgARBAAkgQQAJIEEACSBBAAkgQRBAAkgQQAJIEEACSBBAggASBJAAEgSQABIEkAASBJAggAQBJIAEASSABAEkgAQBJAggQQAJIEEACSBBAAkgQQAJAkgQQAJIEEACSBBAAkgQBJAAEgSQABIEkAASBJAAEgQBJIAEASSABAEkgAQBJAggQQAJIEEACSBBAAkgQQAJAkgQQAJIEEACSBBAAkgQQIIAEgSQABIEkAASBJAAEgSQIIAEASSABAEkgAQBJIAEASQIIEEACSBBAAkgQQAJIEEQQAJIEEACSBBAAkgQQAJIEASQABIEkAASBJDKCaSPP7wdsr0W/goglRik2+GVExQASCUG6avwygmSAFKJQfokvAJIEECCABJAggASQIIAEkACSAAJAkgQQAJIEEACSBBAAkgACSABJIAEASSABAEkgAQBJIAEkAASQAJIEEACSBBAAkgQQAJIAAkgASSABAEkgAQBJIAEASQIIAEkgASQIIAEkCCABJAggAQBJIAEkAASBJAAEgSQABJAAkgQQIIAEkCCABJAggASQAJIAAkCSBBAAkgQQAJIEEACSAAJIAEkgAQBJIAEASSApBTVbafdbK5uv4/3s31/Mvuzf8ifT1+/y+TPPu00F0AqX5C+TkzXQbyf3WH+Z6/gtrLJ/A9/BCCVL0gLzc+nH/N+dmDQ9M8e47Zyk+mfveN0gFS+IC0GSAAJIAEkgASQABJAAkgACSABJIAEkAASQAJIAAkgASSABJAAEkACSAAJIAEkCCABJIAEkAASQAJIAAkgASSABJAggASQABJAAkgACSABJIAEkAASQIIAEkACSAAJIAEkgASQABJAAkgACQJIAAkgASSABJAAEkACSAAJIAEkwAGQABJAAkgACSABJIAEkAASQAJIAAkgASSABJAAEkACSAAJIAEkgASQABJAAkgACSABJIAEkAASQIIAEkACSAAJIAEkgASQSgbSXu4PPw1wACSAlFWRCj5FwAZAAkgQQAJIAAkgASSABJ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ZTptb2RpZnkAMjAxOS0wMy0yNVQxMToyNDoxOCswODowMIOTKZUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAAAElFTkSuQmCC";
private JTextField tfDate;
private JButton button;
private JDialog dlg;
private JPanel paCalendar;
private Integer fontSize = 15;
private boolean show;
private JComboBox cboYear;
private JComboBox cboMonth;
private JLabel[] lbls = new JLabel[7];
private JToggleButton[] toggles = new JToggleButton[42];
private Border border;
private Color bgColor;
private int width = 150, height = 25;
private int year;
private int month;
private int date;
private int dayOfWeek;
private String[] week = {"日", "一", "二", "三", "四", "五", "六"};
public DateField() {
year = Calendar.getInstance().get(Calendar.YEAR);
month = Calendar.getInstance().get(Calendar.MONTH) + 1;
date = Calendar.getInstance().get(Calendar.DATE);
dayOfWeek = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
initUI();
initDateDialog();
updateField();
}
private void initUI() {
tfDate = new JTextField();
tfDate.setEditable(false);
tfDate.setBackground(Color.WHITE);
border = tfDate.getBorder();
tfDate.setBorder(null);
tfDate.setFont(new Font("宋体", Font.PLAIN, fontSize));
button = new JButton();
button.setIcon(base64ToImage());
button.setPreferredSize(new Dimension(height, height));
button.addActionListener(e -> {
if (show == false) {
dlg.setLocation(DateField.this.getLocationOnScreen().x, DateField.this.getLocationOnScreen().y + DateField.this.height);
dlg.setAlwaysOnTop(true);
dlg.setVisible(true);
} else {
dlg.dispose();
}
updateField();
show = !show;
});
this.bgColor = this.getBackground();
this.setOpaque(false);
this.setLayout(new BorderLayout(0, 0));
this.setBorder(border);
this.add(tfDate, BorderLayout.CENTER);
this.add(button, BorderLayout.EAST);
}
private void initDateDialog() {
dlg = new JDialog();
dlg.setUndecorated(true);
paCalendar = new JPanel(new BorderLayout());
paCalendar.setBorder(this.border);
paCalendar.setBackground(this.bgColor);
int borderWidth = 3;
// 初始化两个下拉组件用于年和月的选择
JPanel paHeader = new JPanel(new GridLayout(1, 2, borderWidth, borderWidth));
paHeader.setOpaque(false);
paHeader.setPreferredSize(new Dimension(this.width, this.height + borderWidth));
paHeader.setBorder(BorderFactory.createEmptyBorder(borderWidth, borderWidth, borderWidth, borderWidth));
paHeader.add(cboYear = new JComboBox());
paHeader.add(cboMonth = new JComboBox());
initYearModel();
initMonthModel();
paCalendar.add(paHeader, BorderLayout.NORTH);
// 初始化日期组件
JPanel paDay = new JPanel();
paDay.setOpaque(false);
paDay.setPreferredSize(new Dimension(this.height * 7, this.height * 7));
initDate(paDay);
paCalendar.add(paDay, BorderLayout.CENTER);
dlg.setContentPane(paCalendar);
dlg.pack();
dlg.addWindowFocusListener(new WindowAdapter() {
public void windowLostFocus(WindowEvent e) {
dlg.dispose();
}
});
}
private void initYearModel() {
for (int y = 1970; y < 2033; y++)
cboYear.addItem(y);
cboYear.setSelectedItem(year);
cboYear.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
year = Integer.parseInt(cboYear.getSelectedItem().toString());
updateComponent();
}
});
}
private void initMonthModel() {
for (int m = 1; m <= 12; m++)
cboMonth.addItem(m);
cboMonth.setSelectedItem(month);
cboMonth.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
month = Integer.parseInt(cboMonth.getSelectedItem().toString());
updateComponent();
}
});
}
private void initDate(JPanel pa) {
pa.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
// 显示日历的标签栏
for (int i = 0; i < week.length; i++) {
lbls[i] = new JLabel(week[i]);
lbls[i].setHorizontalAlignment(SwingConstants.CENTER);
lbls[i].setOpaque(true);
lbls[i].setBackground(Color.WHITE);
lbls[i].setPreferredSize(new Dimension(this.height, this.height));
pa.add(lbls[i]);
}
// 加载日历按钮
ButtonGroup group = new ButtonGroup();
for (int i = 0; i < 42; i++) {
toggles[i] = new JToggleButton();
toggles[i].setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));
toggles[i].setPreferredSize(new Dimension(this.height, this.height));
toggles[i].addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
date = Integer.parseInt(((JToggleButton) e.getSource()).getText().toString());
dlg.dispose();
updateField();
}
});
group.add(toggles[i]);
pa.add(toggles[i]);
}
updateComponent();
}
private void updateComponent() {
if (cboYear == null || cboMonth == null)
return;
Calendar cal = Calendar.getInstance();
cal.set(year, month - 1, 1);
// 根据当月的第一天是星期几来判断日历按钮的数字该从第几个按钮开始显示
int off = cal.get(Calendar.DAY_OF_WEEK) - 1;
// 计算当月总共有几天
int end = 30;
if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12)
end = 31;
if (month == 2) {
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
end = 29;
else
end = 28;
}
for (int i = 0; i < 42; i++) {
if (i >= off && i <= end + off - 1) {
int day = i - off + 1;
toggles[i].setText(day + "");
toggles[i].setEnabled(true);
} else {
toggles[i].setText("");
toggles[i].setEnabled(false);
}
}
// 使当天的按钮呈现被按下的效果
int day = Calendar.getInstance().get(Calendar.DAY_OF_MONTH) + off - 1;
toggles[day].setSelected(true);
}
// 更新文本框内的文字
private void updateField() {
StringBuilder builder = new StringBuilder();
builder.append(this.year + "年");
builder.append(this.month + "月");
builder.append(this.date + "日");
Calendar cal = Calendar.getInstance();
cal.set(this.year, this.month - 1, this.date);
builder.append(" 星期" + week[cal.get(Calendar.DAY_OF_WEEK) - 1]);
tfDate.setText(builder.toString());
}
private ImageIcon base64ToImage() {
byte[] bytes = Base64.getDecoder().decode(buttonImg);
//构建字节数组输入流
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
//通过ImageIO把字节数组输入流转为BufferedImage
BufferedImage bufferedImage = null;
try {
bufferedImage = ImageIO.read(bais);
} catch (IOException e) {
throw new RuntimeException(e);
}
Image image = bufferedImage.getScaledInstance(height, height, Image.SCALE_DEFAULT);
ImageIcon imageIcon = new ImageIcon(image);
return imageIcon;
}
public void setPreferredSize(Dimension preferredSize) {
super.setPreferredSize(preferredSize);
this.width = (int) preferredSize.getWidth();
this.height = (int) preferredSize.getHeight();
}
/**
* 设置字体
*
* @param fontSize
*/
public void setFontSize(Integer fontSize) {
tfDate.setFont(new Font("宋体", Font.PLAIN, fontSize));
this.fontSize = fontSize;
}
/**
* 设置文本框边框
*
* @param border
*/
public void setBorder(Border border) {
super.setBorder(border);
}
/**
* 设置日历边框
*
* @param border
*/
public void setCalendarBorder(Border border) {
if (paCalendar != null) {
paCalendar.setBorder(border);
}
}
/**
* 按钮UI样式
*
* @param clzUIName
*/
public void setButtonUI(String clzUIName) {
try {
button.setUI((ButtonUI) Class.forName(clzUIName).newInstance());
} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
e.printStackTrace();
}
}
/**
* 日期按钮UI样式
*
* @param clzUIName
*/
public void setDateButtonUI(String clzUIName) {
try {
for (int i = 0; i < 42; i++) {
toggles[i].setUI((ButtonUI) Class.forName(clzUIName).newInstance());
}
} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* 设置下拉框UI样式
*
* @param clzUIName
*/
public void setComboBoxUI(String clzUIName) {
try {
cboYear.setUI((ComboBoxUI) Class.forName(clzUIName).newInstance());
cboMonth.setUI((ComboBoxUI) Class.forName(clzUIName).newInstance());
} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
e.printStackTrace();
}
}
/**
* 设置日历弹框的星期表头颜色
*
* @param fg 前景色,文本颜色
* @param bg 背景色
*/
public void setLableColor(Color fg, Color bg) {
for (int i = 0; i < lbls.length; i++) {
lbls[i].setForeground(fg);
lbls[i].setBackground(bg);
}
}
/**
* 设置日期弹框按钮图标
*/
public void setIcon(Image icon) {
button.setIcon(new ImageIcon(icon));
}
/**
* 获取选择的日期
*/
public Date getDate() {
Calendar cal = Calendar.getInstance();
cal.set(this.year, this.month, this.date);
return cal.getTime();
}
}
2. 自定义切换按钮
package com.example.myswing;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.geom.Arc2D;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Path2D;
public class ToggleButton extends JPanel {
//绘制参数设定
public Color bgColor = new Color(0xFFFFFF); //主背景色
public Color lineColor = new Color(0xFFFFFF); //描边
public Color darkColor = new Color(0xE1E1E1); //灰色填充
public Color lightColor = new Color(0x33B4FF); //高亮填充
public int padding = 2; //轮廓线与内部圆的距离
private boolean selected = true; // 开关, ON/OFF
//添加鼠标事件
public ToggleButton() {
this.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
onMouseClicked();
}
});
}
@Override//绘制
protected void paintComponent(Graphics g) {
// TODO Auto-generated method stub
super.paintComponent(g);
int width = this.getWidth();
int height = this.getHeight();
Graphics2D g2d = (Graphics2D) g;
//平滑绘制(反锯齿)
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
// 算出一个2:1的最大矩形
// Rectangle r = new Rectangle(0,0, 100, 50);
int w = width;
int h = width / 2;
if (h > height) {
h = height;
w = height * 2;
}
Rectangle r = new Rectangle((width - w) / 2, (height - h) / 2, w, h);
//里面两个并排圆, 外层轮廓为曲线
//左半区
Rectangle r1 = new Rectangle(r.x, r.y, r.width / 2, r.height);
//右半区
Rectangle r2 = new Rectangle(r.x + r.width / 2, r.y, r.width / 2, r.height);
//绘制外部轮廓线
Shape arc1 = new Arc2D.Double(r1, 90, 180, Arc2D.OPEN);
Shape arc2 = new Arc2D.Double(r2, 270, 180, Arc2D.OPEN);
Path2D outline = new Path2D.Double(); //外轮廓,使用拼装路径
outline.append(arc1.getPathIterator(null), false);
outline.append(arc2.getPathIterator(null), true); // 右半圆弧
outline.closePath();
g2d.setPaint(lineColor);
g2d.draw(outline);
g2d.setPaint(bgColor);
g2d.fill(outline);
//选择绘制的按钮
if (selected) {
drawCircleInside(g2d, r2, padding, lineColor, lightColor);
} else {
drawCircleInside(g2d, r1, padding, lineColor, darkColor);
}
}
/**
* 判断是否选中
*/
public boolean isSelected() {
return this.selected;
}
/**
* 设置是否选中
*/
public void setSelected(boolean selected) {
this.selected = selected;
repaint();
}
/**
* 切换
*/
public void toggle() {
this.selected = !this.selected;
repaint();
}
/**
* 画内部的小圆
*/
private void drawCircleInside(Graphics2D g2d, Rectangle rect, int deflate, Paint lineColor, Paint fillColor) {
// 做一个备份,不会修改传入的rect
Rectangle r = new Rectangle(rect);
r.x += deflate;
r.y += deflate;
r.width -= (deflate * 2);
r.height -= (deflate * 2);
Shape shape = new Ellipse2D.Double(r.x, r.y, r.width, r.height);
// 描边
g2d.setPaint(lineColor);
g2d.draw(shape);
// 填充
g2d.setPaint(fillColor);
g2d.fill(shape);
}
//自定义接口
public interface StateListener {
void stateChanged(Object source);
}
private StateListener stateListener;//属性
public void setStateListener(StateListener listener) {
this.stateListener = listener;
}
//鼠标点击事件
private void onMouseClicked() {
toggle(); //点击时,切换状态
//自定义接口
if (stateListener != null) {
stateListener.stateChanged(this);
}
}
}
3. 复选框栏(全选功能)
package com.example.mybatis;
import javax.swing.*;
import javax.swing.border.Border;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
public class CheckBoxBar extends JPanel {
private JCheckBox allJCheckBox;
private Border border;
private int width = 200;
private int height = 100;
private List jCheckBoxList;
public CheckBoxBar(List jCheckBoxList) {
if (jCheckBoxList.size() < 2) {
throw new RuntimeException("jCheckBoxList 大小不得小于2。");
}
this.allJCheckBox = jCheckBoxList.get(0);
jCheckBoxList.remove(0);
this.jCheckBoxList = jCheckBoxList;
this.border = BorderFactory.createRaisedBevelBorder();
initUI();
}
private void initUI() {
this.setPreferredSize(new Dimension(width, height));
this.setBorder(border);
this.setLayout(new FlowLayout(FlowLayout.LEFT));
allJCheckBox.addActionListener(new AllJCheckBoxListener());
this.add(allJCheckBox);
for (JCheckBox jCheckBox : jCheckBoxList) {
jCheckBox.addActionListener(new OtherJCheckBoxListener());
this.add(jCheckBox);
}
}
class AllJCheckBoxListener implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
JCheckBox jCheck = (JCheckBox) e.getSource();
if (jCheck.isSelected()) {
for (JCheckBox jCheckBox : jCheckBoxList) {
jCheckBox.setSelected(true);
}
} else {
for (JCheckBox jCheckBox : jCheckBoxList) {
jCheckBox.setSelected(false);
}
}
}
}
class OtherJCheckBoxListener implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
JCheckBox jCheck = (JCheckBox) e.getSource();
if (jCheck.isSelected() && isAllSelected()) {
allJCheckBox.setSelected(true);
} else {
allJCheckBox.setSelected(false);
}
}
}
private boolean isAllSelected() {
return jCheckBoxList.stream().allMatch(new Predicate() {
@Override
public boolean test(JCheckBox jCheckBox) {
return jCheckBox.isSelected();
}
});
}
/**
* 获取所有选中的值
*/
public List getSelectedValue() {
List list = new ArrayList<>();
for (JCheckBox jCheckBox : jCheckBoxList) {
if (jCheckBox.isSelected()) {
list.add(jCheckBox.getText());
}
}
return list;
}
}