Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Give Date Format to Neblula CalendarCombo

DZone's Guide to

Give Date Format to Neblula CalendarCombo

· Java Zone ·
Free Resource

Take 60 minutes to understand the Power of the Actor Model with "Designing Reactive Systems: The Role Of Actors In Distributed Architecture". Brought to you in partnership with Lightbend.

The nebula project has a cool set of widgets for SWT which can be readily used in a RCP application.

I was playing around with nebula CalendarCombo and wanted to give it my own date format. As usual I started to read the source code and found that all you need to do is to define your own settings class, override getDateFormat and give it to the CalendarCombo constructor

eg

new CalendarCombo(parent, SWT.NONE, new Settings(), null).
 

Settings class example below.
public class Settings extends DefaultSettings 
{
public Locale getLocale()
{ return Locale.ENGLISH; }

public String getDateFormat()
{ return "dd/MM/yyyy"; }
}
 
From http://ggalangblog.blogspot.com. 

Learn how the Actor model provides a simple but powerful way to design and implement reactive applications that can distribute work across clusters of cores and servers. Brought to you in partnership with Lightbend.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}