当前位置: 技术问答>java相关
調用日歷的問題
来源: 互联网 发布时间:2015-06-15
本文导语: Java中用什么方法調用日立選擇對話框,並將選擇的結果顯示在JFrield中。 | 你可以通过jb的Design将这这个控件添加到当前Swing栏里面去的说, 在工具包Sitraka JClass Gauge 4.5.1里面,属于javabean...
Java中用什么方法調用日立選擇對話框,並將選擇的結果顯示在JFrield中。
|
你可以通过jb的Design将这这个控件添加到当前Swing栏里面去的说,
在工具包Sitraka JClass Gauge 4.5.1里面,属于javabeans,
所在目录com/klg/jclass/util/calendar/resources/JCDateChooser
在工具包Sitraka JClass Gauge 4.5.1里面,属于javabeans,
所在目录com/klg/jclass/util/calendar/resources/JCDateChooser
|
import java.awt.*;
import java.util.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.border.*;
import java.lang.*;
public class DatePopup extends JDialog implements java.awt.event.ActionListener
{
private JPanel mPanel1 = new JPanel();
private JPanel mPanel2 = new JPanel();
private JPanel mPanel3 = new JPanel();
private JPanel mPanel4 = new JPanel();
private JButton mNewButton;
private JTextField mText;
private int mDay;
private int mMonth;
private int mYear;
private int mTheDate;
private int i = 0;
private int j = 0;
public DatePopup(JTextField pText)
{
super(new JFrame(),"日期选择",true);
this.mText = pText;
try
{
DatePopupInit();
pack();
}
catch(Exception e)
{
e.printStackTrace();
}
}
/**
* 控件的初始化方法。
*/
private void DatePopupInit()
{
//设置主窗口布局
Container contentPane = getContentPane();
contentPane.setLayout(new BorderLayout());
mPanel1.setLayout(new BorderLayout());
mPanel1.setBorder(new TitledBorder(BorderFactory.createLineBorder(Color.white,1),"日期选择"));
Calendar nowCalendar = Calendar.getInstance();
this.mTheDate = nowCalendar.get(Calendar.DAY_OF_WEEK);
this.mDay = nowCalendar.get(Calendar.DAY_OF_MONTH);
this.mMonth = nowCalendar.get(Calendar.MONTH);
this.mYear = nowCalendar.get(Calendar.YEAR);
//设置mPanel2
JComboBox comboMonth = new JComboBox();
comboMonth.setActionCommand("MonthSelect");
for(i=1;i
import java.util.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.border.*;
import java.lang.*;
public class DatePopup extends JDialog implements java.awt.event.ActionListener
{
private JPanel mPanel1 = new JPanel();
private JPanel mPanel2 = new JPanel();
private JPanel mPanel3 = new JPanel();
private JPanel mPanel4 = new JPanel();
private JButton mNewButton;
private JTextField mText;
private int mDay;
private int mMonth;
private int mYear;
private int mTheDate;
private int i = 0;
private int j = 0;
public DatePopup(JTextField pText)
{
super(new JFrame(),"日期选择",true);
this.mText = pText;
try
{
DatePopupInit();
pack();
}
catch(Exception e)
{
e.printStackTrace();
}
}
/**
* 控件的初始化方法。
*/
private void DatePopupInit()
{
//设置主窗口布局
Container contentPane = getContentPane();
contentPane.setLayout(new BorderLayout());
mPanel1.setLayout(new BorderLayout());
mPanel1.setBorder(new TitledBorder(BorderFactory.createLineBorder(Color.white,1),"日期选择"));
Calendar nowCalendar = Calendar.getInstance();
this.mTheDate = nowCalendar.get(Calendar.DAY_OF_WEEK);
this.mDay = nowCalendar.get(Calendar.DAY_OF_MONTH);
this.mMonth = nowCalendar.get(Calendar.MONTH);
this.mYear = nowCalendar.get(Calendar.YEAR);
//设置mPanel2
JComboBox comboMonth = new JComboBox();
comboMonth.setActionCommand("MonthSelect");
for(i=1;i
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
站内导航:
特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!