Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » CalendarCombo DateFormat Query(CalendarCombo DateFormat Query)
CalendarCombo DateFormat Query [message #694952] Sun, 10 July 2011 10:54
eclipsefan  is currently offline eclipsefan Friend
Messages: 11
Registered: June 2011
Junior Member
Hello Experts -

I have a requirement where in I need when a user picks a date in the calendar combo, it should be displayed as d-MMM-yyyy HH:mm (example: 21-Jul-2011 00:00) in the text control of the calendar combo widget.

I did the following while creating the calendarcombo instance -

CalendarCombo cc = new CalendarCombo(inner, SWT.NONE, new CustomSettings(), null);

where CustomSettings is defined as follows :

public class CustomSettings extends DefaultSettings {

public String getDateFormat()
return "d-MMM-yyyy";

Here is what I then do:

1. Pick a date. The system displays the date as 21-Jul-2011 00:00 in the text
control of the calendar combo widget.
2. Now I try to change the date by pulling up the widget. The system throws the
following error -

java.lang.NumberFormatException: For input string: "Jul"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at org.eclipse.nebula.widgets.calendarcombo.DateHelper.slashParse(
at org.eclipse.nebula.widgets.calendarcombo.DateHelper.parse(
at org.eclipse.nebula.widgets.calendarcombo.CalendarCombo.parseTextDate(
at org.eclipse.nebula.widgets.calendarcombo.CalendarCombo.showCalendar(
at org.eclipse.nebula.widgets.calendarcombo.CalendarCombo$5.handleEvent(
at org.eclipse.swt.widgets.EventTable.sendEvent(
at org.eclipse.swt.widgets.Widget.sendEvent(
at org.eclipse.swt.widgets.Display.runDeferredEvents(
at org.eclipse.swt.widgets.Display.readAndDispatch(
at tablecombo.Tester.main(

Clearly, the code inside the calendar combo is facing problems with parsing the String "Jul". What am I missing in my code that can resolve this issue ? Please let me know.


[Updated on: Sun, 10 July 2011 10:57]

Report message to a moderator

Previous Topic:RichText
Next Topic:Nebula grid loads slowly when there are more than 200 columns on Ubuntu Linux
Goto Forum:

Current Time: Sun Jun 24 18:28:10 GMT 2018

Powered by FUDForum. Page generated in 0.01940 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top