|
|
|
@ -7,8 +7,8 @@ import com.fr.design.gui.ibutton.UIButton;
|
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
import com.fr.design.gui.itextfield.UITextField; |
|
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
|
import com.fr.design.utils.DesignUtils; |
|
|
|
|
import com.fr.design.utils.gui.GUIPaintUtils; |
|
|
|
|
|
|
|
|
|
import com.fr.stable.Constants; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
|
|
|
|
@ -45,8 +45,8 @@ import java.util.Calendar;
|
|
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
|
|
public class UICalendarPanel extends JPanel { |
|
|
|
|
private static final Font FONT_SONG = new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Song_TypeFace"),0,12); |
|
|
|
|
private static final Font FONT_BLACK = new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Black_Font"),0,12); |
|
|
|
|
private static final Font FONT_UI = DesignUtils.getDefaultGUIFont().applySize(12); |
|
|
|
|
private static final Font FONT_BLACK = new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Black_Font"), Font.PLAIN, 12); |
|
|
|
|
private static final int WEEKDAY_COUNT = 7; |
|
|
|
|
private static final int TOTAL_DAYS_COUNT = 42; |
|
|
|
|
|
|
|
|
@ -108,13 +108,13 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// << < yyyy/MM/dd > >>
|
|
|
|
|
private JPanel createNorthPane () { |
|
|
|
|
private JPanel createNorthPane() { |
|
|
|
|
JPanel pNorth = FRGUIPaneFactory.createX_AXISBoxInnerContainer_S_Pane(); |
|
|
|
|
pNorth.setBackground(new Color(0xFFFFFF)); |
|
|
|
|
pNorth.setPreferredSize(new Dimension(1, 22)); |
|
|
|
|
|
|
|
|
|
pNorth.add(Box.createHorizontalStrut(5)); |
|
|
|
|
pNorth.add(createSkipButton(Calendar.YEAR, -1 , new Icon[] { |
|
|
|
|
pNorth.add(createSkipButton(Calendar.YEAR, -1, new Icon[]{ |
|
|
|
|
BaseUtils.readIcon("/com/fr/design/images/calender/year_reduce.png"), |
|
|
|
|
BaseUtils.readIcon("/com/fr/design/images/calender/year_reduce_hover.png"), |
|
|
|
|
BaseUtils.readIcon("/com/fr/design/images/calender/year_reduce_click.png") |
|
|
|
@ -130,7 +130,7 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
monthLabel = new UILabel("", UILabel.CENTER); |
|
|
|
|
monthLabel.setBackground(new Color(0xFFFFFF)); |
|
|
|
|
monthLabel.setForeground(new Color(0x000000)); |
|
|
|
|
monthLabel.setFont(FONT_SONG); |
|
|
|
|
monthLabel.setFont(FONT_UI); |
|
|
|
|
pNorth.add(Box.createHorizontalGlue()); |
|
|
|
|
pNorth.add(monthLabel); |
|
|
|
|
pNorth.add(Box.createHorizontalGlue()); |
|
|
|
@ -144,7 +144,7 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
monthPlus.setHorizontalAlignment(SwingConstants.RIGHT); |
|
|
|
|
pNorth.add(monthPlus); |
|
|
|
|
pNorth.add(Box.createHorizontalStrut(11)); |
|
|
|
|
pNorth.add(createSkipButton(Calendar.YEAR, 1 , new Icon[] { |
|
|
|
|
pNorth.add(createSkipButton(Calendar.YEAR, 1, new Icon[]{ |
|
|
|
|
BaseUtils.readIcon("/com/fr/design/images/calender/year_add.png"), |
|
|
|
|
BaseUtils.readIcon("/com/fr/design/images/calender/year_add_hover.png"), |
|
|
|
|
BaseUtils.readIcon("/com/fr/design/images/calender/year_add_click.png") |
|
|
|
@ -161,9 +161,9 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
pWeeks.setPreferredSize(new Dimension(216, 22)); |
|
|
|
|
pWeeks.setBackground(new Color(0xFFFFFF)); |
|
|
|
|
pWeeks.setOpaque(true); |
|
|
|
|
String[] strWeeks = new String[] {StringUtils.EMPTY, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sun"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Mon"), |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tue"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Wed"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Thu"), |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Fri"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Sat") |
|
|
|
|
String[] strWeeks = new String[]{StringUtils.EMPTY, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sun"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Mon"), |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tue"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Wed"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Thu"), |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Fri"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Sat") |
|
|
|
|
}; |
|
|
|
|
for (int i = 1; i <= WEEKDAY_COUNT; i++) { |
|
|
|
|
UILabel label = new UILabel(); |
|
|
|
@ -197,32 +197,32 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
return pCenter; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createSouthPane () { |
|
|
|
|
private JPanel createSouthPane() { |
|
|
|
|
JPanel sPane = new JPanel(); |
|
|
|
|
sPane.setPreferredSize(new Dimension(216, 30)); |
|
|
|
|
sPane.setBackground(Color.WHITE); |
|
|
|
|
sPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 6)); |
|
|
|
|
UILabel timeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Time") + ":"); |
|
|
|
|
timeLabel.setBorder(BorderFactory.createEmptyBorder(0,9,0,5)); |
|
|
|
|
timeLabel.setFont(FONT_SONG); |
|
|
|
|
timeLabel.setBorder(BorderFactory.createEmptyBorder(0, 9, 0, 5)); |
|
|
|
|
timeLabel.setFont(FONT_UI); |
|
|
|
|
sPane.add(timeLabel); |
|
|
|
|
hms = new HMSPane(); |
|
|
|
|
sPane.add(hms); |
|
|
|
|
|
|
|
|
|
UILabel gap = new UILabel(); |
|
|
|
|
gap.setPreferredSize(new Dimension(26,1)); |
|
|
|
|
gap.setPreferredSize(new Dimension(26, 1)); |
|
|
|
|
sPane.add(gap); |
|
|
|
|
|
|
|
|
|
UIButton okButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")) { |
|
|
|
|
public Dimension getPreferredSize() { |
|
|
|
|
return new Dimension(32,18); |
|
|
|
|
return new Dimension(32, 18); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Insets getInsets() { |
|
|
|
|
return new Insets(0, 0, 0, 0); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
okButton.setFont(FONT_SONG); |
|
|
|
|
okButton.setFont(FONT_UI); |
|
|
|
|
okButton.setVerticalAlignment(SwingConstants.CENTER); |
|
|
|
|
okButton.addActionListener(new ActionListener() { |
|
|
|
|
|
|
|
|
@ -248,11 +248,12 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 创建上一月,下一月,上一年,下一年"按钮" |
|
|
|
|
* |
|
|
|
|
* @param field int |
|
|
|
|
* @param amount int |
|
|
|
|
* @return UILabel |
|
|
|
|
*/ |
|
|
|
|
protected UILabel createSkipButton(final int field, final int amount,final Icon[] icons) { |
|
|
|
|
protected UILabel createSkipButton(final int field, final int amount, final Icon[] icons) { |
|
|
|
|
if (icons.length != 3) { |
|
|
|
|
return new UILabel(); |
|
|
|
|
} |
|
|
|
@ -311,7 +312,7 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
gp.setBorder(null); |
|
|
|
|
UIDayLabel label = new UIDayLabel(setupCalendar.getTime()); |
|
|
|
|
label.setHorizontalAlignment(SwingConstants.RIGHT); |
|
|
|
|
label.setBorder(BorderFactory.createEmptyBorder(0,0,0,9)); |
|
|
|
|
label.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 9)); |
|
|
|
|
label.addMouseListener(dayBttListener); |
|
|
|
|
if ("1".equals(label.getText())) { |
|
|
|
|
isCurrentMonth = !isCurrentMonth; |
|
|
|
@ -328,7 +329,7 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
days.setSelectedIndex(i); |
|
|
|
|
this.selectedDate = label.getDate(); |
|
|
|
|
this.calendar.setTime(this.selectedDate); |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
gp.add(label, BorderLayout.CENTER); |
|
|
|
|
days.add(gp); |
|
|
|
|
} |
|
|
|
@ -337,7 +338,7 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void updateHMS() { |
|
|
|
|
if (hms != null){ |
|
|
|
|
if (hms != null) { |
|
|
|
|
hms.populate(this.calendar); |
|
|
|
|
hms.validate(); |
|
|
|
|
} |
|
|
|
@ -388,9 +389,9 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
|
if (isEnabled()) { |
|
|
|
|
UIDayLabel com = (UIDayLabel) e.getComponent(); |
|
|
|
|
GradientPane gp = (GradientPane)com.getParent(); |
|
|
|
|
GradientPane gp = (GradientPane) com.getParent(); |
|
|
|
|
if (days.selectedIndex != -1) { |
|
|
|
|
((GradientPane)days.getComponent(days.selectedIndex)).setGradientBackground(new GradientBackground(new Color(0xFEFEFE), new Color(0xF3F2F3), GradientBackground.TOP2BOTTOM)); |
|
|
|
|
((GradientPane) days.getComponent(days.selectedIndex)).setGradientBackground(new GradientBackground(new Color(0xFEFEFE), new Color(0xF3F2F3), GradientBackground.TOP2BOTTOM)); |
|
|
|
|
} |
|
|
|
|
gp.setGradientBackground(new GradientBackground(new Color(0x097BD9), new Color(0x41A3EE), GradientBackground.TOP2BOTTOM)); |
|
|
|
|
days.setSelectedIndex(gp.getIndex()); |
|
|
|
@ -413,7 +414,7 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
public void mouseEntered(MouseEvent e) { |
|
|
|
|
if (isEnabled()) { |
|
|
|
|
JComponent com = (JComponent) e.getComponent(); |
|
|
|
|
GradientPane gp = (GradientPane)com.getParent(); |
|
|
|
|
GradientPane gp = (GradientPane) com.getParent(); |
|
|
|
|
if (gp.getIndex() == days.selectedIndex) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
@ -426,7 +427,7 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
public void mouseExited(MouseEvent e) { |
|
|
|
|
if (isEnabled()) { |
|
|
|
|
JComponent com = (JComponent) e.getComponent(); |
|
|
|
|
GradientPane gp = (GradientPane)com.getParent(); |
|
|
|
|
GradientPane gp = (GradientPane) com.getParent(); |
|
|
|
|
if (gp.getIndex() != days.selectedIndex) { |
|
|
|
|
gp.setGradientBackground(new GradientBackground(new Color(0xFEFEFE), new Color(0xF3F2F3), GradientBackground.TOP2BOTTOM)); |
|
|
|
|
} |
|
|
|
@ -489,7 +490,7 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
this.isGradientBackground = isGradientBackground; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void paint(Graphics g){ |
|
|
|
|
public void paint(Graphics g) { |
|
|
|
|
super.paint(g); |
|
|
|
|
if (isGradientBackground && gradientBackground != null) { |
|
|
|
|
gradientBackground.paint(g, new Rectangle(this.getWidth(), this.getHeight())); |
|
|
|
@ -509,7 +510,7 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
this.index = i; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public int getIndex () { |
|
|
|
|
public int getIndex() { |
|
|
|
|
return this.index; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -530,12 +531,12 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
public DayPane() { |
|
|
|
|
floateIndex = -1; |
|
|
|
|
selectedIndex = -1; |
|
|
|
|
this.setLayout(new GridLayout(6,7,1,1)); |
|
|
|
|
this.setLayout(new GridLayout(6, 7, 1, 1)); |
|
|
|
|
this.setBackground(new Color(0xFFFFFF)); |
|
|
|
|
this.setBorder(BorderFactory.createMatteBorder(1, 0, 1, 0, new Color(0xDADADA))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void paint (Graphics g) { |
|
|
|
|
public void paint(Graphics g) { |
|
|
|
|
super.paint(g); |
|
|
|
|
int width = 31; |
|
|
|
|
int height = 19; |
|
|
|
@ -543,11 +544,11 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
g.setColor(new Color(0xDADADA)); |
|
|
|
|
int start_x = 30; |
|
|
|
|
int start_y = 19; |
|
|
|
|
for (int i = 0; i < 6; i ++) { |
|
|
|
|
for (int i = 0; i < 6; i++) { |
|
|
|
|
g.drawLine(start_x, 0, start_x, getHeight()); |
|
|
|
|
start_x += width; |
|
|
|
|
} |
|
|
|
|
for (int i = 0; i < 5; i ++){ |
|
|
|
|
for (int i = 0; i < 5; i++) { |
|
|
|
|
g.drawLine(0, start_y, getWidth(), start_y); |
|
|
|
|
start_y += height; |
|
|
|
|
} |
|
|
|
@ -558,25 +559,25 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
} |
|
|
|
|
if (selectedIndex > -1) { |
|
|
|
|
g.setColor(selectedColor); |
|
|
|
|
paintChindPane(g,selectedIndex); |
|
|
|
|
paintChindPane(g, selectedIndex); |
|
|
|
|
} |
|
|
|
|
g.setColor(oldColor); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void paintChindPane(Graphics g, int index) { |
|
|
|
|
if (index%7 == 0 ) { |
|
|
|
|
int y1 = index/7*19; |
|
|
|
|
g.drawLine(0,y1,30,y1); |
|
|
|
|
g.drawLine(0,y1 + 19, 30, y1 +19); |
|
|
|
|
g.drawLine(30, y1, 30 ,y1 + 19); |
|
|
|
|
}else if (index%7 == 6) { |
|
|
|
|
int y1 = index/7*19; |
|
|
|
|
g.drawLine(185,y1,216,y1); |
|
|
|
|
g.drawLine(185,y1 + 19, 216, y1 +19); |
|
|
|
|
g.drawLine(185, y1, 185 ,y1 + 19); |
|
|
|
|
if (index % 7 == 0) { |
|
|
|
|
int y1 = index / 7 * 19; |
|
|
|
|
g.drawLine(0, y1, 30, y1); |
|
|
|
|
g.drawLine(0, y1 + 19, 30, y1 + 19); |
|
|
|
|
g.drawLine(30, y1, 30, y1 + 19); |
|
|
|
|
} else if (index % 7 == 6) { |
|
|
|
|
int y1 = index / 7 * 19; |
|
|
|
|
g.drawLine(185, y1, 216, y1); |
|
|
|
|
g.drawLine(185, y1 + 19, 216, y1 + 19); |
|
|
|
|
g.drawLine(185, y1, 185, y1 + 19); |
|
|
|
|
} else { |
|
|
|
|
int x1 = index%7*31 -1; |
|
|
|
|
int y1 = index/7*19; |
|
|
|
|
int x1 = index % 7 * 31 - 1; |
|
|
|
|
int y1 = index / 7 * 19; |
|
|
|
|
g.drawRect(x1, y1, 31, 19); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -599,7 +600,7 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private class HMSPane extends JPanel{ |
|
|
|
|
private class HMSPane extends JPanel { |
|
|
|
|
private boolean isRolOver; |
|
|
|
|
private UIButton preButton; |
|
|
|
|
private UIButton nextButton; |
|
|
|
@ -608,7 +609,7 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
private CalendarNumberField sField; |
|
|
|
|
private CalendarNumberField selectedNumberField; |
|
|
|
|
|
|
|
|
|
public HMSPane () { |
|
|
|
|
public HMSPane() { |
|
|
|
|
this.setPreferredSize(new Dimension(101, 18)); |
|
|
|
|
this.setLayout(new BorderLayout(0, 0)); |
|
|
|
|
this.setBackground(null); |
|
|
|
@ -633,7 +634,7 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initComponents() { |
|
|
|
|
JPanel jp = new JPanel(new FlowLayout(FlowLayout.LEFT,0,2)); |
|
|
|
|
JPanel jp = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 2)); |
|
|
|
|
jp.setBackground(null); |
|
|
|
|
jp.setBorder(null); |
|
|
|
|
|
|
|
|
@ -649,13 +650,13 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
jp.add(sField); |
|
|
|
|
|
|
|
|
|
this.add(jp, BorderLayout.CENTER); |
|
|
|
|
preButton = new UIButton(UIConstants.ARROW_UP_ICON){ |
|
|
|
|
preButton = new UIButton(UIConstants.ARROW_UP_ICON) { |
|
|
|
|
public boolean shouldResponseChangeListener() { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
preButton.setRoundBorder(true, Constants.LEFT); |
|
|
|
|
nextButton = new UIButton(UIConstants.ARROW_DOWN_ICON){ |
|
|
|
|
nextButton = new UIButton(UIConstants.ARROW_DOWN_ICON) { |
|
|
|
|
public boolean shouldResponseChangeListener() { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
@ -673,7 +674,7 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
MouseAdapter backgroundAdapter = new MouseAdapter() { |
|
|
|
|
@Override |
|
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
|
HMSPane.this.selectedNumberField = (CalendarNumberField)e.getComponent(); |
|
|
|
|
HMSPane.this.selectedNumberField = (CalendarNumberField) e.getComponent(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -710,17 +711,17 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private UILabel createGapLabel () { |
|
|
|
|
private UILabel createGapLabel() { |
|
|
|
|
UILabel uiLabel = new UILabel(":"); |
|
|
|
|
uiLabel.setHorizontalAlignment(SwingConstants.CENTER); |
|
|
|
|
uiLabel.setBackground(null); |
|
|
|
|
uiLabel.setBorder(null); |
|
|
|
|
uiLabel.setPreferredSize(new Dimension(6,10)); |
|
|
|
|
uiLabel.setPreferredSize(new Dimension(6, 10)); |
|
|
|
|
return uiLabel; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Insets getInsets() { |
|
|
|
|
return new Insets(1,3,1,0); |
|
|
|
|
return new Insets(1, 3, 1, 0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void paint(Graphics g) { |
|
|
|
@ -729,7 +730,7 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void paintBorder(Graphics g) { |
|
|
|
|
Graphics2D g2d = (Graphics2D)g; |
|
|
|
|
Graphics2D g2d = (Graphics2D) g; |
|
|
|
|
if (isRolOver) { |
|
|
|
|
Shape shape = new RoundRectangle2D.Double(1, 1, 86, 15, UIConstants.ARC, UIConstants.ARC); |
|
|
|
|
GUIPaintUtils.paintBorderShadow(g2d, 3, shape, UIConstants.HOVER_BLUE, Color.WHITE); |
|
|
|
@ -738,7 +739,7 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void populate(Calendar calendar){ |
|
|
|
|
public void populate(Calendar calendar) { |
|
|
|
|
this.hField.setValue(calendar.get(Calendar.HOUR_OF_DAY)); |
|
|
|
|
this.mField.setValue(calendar.get(Calendar.MINUTE)); |
|
|
|
|
this.sField.setValue(calendar.get(Calendar.SECOND)); |
|
|
|
@ -751,15 +752,15 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static void main(String[] args){ |
|
|
|
|
public static void main(String[] args) { |
|
|
|
|
JFrame frame = new JFrame(); |
|
|
|
|
|
|
|
|
|
UICalendarPanel calendarPanel = new UICalendarPanel(); |
|
|
|
|
final UITextField field = new UITextField(); |
|
|
|
|
field.setPreferredSize(new Dimension(120, 25)); |
|
|
|
|
calendarPanel.addDateChangeListener(new ChangeListener(){ |
|
|
|
|
public void stateChanged(ChangeEvent e){ |
|
|
|
|
Date selectedDate = (Date)e.getSource(); |
|
|
|
|
calendarPanel.addDateChangeListener(new ChangeListener() { |
|
|
|
|
public void stateChanged(ChangeEvent e) { |
|
|
|
|
Date selectedDate = (Date) e.getSource(); |
|
|
|
|
SimpleDateFormat f = new SimpleDateFormat("yyyy/MM/dd"); |
|
|
|
|
field.setText(f.format(selectedDate)); |
|
|
|
|
} |
|
|
|
|