Calendar combo box, Date spinners, Headers – labeling the date area – MiG InfoCom MiG Calendar Tutorial User Manual

Page 8

Advertising
background image

MiG InfoCom AB

address it explicitly for layout purposes. The scroll bars for that scroll
pane is relocated from the scroll pane to outside the right and lower
header respectively.

Mix in components anywhere
The container is using

GridBagLayout

and the javadoc for

DateAreaContainer

contains the grid rows and columns used for

positioning the contained

header

s, corners and the

DateArea

.

This makes it very easy to add you own components anywhere within
the container, even between the header and

DateArea

if you like.

You can put the anywhere.

Calendar Combo Box

Date picker
A combo box that inherits from

JPanel

but look much like a normal

JComboBox

. It tries to tweak parts of it's visual appearance to blend

in with the most common Look&Feels. It contains a

DateAreaContainer

and shows it in the popup window, just like a

regular

JComboBox

would. It is created from scratch rather than

extend

JComboBox

due to experienced troubles when trying to

extend

JComboBox

.

The combo supports plus/minus buttons as well as a 'go to today'
button. The date format for the editor is exchangeable and is
implemented as a

JFormattedTextField

. The editor's text field

can be used to edit a to/from date range.

Date Spinners

The included date spinners vastly surpasses what is available in the
standard J2SE SDK. Multiple spinners can be combined and coupled
to express one date/time or one spinner can be used to edit a
complex date format.

The spinners are simple to use and are located int the

calendar.spinner

package.

Headers – labeling the Date Area

A

header

is comparable to a normal table header in that it decorates

and labels the

DateArea

. The

Header

interface is very small, it

MiG Calendar Tutorial

Page 8 / 24

Advertising