- 浏览: 70358 次
- 性别:
- 来自: 北京
文章分类
最新评论
package com.ls.model;
import java.util.Date;
import java.util.Calendar;
import java.text.SimpleDateFormat;
import java.text.ParseException ;
import java.awt.Color;
import java.awt.Font;
import java.awt.Point;
import java.awt.Dimension;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.Cursor;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JSpinner ;
import javax.swing.SpinnerNumberModel;
import javax.swing.SwingUtilities;
import javax.swing.SwingConstants ;
import javax.swing.event.ChangeListener ;
import javax.swing.event.ChangeEvent ;
import javax.swing.border.LineBorder ;
public class DateChooserJButton extends JButton {
private DateChooser dateChooser =null;
private String preLabel ="" ;
public DateChooserJButton() {
this(getNowDate()) ;
}
public DateChooserJButton(SimpleDateFormat df , String dateString) {
this() ;
setText(df,dateString);
}
public DateChooserJButton(Date date) {
this("",date);
}
public DateChooserJButton(String preLabel,Date date) {
if (preLabel!=null) this.preLabel = preLabel ;
setDate(date) ;
setBorder(null) ;
setCursor(new Cursor(Cursor.HAND_CURSOR)) ;
super.addActionListener( new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (dateChooser==null) dateChooser = new DateChooser();
Point p = getLocationOnScreen() ;
p.y = p.y+30 ;
dateChooser.showDateChooser(p) ;
}
}) ;
}
private static Date getNowDate() {
return Calendar.getInstance().getTime() ;
}
private static SimpleDateFormat getDefaultDateFormat() {
return new SimpleDateFormat("yyyy-MM-dd") ;
}
@Override
public void setText(String s) {
Date date ;
try {
date = getDefaultDateFormat().parse(s) ;
}catch (ParseException e) {
date = getNowDate() ;
}
setDate(date) ;
}
public void setText(SimpleDateFormat df , String s) {
Date date ;
try {
date = df.parse(s) ;
}catch (ParseException e) {
date = getNowDate() ;
}
setDate(date) ;
}
public void setDate(Date date) {
super.setText(preLabel+getDefaultDateFormat().format(date));
}
public Date getDate() {
String dateString = getText().substring(preLabel.length());
try {
return getDefaultDateFormat().parse(dateString);
} catch (ParseException e) {
return getNowDate() ;
}
}
@Override
public void addActionListener(ActionListener listener ) {
}
private class DateChooser extends JPanel implements ActionListener ,ChangeListener {
int startYear = Calendar.getInstance().get(Calendar.YEAR) - 10;
int lastYear = Calendar.getInstance().get(Calendar.YEAR);
int width = 200;
int height = 200;
Color backGroundColor = Color.gray;
Color palletTableColor = Color.white;
Color todayBackColor = Color.orange; //?
Color weekFontColor = Color.blue;
Color dateFontColor = Color.black;
Color weekendFontColor = Color.red;
Color controlLineColor = Color.pink;
Color controlTextColor = Color.white;
Color rbFontColor = Color.white;
Color rbBorderColor = Color.red;
Color rbButtonColor = Color.pink;
Color rbBtFontColor = Color.red;
JDialog dialog ;
JSpinner yearSpin ;
JSpinner monthSpin ;
JSpinner hourSpin ;
JButton[][] daysButton = new JButton[6][7] ;
DateChooser() {
setLayout(new BorderLayout());
setBorder(new LineBorder(backGroundColor, 2));
setBackground(backGroundColor);
JPanel topYearAndMonth = createYearAndMonthPanal();
add(topYearAndMonth,BorderLayout.NORTH);
JPanel centerWeekAndDay = createWeekAndDayPanal();
add(centerWeekAndDay,BorderLayout.CENTER);
}
private JPanel createYearAndMonthPanal(){
Calendar c = getCalendar() ;
int currentYear =c.get(Calendar.YEAR);
int currentMonth =c.get(Calendar.MONTH)+1;
JPanel result = new JPanel();
result.setLayout(new FlowLayout());
result.setBackground(controlLineColor);
yearSpin = new JSpinner(new SpinnerNumberModel(currentYear,
startYear,lastYear,1));
yearSpin.setPreferredSize(new Dimension(48,20)) ;
yearSpin.setName("Year") ;
yearSpin.setEditor(new JSpinner.NumberEditor(yearSpin, "####")) ;
yearSpin.addChangeListener(this) ;
result.add(yearSpin) ;
JLabel yearLabel = new JLabel("年");
yearLabel.setForeground(controlTextColor);
result.add(yearLabel);
monthSpin = new JSpinner(new SpinnerNumberModel(currentMonth,1,12,1));
monthSpin.setPreferredSize(new Dimension(35,20)) ;
monthSpin.setName("Month") ;
monthSpin.addChangeListener(this) ;
result.add(monthSpin) ;
JLabel monthLabel = new JLabel("月");
monthLabel.setForeground(controlTextColor);
result.add(monthLabel);
return result ;
}
private JPanel createWeekAndDayPanal() {
String colname[] = {"日","一","二","三","四","五","六"};
JPanel result = new JPanel();
result.setFont(new Font("宋体", Font.PLAIN, 12));
result.setLayout(new GridLayout(7,7));
result.setBackground(Color.white);
JLabel cell ;
for(int i=0;i<7;i++) {
cell = new JLabel(colname[i]);
cell.setHorizontalAlignment(JLabel.RIGHT);
if (i==0 || i==6) cell.setForeground(weekendFontColor) ;
else cell.setForeground(weekFontColor) ;
result.add(cell) ;
}
int actionCommandId = 0 ;
for(int i = 0; i < 6; i++)
for(int j = 0; j < 7; j++) {
JButton numberButton = new JButton();
numberButton.setBorder(null) ;
numberButton.setHorizontalAlignment(SwingConstants.RIGHT);
numberButton.setActionCommand(String.valueOf(actionCommandId)) ;
numberButton.addActionListener(this) ;
numberButton.setBackground(palletTableColor);
numberButton.setForeground(dateFontColor) ;
if (j==0 || j==6) numberButton.setForeground(weekendFontColor) ;
else numberButton.setForeground(dateFontColor) ;
daysButton[i][j] = numberButton;
result.add(numberButton) ;
actionCommandId ++ ;
}
return result;
}
private JDialog createDialog(Frame owner ) {
JDialog result = new JDialog(owner,"日期选择",true) ;
result.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
result.getContentPane().add(this,BorderLayout.CENTER) ;
result.pack() ;
result.setSize(width, height);
return result ;
}
protected void showDateChooser(Point position) {
Frame owner =(Frame)SwingUtilities.getWindowAncestor(
DateChooserJButton.this) ;
if (dialog==null || dialog.getOwner()!= owner)
dialog = createDialog(owner ) ;
dialog.setLocation(getAppropriateLocation(owner ,position ) ) ;
flushWeekAndDay() ;
dialog.setVisible(true);
}
protected Point getAppropriateLocation(Frame owner ,
Point position ) {
Point result = new Point(position) ;
Point p = owner.getLocation() ;
int offsetX = (position.x+width) - (p.x + owner.getWidth() ) ;
int offsetY = (position.y+height) - (p.y + owner.getHeight() ) ;
if (offsetX >0 ) {
result.x -= offsetX ;
}
if (offsetY >0 ) {
result.y -= offsetY ;
}
return result ;
}
private Calendar getCalendar() {
Calendar result = Calendar.getInstance();
result.setTime(getDate()) ;
return result ;
}
private int getSelectedYear() {
return ((Integer)yearSpin.getValue()).intValue() ;
}
private int getSelectedMonth() {
return ((Integer)monthSpin.getValue()).intValue() ;
}
private void dayColorUpdate(boolean isOldDay) {
Calendar c = getCalendar() ;
int day = c.get(Calendar.DAY_OF_MONTH);
c.set(Calendar.DAY_OF_MONTH,1);
int actionCommandId =day-2+c.get(Calendar.DAY_OF_WEEK) ;
int i = actionCommandId/7;
int j = actionCommandId%7;
if (isOldDay) daysButton[i][j].setForeground(dateFontColor) ;
else daysButton[i][j].setForeground(todayBackColor) ;
}
private void flushWeekAndDay() {
Calendar c = getCalendar() ;
c.set(Calendar.DAY_OF_MONTH,1);
int maxDayNo = c.getActualMaximum(Calendar.DAY_OF_MONTH);
int dayNo = 2 - c.get(Calendar.DAY_OF_WEEK) ;
for(int i = 0; i < 6; i++) {
for(int j = 0; j < 7; j++) {
String s="" ;
if (dayNo>=1 && dayNo<=maxDayNo ) s = String.valueOf(dayNo) ;
daysButton[i][j].setText(s) ;
dayNo ++ ;
}
}
dayColorUpdate(false) ;
}
@Override
public void stateChanged(ChangeEvent e) {
JSpinner source =(JSpinner)e.getSource() ;
Calendar c = getCalendar() ;
dayColorUpdate(true) ;
if (source.getName().equals("Year"))
c.set(Calendar.YEAR, getSelectedYear());
else if(source.getName().equals("Month"))
c.set(Calendar.MONTH, getSelectedMonth()-1);
setDate(c.getTime());
flushWeekAndDay() ;
}
@Override
public void actionPerformed(ActionEvent e) {
JButton source =(JButton)e.getSource() ;
if (source.getText().length()==0) return ;
dayColorUpdate(true) ;
source.setForeground(todayBackColor) ;
int newDay = Integer.parseInt(source.getText());
Calendar c = getCalendar() ;
c.set(Calendar.DAY_OF_MONTH,newDay);
setDate(c.getTime());
}
}
public static void main(String[] args) {
JFrame f = new JFrame();
DateChooserJButton d = new DateChooserJButton();
f.add(d);
f.setBounds(100, 100, 200, 200);
f.setVisible(true);
}
}
import java.util.Date;
import java.util.Calendar;
import java.text.SimpleDateFormat;
import java.text.ParseException ;
import java.awt.Color;
import java.awt.Font;
import java.awt.Point;
import java.awt.Dimension;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.Cursor;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JSpinner ;
import javax.swing.SpinnerNumberModel;
import javax.swing.SwingUtilities;
import javax.swing.SwingConstants ;
import javax.swing.event.ChangeListener ;
import javax.swing.event.ChangeEvent ;
import javax.swing.border.LineBorder ;
public class DateChooserJButton extends JButton {
private DateChooser dateChooser =null;
private String preLabel ="" ;
public DateChooserJButton() {
this(getNowDate()) ;
}
public DateChooserJButton(SimpleDateFormat df , String dateString) {
this() ;
setText(df,dateString);
}
public DateChooserJButton(Date date) {
this("",date);
}
public DateChooserJButton(String preLabel,Date date) {
if (preLabel!=null) this.preLabel = preLabel ;
setDate(date) ;
setBorder(null) ;
setCursor(new Cursor(Cursor.HAND_CURSOR)) ;
super.addActionListener( new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (dateChooser==null) dateChooser = new DateChooser();
Point p = getLocationOnScreen() ;
p.y = p.y+30 ;
dateChooser.showDateChooser(p) ;
}
}) ;
}
private static Date getNowDate() {
return Calendar.getInstance().getTime() ;
}
private static SimpleDateFormat getDefaultDateFormat() {
return new SimpleDateFormat("yyyy-MM-dd") ;
}
@Override
public void setText(String s) {
Date date ;
try {
date = getDefaultDateFormat().parse(s) ;
}catch (ParseException e) {
date = getNowDate() ;
}
setDate(date) ;
}
public void setText(SimpleDateFormat df , String s) {
Date date ;
try {
date = df.parse(s) ;
}catch (ParseException e) {
date = getNowDate() ;
}
setDate(date) ;
}
public void setDate(Date date) {
super.setText(preLabel+getDefaultDateFormat().format(date));
}
public Date getDate() {
String dateString = getText().substring(preLabel.length());
try {
return getDefaultDateFormat().parse(dateString);
} catch (ParseException e) {
return getNowDate() ;
}
}
@Override
public void addActionListener(ActionListener listener ) {
}
private class DateChooser extends JPanel implements ActionListener ,ChangeListener {
int startYear = Calendar.getInstance().get(Calendar.YEAR) - 10;
int lastYear = Calendar.getInstance().get(Calendar.YEAR);
int width = 200;
int height = 200;
Color backGroundColor = Color.gray;
Color palletTableColor = Color.white;
Color todayBackColor = Color.orange; //?
Color weekFontColor = Color.blue;
Color dateFontColor = Color.black;
Color weekendFontColor = Color.red;
Color controlLineColor = Color.pink;
Color controlTextColor = Color.white;
Color rbFontColor = Color.white;
Color rbBorderColor = Color.red;
Color rbButtonColor = Color.pink;
Color rbBtFontColor = Color.red;
JDialog dialog ;
JSpinner yearSpin ;
JSpinner monthSpin ;
JSpinner hourSpin ;
JButton[][] daysButton = new JButton[6][7] ;
DateChooser() {
setLayout(new BorderLayout());
setBorder(new LineBorder(backGroundColor, 2));
setBackground(backGroundColor);
JPanel topYearAndMonth = createYearAndMonthPanal();
add(topYearAndMonth,BorderLayout.NORTH);
JPanel centerWeekAndDay = createWeekAndDayPanal();
add(centerWeekAndDay,BorderLayout.CENTER);
}
private JPanel createYearAndMonthPanal(){
Calendar c = getCalendar() ;
int currentYear =c.get(Calendar.YEAR);
int currentMonth =c.get(Calendar.MONTH)+1;
JPanel result = new JPanel();
result.setLayout(new FlowLayout());
result.setBackground(controlLineColor);
yearSpin = new JSpinner(new SpinnerNumberModel(currentYear,
startYear,lastYear,1));
yearSpin.setPreferredSize(new Dimension(48,20)) ;
yearSpin.setName("Year") ;
yearSpin.setEditor(new JSpinner.NumberEditor(yearSpin, "####")) ;
yearSpin.addChangeListener(this) ;
result.add(yearSpin) ;
JLabel yearLabel = new JLabel("年");
yearLabel.setForeground(controlTextColor);
result.add(yearLabel);
monthSpin = new JSpinner(new SpinnerNumberModel(currentMonth,1,12,1));
monthSpin.setPreferredSize(new Dimension(35,20)) ;
monthSpin.setName("Month") ;
monthSpin.addChangeListener(this) ;
result.add(monthSpin) ;
JLabel monthLabel = new JLabel("月");
monthLabel.setForeground(controlTextColor);
result.add(monthLabel);
return result ;
}
private JPanel createWeekAndDayPanal() {
String colname[] = {"日","一","二","三","四","五","六"};
JPanel result = new JPanel();
result.setFont(new Font("宋体", Font.PLAIN, 12));
result.setLayout(new GridLayout(7,7));
result.setBackground(Color.white);
JLabel cell ;
for(int i=0;i<7;i++) {
cell = new JLabel(colname[i]);
cell.setHorizontalAlignment(JLabel.RIGHT);
if (i==0 || i==6) cell.setForeground(weekendFontColor) ;
else cell.setForeground(weekFontColor) ;
result.add(cell) ;
}
int actionCommandId = 0 ;
for(int i = 0; i < 6; i++)
for(int j = 0; j < 7; j++) {
JButton numberButton = new JButton();
numberButton.setBorder(null) ;
numberButton.setHorizontalAlignment(SwingConstants.RIGHT);
numberButton.setActionCommand(String.valueOf(actionCommandId)) ;
numberButton.addActionListener(this) ;
numberButton.setBackground(palletTableColor);
numberButton.setForeground(dateFontColor) ;
if (j==0 || j==6) numberButton.setForeground(weekendFontColor) ;
else numberButton.setForeground(dateFontColor) ;
daysButton[i][j] = numberButton;
result.add(numberButton) ;
actionCommandId ++ ;
}
return result;
}
private JDialog createDialog(Frame owner ) {
JDialog result = new JDialog(owner,"日期选择",true) ;
result.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
result.getContentPane().add(this,BorderLayout.CENTER) ;
result.pack() ;
result.setSize(width, height);
return result ;
}
protected void showDateChooser(Point position) {
Frame owner =(Frame)SwingUtilities.getWindowAncestor(
DateChooserJButton.this) ;
if (dialog==null || dialog.getOwner()!= owner)
dialog = createDialog(owner ) ;
dialog.setLocation(getAppropriateLocation(owner ,position ) ) ;
flushWeekAndDay() ;
dialog.setVisible(true);
}
protected Point getAppropriateLocation(Frame owner ,
Point position ) {
Point result = new Point(position) ;
Point p = owner.getLocation() ;
int offsetX = (position.x+width) - (p.x + owner.getWidth() ) ;
int offsetY = (position.y+height) - (p.y + owner.getHeight() ) ;
if (offsetX >0 ) {
result.x -= offsetX ;
}
if (offsetY >0 ) {
result.y -= offsetY ;
}
return result ;
}
private Calendar getCalendar() {
Calendar result = Calendar.getInstance();
result.setTime(getDate()) ;
return result ;
}
private int getSelectedYear() {
return ((Integer)yearSpin.getValue()).intValue() ;
}
private int getSelectedMonth() {
return ((Integer)monthSpin.getValue()).intValue() ;
}
private void dayColorUpdate(boolean isOldDay) {
Calendar c = getCalendar() ;
int day = c.get(Calendar.DAY_OF_MONTH);
c.set(Calendar.DAY_OF_MONTH,1);
int actionCommandId =day-2+c.get(Calendar.DAY_OF_WEEK) ;
int i = actionCommandId/7;
int j = actionCommandId%7;
if (isOldDay) daysButton[i][j].setForeground(dateFontColor) ;
else daysButton[i][j].setForeground(todayBackColor) ;
}
private void flushWeekAndDay() {
Calendar c = getCalendar() ;
c.set(Calendar.DAY_OF_MONTH,1);
int maxDayNo = c.getActualMaximum(Calendar.DAY_OF_MONTH);
int dayNo = 2 - c.get(Calendar.DAY_OF_WEEK) ;
for(int i = 0; i < 6; i++) {
for(int j = 0; j < 7; j++) {
String s="" ;
if (dayNo>=1 && dayNo<=maxDayNo ) s = String.valueOf(dayNo) ;
daysButton[i][j].setText(s) ;
dayNo ++ ;
}
}
dayColorUpdate(false) ;
}
@Override
public void stateChanged(ChangeEvent e) {
JSpinner source =(JSpinner)e.getSource() ;
Calendar c = getCalendar() ;
dayColorUpdate(true) ;
if (source.getName().equals("Year"))
c.set(Calendar.YEAR, getSelectedYear());
else if(source.getName().equals("Month"))
c.set(Calendar.MONTH, getSelectedMonth()-1);
setDate(c.getTime());
flushWeekAndDay() ;
}
@Override
public void actionPerformed(ActionEvent e) {
JButton source =(JButton)e.getSource() ;
if (source.getText().length()==0) return ;
dayColorUpdate(true) ;
source.setForeground(todayBackColor) ;
int newDay = Integer.parseInt(source.getText());
Calendar c = getCalendar() ;
c.set(Calendar.DAY_OF_MONTH,newDay);
setDate(c.getTime());
}
}
public static void main(String[] args) {
JFrame f = new JFrame();
DateChooserJButton d = new DateChooserJButton();
f.add(d);
f.setBounds(100, 100, 200, 200);
f.setVisible(true);
}
}
相关推荐
`JAVA SWING 日期控件` 提供了这样的功能,它主要用于帮助用户在GUI应用程序中选择日期。这篇博客(博文链接:https://zgdeng.iteye.com/blog/1405459)可能详细介绍了如何实现一个自定义的日期选择组件,目前该控件...
在 Swing 中,日期控件主要用于用户交互,允许用户选择或输入日期。这些控件使得应用程序可以方便地处理与日期相关的功能,例如日程管理、事件记录等。 在Java Swing 中,最常用的日期控件是 JCalendar 和 ...
在Swing中,日期控件主要用于用户选择或输入日期。在这个特定的资源中,我们关注的是一个经过二次封装的日期组件,用于改进原始的日期选择功能。 标题提到的"Swing 日期控件"是指在Swing应用中用来显示和选择日期的...
在Swing中,日期控件主要用于显示和选择日期,为用户提供直观的日期选择界面。本篇文章将深入探讨Java Swing中的日期控件,包括其功能、用法以及相关的API。 ### 1. `JDatePicker` `JDatePicker` 是Swing中最常用...
标签“java日期控件”强调了这个主题关注的是Java中与日期选择相关的控件,不仅仅是Swing,也可能是JavaFX或其他库提供的日期选择组件。但在这里,我们主要讨论的是Swing环境下的实现。 在压缩包的"swing 时间控件...
在Java Swing中,日期选择控件(DatePicker)是用于用户交互,方便他们选择特定日期的组件。Swing本身并没有内置的DatePicker控件,但开发者通常会利用第三方库来实现这一功能。这里提到的"swing 日期选择控件"很...
本资源就是关于一个重写过的Java Swing日期控件,修复了之前版本缺少jar包的问题。 `DatePicker` 和 `DateField` 是可能代表日期选择组件的类名称。这两个类可能是这个修复版日期控件的核心组成部分。`DatePicker` ...
在Swing中,DatePicker是一个非常实用的控件,允许用户方便地选择日期,通常用于输入或显示日期相关的数据。在Java Swing中并没有内置的DatePicker组件,但开发者可以借助第三方库来实现这一功能,例如JCalendar。 ...
在处理日期和时间选择时,Swing虽然没有内置的日期选择器,但可以通过第三方库来实现,例如"JDateField.jar"就是这样一个专门用于日期输入的控件。 "JDateField.jar"是一个第三方库,它提供了日期选择的功能,使得...
在Swing中,日期控件是非常常见且重要的组件,它们允许用户选择或输入日期。本篇主要介绍Swing中的日期控件及其使用方法。 在Swing中,JCalendar和JDatePicker是常用的日期选择组件。JCalendar是一个全功能的日历...
swing 日期选择器 支持点击文本框选择 和自定义按钮选择
Swing日期控件介绍 Swing并没有内置专门的日期选择控件,但可以通过第三方库如JDatePicker来实现。JDatePicker是Java日期选择器的一个流行实现,它为Swing应用程序提供了方便的日期输入和显示功能。 ### 2. ...
在Swing中,时间控件通常指的是可以展示和处理日期与时间的组件。本主题将深入讲解如何在Java Swing中创建和使用时间控件,以及如何利用事件回调进行交互。 1. **JCalendar**: Java Swing 并未内置专门的时间或日期...
一个简单的Java Swing时间日期选择控件的代码示例,带有中文注释 代码创建了一个简单的Java Swing时间日期选择器,包含一个输入框、一个按钮和一个日期标签。 当点击按钮时,会获取当前时间日期并显示在输入框中。 ...
Swing Datepicker时间选择器是一个在Java Swing库中用于处理日期选择的组件,它提供了用户友好的界面,允许用户在应用程序中方便地选取日期。在Java编程中,Swing库是一个丰富的图形用户界面(GUI)工具包,它是Java ...
总结来说,Java Swing中的日期控件主要分为JCalendar和JDatePicker,它们为用户提供了直观的日期选择方式,能够增强桌面应用程序的交互性。通过引入相应的第三方库,开发者可以轻松地在Swing应用中集成这些组件,并...
Swing日期选择控件,对原控件作了一些修改,增加了月份选择的控件。把图标换成了黑白的了,感觉彩色的太花。 xDatePicker是日期选择控件 xMonthPicker是月份选择控件
总的来说,`JCalendar`是一个强大的Java Swing日期控件,能够极大地提升用户体验,并简化开发者处理日期选择问题的工作。结合其丰富的功能和良好的扩展性,`JCalendar`在许多Java桌面应用中都得到了广泛的应用。
JavaSwing日历控件宝典是Java Swing编程中一个非常实用的控件,旨在提供一个美观易用的日期选择器控件。下面是关于该控件的详细说明。 控件概述 JavaSwing日历控件是一个继承自JComponent的控件,提供了一个美观的...