Index: /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/ClockSystem.java
===================================================================
--- /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/ClockSystem.java	(revision 26215)
+++ /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/ClockSystem.java	(revision 26215)
@@ -0,0 +1,23 @@
+package org.openstreetmap.josm.plugins.ohe;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.util.Locale;
+
+public enum ClockSystem {
+    TWELVE_HOURS, TWENTYFOUR_HOURS;
+
+    public static ClockSystem getClockSystem(Locale locale) {
+        DateFormat stdFormat = DateFormat.getTimeInstance(DateFormat.SHORT, Locale.US);
+        DateFormat localeFormat = DateFormat.getTimeInstance(DateFormat.LONG, locale);
+        String midnight = "";
+        try {
+            midnight = localeFormat.format(stdFormat.parse("12:00 AM"));
+        } catch (ParseException ignore) {
+        }
+        if (midnight.contains("12"))
+            return TWELVE_HOURS;
+        else
+            return TWENTYFOUR_HOURS;
+    }
+}
Index: /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OhePlugin.java
===================================================================
--- /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OhePlugin.java	(revision 26214)
+++ /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OhePlugin.java	(revision 26215)
@@ -11,4 +11,5 @@
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -20,4 +21,5 @@
 import javax.swing.AbstractAction;
 import javax.swing.ButtonGroup;
+import javax.swing.JCheckBox;
 import javax.swing.JDialog;
 import javax.swing.JLabel;
@@ -51,9 +53,14 @@
      * {key, value, key-to-edit} key and value can contain regular expressions
      */
-    private final String[][] TAG_EDIT_STRINGS = new String[][] { { "opening_hours", ".*", "opening_hours" },
+    private final String[][] TAG_EDIT_STRINGS = new String[][] {
+            { "opening_hours", ".*", "opening_hours" },
             { "collection_times", ".*", "collection_times" },
-            { "collection_times:local", ".*", "collection_times:local" }, { "shop", ".*", "opening_hours" },
-            { "amenity", "post_box", "collection_times" }, { "amenity", ".*", "opening_hours" },
-            { "lit", ".*", "lit" }, { "highway", ".*", "lit" } };
+            { "collection_times:local", ".*", "collection_times:local" },
+            { "shop", ".*", "opening_hours" },
+            { "amenity", "post_box", "collection_times" },
+            { "amenity", "recycling", "collection_times" },
+            { "amenity", ".*", "opening_hours" },
+            { "lit", ".*", "lit" },
+            { "highway", ".*", "lit" } };
 
     /**
@@ -216,5 +223,5 @@
                             preSelectedKey = pattern[2];
                             break searchLoop;
-                        } else if (value instanceof Map<?, ?>)
+                        } else if (value instanceof Map<?, ?>) {
                             for (String v : ((Map<String, Integer>) value).keySet())
                                 if (valuePattern.matcher(v).matches()) {
@@ -222,4 +229,5 @@
                                     break searchLoop;
                                 }
+                        }
                     }
                 }
@@ -227,6 +235,7 @@
             int preSelectedRow = -1;
             for (int i = 0; i < propertyData.getRowCount(); ++i)
-                if (preSelectedKey.equals(propertyData.getValueAt(i, 0)))
+                if (preSelectedKey.equals(propertyData.getValueAt(i, 0))) {
                     preSelectedRow = i;
+                }
             if (preSelectedRow != -1) {
                 propertyTable.setEnabled(true);
@@ -241,9 +250,13 @@
             }
 
+            JCheckBox useTwelveHourClock = new JCheckBox(tr("Display clock in 12h mode."),
+                    ClockSystem.getClockSystem(Locale.getDefault()) == ClockSystem.TWELVE_HOURS);
+
             JPanel dlgPanel = new JPanel(new GridBagLayout());
-            dlgPanel.add(editButton, GBC.std().anchor(GBC.CENTER));
+            dlgPanel.add(editButton, GBC.std().anchor(GBC.WEST));
             dlgPanel.add(sp, GBC.eol().fill(GBC.BOTH));
-            dlgPanel.add(newButton, GBC.std().anchor(GBC.CENTER));
+            dlgPanel.add(newButton, GBC.std().anchor(GBC.WEST));
             dlgPanel.add(newTagField, GBC.eol().fill(GBC.HORIZONTAL));
+            dlgPanel.add(useTwelveHourClock, GBC.eol().fill(GBC.HORIZONTAL).insets(0, 5, 0, 5));
 
             JOptionPane optionPane = new JOptionPane(dlgPanel, JOptionPane.QUESTION_MESSAGE,
@@ -262,10 +275,12 @@
                     keyToEdit = (String) propertyData.getValueAt(propertyTable.getSelectedRow(), 0);
                     valuesToEdit = propertyData.getValueAt(propertyTable.getSelectedRow(), 1);
-                } else if (newButton.isSelected())
+                } else if (newButton.isSelected()) {
                     keyToEdit = newTagField.getText();
+                }
             if (keyToEdit == null)
                 return;
 
-            OheDialogPanel panel = new OheDialogPanel(OhePlugin.this, keyToEdit, valuesToEdit);
+            OheDialogPanel panel = new OheDialogPanel(OhePlugin.this, keyToEdit, valuesToEdit,
+                    useTwelveHourClock.isSelected() ? ClockSystem.TWELVE_HOURS : ClockSystem.TWENTYFOUR_HOURS);
 
             optionPane = new JOptionPane(panel, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
@@ -276,6 +291,7 @@
             String[] changedKeyValuePair = null;
             answer = optionPane.getValue();
-            if (!(answer == null || answer == JOptionPane.UNINITIALIZED_VALUE || (answer instanceof Integer && (Integer) answer != JOptionPane.OK_OPTION)))
+            if (!(answer == null || answer == JOptionPane.UNINITIALIZED_VALUE || (answer instanceof Integer && (Integer) answer != JOptionPane.OK_OPTION))) {
                 changedKeyValuePair = panel.getChangedKeyValuePair();
+            }
             if (changedKeyValuePair == null)
                 return;
Index: /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OpeningTimeUtils.java
===================================================================
--- /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OpeningTimeUtils.java	(revision 26214)
+++ /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OpeningTimeUtils.java	(revision 26215)
@@ -17,6 +17,5 @@
 
             // test if the given entry is a single dayspan
-            if (dateTime.daySpans.size() == 1
-                    && dateTime.daySpans.get(0).isSpan()) {
+            if (dateTime.daySpans.size() == 1 && dateTime.daySpans.get(0).isSpan()) {
                 ArrayList<DaySpan> partDaySpans = new ArrayList<DaySpan>();
                 int start_day = dateTime.daySpans.get(0).startDay;
@@ -25,25 +24,21 @@
                 while (i + 1 < dateTimes.size()) {
                     ArrayList<DaySpan> following = dateTimes.get(i + 1).daySpans;
-                    if (following.size() == 1
-                            && following.get(0).startDay > dateTime.daySpans
-                                    .get(0).startDay
-                            && following.get(0).endDay < dateTime.daySpans
-                                    .get(0).endDay) {
-                        partDaySpans.add(new DaySpan(start_day, following
-                                .get(0).startDay - 1));
+                    if (following.size() == 1 && following.get(0).startDay > dateTime.daySpans.get(0).startDay
+                            && following.get(0).endDay < dateTime.daySpans.get(0).endDay) {
+                        partDaySpans.add(new DaySpan(start_day, following.get(0).startDay - 1));
                         start_day = following.get(0).endDay + 1;
                         newDateTimes.add(dateTimes.get(i + 1));
                         i++;
-                    } else
+                    } else {
                         break;
-                }
-
-                partDaySpans.add(new DaySpan(start_day, dateTime.daySpans
-                        .get(0).endDay));
-                newDateTimes.add(new DateTime(partDaySpans,
-                        dateTime.daytimeSpans));
-            }
-            if (newDateTimes.isEmpty())
+                    }
+                }
+
+                partDaySpans.add(new DaySpan(start_day, dateTime.daySpans.get(0).endDay));
+                newDateTimes.add(new DateTime(partDaySpans, dateTime.daytimeSpans));
+            }
+            if (newDateTimes.isEmpty()) {
                 newDateTimes.add(dateTime);
+            }
 
             // create the int-array
@@ -52,8 +47,8 @@
                 for (DaySpan dayspan : dateTime2.daySpans) {
                     for (DaytimeSpan timespan : dateTime2.daytimeSpans) {
-                        if (!timespan.isOff())
-                            ret.add(new int[] { dayspan.startDay,
-                                    dayspan.endDay, timespan.startMinute,
+                        if (!timespan.isOff()) {
+                            ret.add(new int[] { dayspan.startDay, dayspan.endDay, timespan.startMinute,
                                     timespan.endMinute });
+                        }
                     }
                 }
@@ -103,6 +98,5 @@
         public ArrayList<DaytimeSpan> daytimeSpans;
 
-        public DateTime(ArrayList<DaySpan> daySpans,
-                ArrayList<DaytimeSpan> daytimeSpans) {
+        public DateTime(ArrayList<DaySpan> daySpans, ArrayList<DaytimeSpan> daytimeSpans) {
             this.daySpans = daySpans;
             this.daytimeSpans = daytimeSpans;
@@ -116,12 +110,16 @@
         // in a week
         boolean[][] minuteArray = new boolean[7][24 * 60 + 2];
-        for (int day = 0; day < 7; ++day)
-            for (int minute = 0; minute < 24 * 60 + 2; ++minute)
+        for (int day = 0; day < 7; ++day) {
+            for (int minute = 0; minute < 24 * 60 + 2; ++minute) {
                 minuteArray[day][minute] = false;
-        for (TimeRect timeRect : givenTimeRects)
-            for (int day = timeRect.getDayStart(); day <= timeRect.getDayEnd(); ++day)
-                for (int minute = timeRect.getMinuteStart(); minute <= timeRect
-                        .getMinuteEnd(); ++minute)
+            }
+        }
+        for (TimeRect timeRect : givenTimeRects) {
+            for (int day = timeRect.getDayStart(); day <= timeRect.getDayEnd(); ++day) {
+                for (int minute = timeRect.getMinuteStart(); minute <= timeRect.getMinuteEnd(); ++minute) {
                     minuteArray[day][minute] = true;
+                }
+            }
+        }
 
         String ret = "";
@@ -153,19 +151,17 @@
                 if (sameDayCount == 1) {
                     // a single Day with this special opening_hours
-                    add = OpeningTimeCompiler.WEEKDAYS[i] + " "
-                            + makeStringFromMinuteArray(minuteArray[i]);
+                    add = OpeningTimeCompiler.WEEKDAYS[i] + " " + makeStringFromMinuteArray(minuteArray[i]);
                 } else if (sameDayCount == 2) {
                     // exactly two Days with this special opening_hours
-                    add = OpeningTimeCompiler.WEEKDAYS[i] + ","
-                            + OpeningTimeCompiler.WEEKDAYS[lastSameDay] + " "
-                            + makeStringFromMinuteArray(minuteArray[i]);
+                    add = OpeningTimeCompiler.WEEKDAYS[i] + "," + OpeningTimeCompiler.WEEKDAYS[lastSameDay] + " "
+                    + makeStringFromMinuteArray(minuteArray[i]);
                 } else if (sameDayCount > 2) {
                     // more than two Days with this special opening_hours
-                    add = OpeningTimeCompiler.WEEKDAYS[i] + "-"
-                            + OpeningTimeCompiler.WEEKDAYS[lastSameDay] + " "
-                            + makeStringFromMinuteArray(minuteArray[i]);
+                    add = OpeningTimeCompiler.WEEKDAYS[i] + "-" + OpeningTimeCompiler.WEEKDAYS[lastSameDay] + " "
+                    + makeStringFromMinuteArray(minuteArray[i]);
                     for (int j = i + 1; j < lastSameDay; ++j) {
-                        if (days[j] == 0)
+                        if (days[j] == 0) {
                             days[j] = -i - 1;
+                        }
                     }
                 }
@@ -173,6 +169,7 @@
 
             if (!add.isEmpty()) {
-                if (!ret.isEmpty())
+                if (!ret.isEmpty()) {
                     ret += "; ";
+                }
                 ret += add;
             }
@@ -188,13 +185,16 @@
             if (minutes[i]) {
                 int start = i;
-                while (i < minutes.length && minutes[i])
+                while (i < minutes.length && minutes[i]) {
                     ++i;
+                }
                 String addString = timeString(start);
-                if (i - 1 == 24 * 60 + 1) // open end
+                if (i - 1 == 24 * 60 + 1) {
                     addString += "+";
-                else if (start != i - 1) // closing time
+                } else if (start != i - 1) {
                     addString += "-" + timeString(i - 1);
-                if (!ret.isEmpty())
+                }
+                if (!ret.isEmpty()) {
                     ret += ",";
+                }
                 ret += addString;
             }
@@ -204,7 +204,25 @@
 
     public static String timeString(int minutes) {
+        return timeString(minutes, ClockSystem.TWENTYFOUR_HOURS);
+    }
+
+    public static String timeString(int minutes, ClockSystem hourMode) {
+        return timeString(minutes, hourMode, false);
+    }
+
+    public static String timeString(int minutes, ClockSystem hourMode, boolean showPeriod) {
         int h = minutes / 60;
+        String period = "";
+        if (hourMode == ClockSystem.TWELVE_HOURS) {
+            if (showPeriod) {
+                period = h <= 12 ? " AM" : " PM";
+            }
+            h %= 12;
+            if (h == 0) {
+                h = 12;
+            }
+        }
         int m = minutes % 60;
-        return (h < 10 ? "0" : "") + h + ":" + (m < 10 ? "0" : "") + m;
+        return (h < 10 ? "0" : "") + h + ":" + (m < 10 ? "0" : "") + m + period;
     }
 
@@ -218,6 +236,7 @@
     private static boolean arraysEqual(boolean[] bs, boolean[] bs2) {
         boolean ret = true;
-        for (int i = 0; i < bs.length; i++)
+        for (int i = 0; i < bs.length; i++) {
             ret &= bs[i] == bs2[i];
+        }
         return ret;
     }
Index: /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheDialogPanel.java
===================================================================
--- /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheDialogPanel.java	(revision 26214)
+++ /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheDialogPanel.java	(revision 26215)
@@ -16,6 +16,6 @@
 import javax.swing.JPanel;
 import javax.swing.JTextField;
-import javax.swing.SwingUtilities;
 
+import org.openstreetmap.josm.plugins.ohe.ClockSystem;
 import org.openstreetmap.josm.plugins.ohe.OhePlugin;
 import org.openstreetmap.josm.plugins.ohe.OpeningTimeUtils;
@@ -41,4 +41,6 @@
     private final String oldkey;
 
+    private ClockSystem clockSystem;
+
     /**
      * The Panel for editing the time-values.
@@ -50,5 +52,7 @@
      *            multiple values and their number of occurences
      */
-    public OheDialogPanel(OhePlugin plugin, String key, Object valuesToEdit) {
+    public OheDialogPanel(OhePlugin plugin, String key, Object valuesToEdit, ClockSystem clockSystem) {
+        this.clockSystem = clockSystem;
+
         oldkey = key;
         keyField = new JTextField(key);
@@ -177,3 +181,10 @@
         actualPostionLabel.setText(positionText);
     }
+
+    /**
+     * @return the hourMode
+     */
+    public ClockSystem getHourMode() {
+        return clockSystem;
+    }
 }
Index: /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheEditor.java
===================================================================
--- /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheEditor.java	(revision 26214)
+++ /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheEditor.java	(revision 26215)
@@ -16,9 +16,9 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.ohe.ClockSystem;
 import org.openstreetmap.josm.plugins.ohe.OpeningTimeUtils;
 import org.openstreetmap.josm.plugins.ohe.parser.OpeningTimeCompiler;
 
-public class OheEditor extends JPanel implements MouseListener,
-	MouseMotionListener {
+public class OheEditor extends JPanel implements MouseListener, MouseMotionListener {
     final OheDialogPanel dialog;
 
@@ -32,211 +32,223 @@
 
     public OheEditor(OheDialogPanel oheDialogPanel) {
-	dialog = oheDialogPanel;
-
-	// the MainPanel for showing the TimeRects
-	contentPanel = new JPanel() {
-	    @Override
-	    public void setSize(Dimension d) {
-		super.setSize(d);
-		repositionTimeRects();
-	    }
-
-	    @Override
-	    public void paintComponent(Graphics g) {
-		if (OheEditor.this.isEnabled()) {
-		    g.setColor(Color.WHITE);
-		    g.fillRect(0, 0, getWidth(), getHeight());
-
-		    // horizontal Lines
-		    for (int i = 1; i < 24; ++i) {
-			if (i % 3 == 0)
-			    g.setColor(Color.BLACK);
-			else
-			    g.setColor(Color.LIGHT_GRAY);
-
-			g.drawLine(0, getMinutePosition(i * 60), getWidth(),
-				getMinutePosition(i * 60));
-		    }
-
-		    // vertical Lines
-		    g.setColor(Color.BLACK);
-		    for (int i = 1; i < 7; ++i)
-			g.drawLine(getDayPosition(i), 0, getDayPosition(i),
-				getHeight());
-
-		    // if a new Rect is dragged draw it
-		    if (day0 >= 0) {
-			Graphics2D g2D = (Graphics2D) g;
-
-			int day2 = Math.min(day0, day1);
-			int day3 = Math.max(day0, day1);
-			int minute2 = Math.min(minute0, minute1);
-			int minute3 = Math.max(minute0, minute1);
-			Rectangle bounds = getPanelBoundsForTimeinterval(day2,
-				day3 + 1, minute2, minute3);
-
-			TimeRect.drawTimeRect(g2D, bounds, minute2 == minute3,
-				false);
-		    }
-		} else {
-		    g.setColor(Color.LIGHT_GRAY);
-		    g.fillRect(0, 0, getWidth(), getHeight());
-		}
-	    }
-	};
-	contentPanel.addMouseListener(this);
-	contentPanel.addMouseMotionListener(this);
-	contentPanel.setLayout(null);
-	contentPanel.setPreferredSize(new Dimension(180, 384));
-
-	initTimeRects();
-
-	scrollPane = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
-		JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
-	scrollPane.setViewportView(contentPanel);
-
-	// the upper Panel for showing Weekdays
-	scrollPane.setColumnHeaderView(new JPanel() {
-	    @Override
-	    public Dimension getPreferredSize() {
-		return new Dimension(contentPanel.getWidth(), dayAxisHeight);
-	    }
-
-	    @Override
-	    public void paintComponent(Graphics g) {
-		g.setColor(Color.WHITE);
-		g.fillRect(0, 0, getWidth(), getHeight());
-
-		g.setColor(Color.BLACK);
-		for (int i = 0; i < 7; ++i) {
-		    if (i > 0)
-			g.drawLine(getDayPosition(i) + 1, 0,
-				getDayPosition(i) + 1, getHeight());
-
-		    String text = OpeningTimeCompiler.WEEKDAYS[i];
-		    g.drawString(text, (int) (getDayPosition(i + 0.5) - g
-			    .getFontMetrics().stringWidth(text) * 0.5),
-			    (int) (dayAxisHeight * 0.5 + g.getFontMetrics()
-				    .getHeight() * 0.35));
-		}
-	    }
-	});
-
-	// the left Panel for showing the hours
-	scrollPane.setRowHeaderView(new JPanel() {
-	    @Override
-	    public Dimension getPreferredSize() {
-		return new Dimension(timeAxisWidth, contentPanel.getHeight());
-	    }
-
-	    @Override
-	    public void paintComponent(Graphics g) {
-		g.setColor(Color.WHITE);
-		g.fillRect(0, 0, getWidth(), getHeight());
-
-		for (int i = 1; i < 24; ++i) {
-		    if (i % 3 == 0) {
-			g.setColor(Color.BLACK);
-			String text = ((i < 10) ? "0" + i : i) + ":00";
-			g.drawString(
-				text,
-				timeAxisWidth - 10
-					- g.getFontMetrics().stringWidth(text),
-				getMinutePosition(i * 60)
-					+ (int) (g.getFontMetrics().getHeight() * 0.35));
-		    } else
-			g.setColor(Color.LIGHT_GRAY);
-
-		    g.drawLine(getWidth() - 4, getMinutePosition(i * 60) + 1,
-			    getWidth(), getMinutePosition(i * 60) + 1);
-		}
-	    }
-	});
-
-	setLayout(new BorderLayout());
-	add(scrollPane, BorderLayout.CENTER);
+        dialog = oheDialogPanel;
+
+        // the MainPanel for showing the TimeRects
+        contentPanel = new JPanel() {
+            @Override
+            public void setSize(Dimension d) {
+                super.setSize(d);
+                repositionTimeRects();
+            }
+
+            @Override
+            public void paintComponent(Graphics g) {
+                if (OheEditor.this.isEnabled()) {
+                    g.setColor(Color.WHITE);
+                    g.fillRect(0, 0, getWidth(), getHeight());
+                    if (dialog.getHourMode() == ClockSystem.TWELVE_HOURS) {
+                        g.setColor(new Color(255, 255, 218));
+                        g.fillRect(0, getMinutePosition(12 * 60), getWidth(), getHeight() - getMinutePosition(12 * 60));
+                    }
+
+                    // horizontal Lines
+                    for (int i = 1; i < 24; ++i) {
+                        if (i % 3 == 0) {
+                            g.setColor(Color.BLACK);
+                        } else {
+                            g.setColor(Color.LIGHT_GRAY);
+                        }
+
+                        g.drawLine(0, getMinutePosition(i * 60), getWidth(), getMinutePosition(i * 60));
+                    }
+
+                    // vertical Lines
+                    g.setColor(Color.BLACK);
+                    for (int i = 1; i < 7; ++i) {
+                        g.drawLine(getDayPosition(i), 0, getDayPosition(i), getHeight());
+                    }
+
+                    // if a new Rect is dragged draw it
+                    if (day0 >= 0) {
+                        Graphics2D g2D = (Graphics2D) g;
+
+                        int day2 = Math.min(day0, day1);
+                        int day3 = Math.max(day0, day1);
+                        int minute2 = Math.min(minute0, minute1);
+                        int minute3 = Math.max(minute0, minute1);
+                        Rectangle bounds = getPanelBoundsForTimeinterval(day2, day3 + 1, minute2, minute3);
+
+                        TimeRect.drawTimeRect(g2D, bounds, minute2 == minute3, false);
+                    }
+                } else {
+                    g.setColor(Color.LIGHT_GRAY);
+                    g.fillRect(0, 0, getWidth(), getHeight());
+                }
+            }
+        };
+        contentPanel.addMouseListener(this);
+        contentPanel.addMouseMotionListener(this);
+        contentPanel.setLayout(null);
+        contentPanel.setPreferredSize(new Dimension(180, 384));
+
+        initTimeRects();
+
+        scrollPane = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
+                JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
+        scrollPane.setViewportView(contentPanel);
+
+        // the upper Panel for showing Weekdays
+        scrollPane.setColumnHeaderView(new JPanel() {
+            @Override
+            public Dimension getPreferredSize() {
+                return new Dimension(contentPanel.getWidth(), dayAxisHeight);
+            }
+
+            @Override
+            public void paintComponent(Graphics g) {
+                g.setColor(Color.WHITE);
+                g.fillRect(0, 0, getWidth(), getHeight());
+
+                g.setColor(Color.BLACK);
+                for (int i = 0; i < 7; ++i) {
+                    if (i > 0) {
+                        g.drawLine(getDayPosition(i) + 1, 0, getDayPosition(i) + 1, getHeight());
+                    }
+
+                    String text = OpeningTimeCompiler.WEEKDAYS[i];
+                    g.drawString(text, (int) (getDayPosition(i + 0.5) - g.getFontMetrics().stringWidth(text) * 0.5),
+                            (int) (dayAxisHeight * 0.5 + g.getFontMetrics().getHeight() * 0.35));
+                }
+            }
+        });
+
+        // the left Panel for showing the hours
+        scrollPane.setRowHeaderView(new JPanel() {
+            @Override
+            public Dimension getPreferredSize() {
+                return new Dimension(timeAxisWidth, contentPanel.getHeight());
+            }
+
+            @Override
+            public void paintComponent(Graphics g) {
+                g.setColor(Color.WHITE);
+                g.fillRect(0, 0, getWidth(), getHeight());
+                if (dialog.getHourMode() == ClockSystem.TWELVE_HOURS) {
+                    g.setColor(new Color(255, 255, 218));
+                    g.fillRect(0, getMinutePosition(12 * 60), getWidth(), getHeight() - getMinutePosition(12 * 60));
+                }
+
+                for (int i = 1; i < 24; ++i) {
+                    if (i % 3 == 0) {
+                        g.setColor(Color.BLACK);
+                        String text = OpeningTimeUtils.timeString(i * 60, dialog.getHourMode(), false);
+                        g.drawString(text, (timeAxisWidth - g.getFontMetrics().stringWidth(text)) / 2,
+                                getMinutePosition(i * 60) + (int) (g.getFontMetrics().getHeight() * 0.35));
+                    } else {
+                        g.setColor(Color.LIGHT_GRAY);
+                    }
+
+                    g.drawLine(getWidth() - 4, getMinutePosition(i * 60), getWidth(), getMinutePosition(i * 60));
+                }
+
+                g.setColor(Color.BLACK);
+                String text = OpeningTimeUtils.timeString(0, dialog.getHourMode(), false);
+                g.drawString(text, (timeAxisWidth - g.getFontMetrics().stringWidth(text)) / 2, getMinutePosition(0)
+                        + (int) (g.getFontMetrics().getHeight() * 1.0));
+                if (dialog.getHourMode() == ClockSystem.TWELVE_HOURS) {
+                    text = "AM";
+                    g.drawString(text, (timeAxisWidth - g.getFontMetrics().stringWidth(text)) / 2, getMinutePosition(0)
+                            + (int) (g.getFontMetrics().getHeight() * 1.85));
+                    text = "PM";
+                    g.drawString(text, (timeAxisWidth - g.getFontMetrics().stringWidth(text)) / 2,
+                            getMinutePosition(12 * 60) + (int) (g.getFontMetrics().getHeight() * 1.2));
+                }
+            }
+        });
+
+        setLayout(new BorderLayout());
+        add(scrollPane, BorderLayout.CENTER);
     }
 
     // update all the TimeRects with new Data
     public void initTimeRects() {
-	contentPanel.removeAll();
-
-	ArrayList<int[]> time;
-	try {
-	    time = dialog.getTime();
-	} catch (Exception exc) {
-	    setEnabled(false);
-	    return;
-	}
-
-	setEnabled(true);
-	timeRects = new ArrayList<TimeRect>();
-	if (time != null) {
-	    for (int[] timeRectValues : time) {
-		int day0 = timeRectValues[0];
-		int day1 = timeRectValues[1];
-		int minute0 = timeRectValues[2];
-		int minute1 = timeRectValues[3];
-		TimeRect timeRect = new TimeRect(OheEditor.this, day0, day1,
-			minute0, minute1);
-		timeRects.add(timeRect);
-		contentPanel.add(timeRect);
-	    }
-	}
-
-	repositionTimeRects();
-	repaint();
+        contentPanel.removeAll();
+
+        ArrayList<int[]> time;
+        try {
+            time = dialog.getTime();
+        } catch (Exception exc) {
+            setEnabled(false);
+            return;
+        }
+
+        setEnabled(true);
+        timeRects = new ArrayList<TimeRect>();
+        if (time != null) {
+            for (int[] timeRectValues : time) {
+                int day0 = timeRectValues[0];
+                int day1 = timeRectValues[1];
+                int minute0 = timeRectValues[2];
+                int minute1 = timeRectValues[3];
+                TimeRect timeRect = new TimeRect(OheEditor.this, day0, day1, minute0, minute1);
+                timeRects.add(timeRect);
+                contentPanel.add(timeRect);
+            }
+        }
+
+        repositionTimeRects();
+        repaint();
     }
 
     protected void repositionTimeRects() {
-	if (timeRects != null)
-	    for (TimeRect timeRect : timeRects)
-		timeRect.reposition();
+        if (timeRects != null) {
+            for (TimeRect timeRect : timeRects) {
+                timeRect.reposition();
+            }
+        }
     }
 
     // returns the physical Borders of the TimeRect on the mainPanel
-    public Rectangle getPanelBoundsForTimeinterval(int dayStart, int dayEnd,
-	    int minutesStart, int minutesEnd) {
-	int x = getDayPosition(dayStart);
-	int y = getMinutePosition(minutesStart);
-	int width = getDayPosition(dayEnd) - getDayPosition(dayStart);
-	int height = getMinutePosition(minutesEnd)
-		- getMinutePosition(minutesStart);
-
-	// work around openjdk bug
-	if (Main.isOpenjdk) {
-	    x++;
-	    y++;
-	}
-
-	if (minutesStart == minutesEnd)
-	    return new Rectangle(x, y - 2 - TimeRect.verticalNonDrawedPixels,
-		    width, height + 5 + 2 * TimeRect.verticalNonDrawedPixels);
-
-	return new Rectangle(x, y, width, height + 1);
+    public Rectangle getPanelBoundsForTimeinterval(int dayStart, int dayEnd, int minutesStart, int minutesEnd) {
+        int x = getDayPosition(dayStart);
+        int y = getMinutePosition(minutesStart);
+        int width = getDayPosition(dayEnd) - getDayPosition(dayStart);
+        int height = getMinutePosition(minutesEnd) - getMinutePosition(minutesStart);
+
+        // work around openjdk bug
+        if (Main.isOpenjdk) {
+            x++;
+            y++;
+        }
+
+        if (minutesStart == minutesEnd)
+            return new Rectangle(x, y - 2 - TimeRect.verticalNonDrawedPixels, width, height + 5 + 2
+                    * TimeRect.verticalNonDrawedPixels);
+
+        return new Rectangle(x, y, width, height + 1);
     }
 
     public double getDayWidth() {
-	return (contentPanel.getWidth() - 1) / 7.0;
+        return (contentPanel.getWidth() - 1) / 7.0;
     }
 
     public int getDayPosition(double d) {
-	return (int) (d * getDayWidth());
+        return (int) (d * getDayWidth());
     }
 
     public double getMinuteHeight() {
-	return (contentPanel.getHeight() - 1) / (24.0 * 60);
+        return (contentPanel.getHeight() - 1) / (24.0 * 60);
     }
 
     public int getMinutePosition(int minute) {
-	return (int) (minute * getMinuteHeight());
+        return (int) (minute * getMinuteHeight());
     }
 
     // removes the given timerect from the panel and from the arraylist
     public void removeTimeRect(TimeRect timeRectToRemove) {
-	timeRects.remove(timeRectToRemove);
-	contentPanel.remove(timeRectToRemove);
-	dialog.updateValueField(timeRects);
-	repaint();
+        timeRects.remove(timeRectToRemove);
+        contentPanel.remove(timeRectToRemove);
+        dialog.updateValueField(timeRects);
+        repaint();
     }
 
@@ -255,87 +267,80 @@
     @Override
     public void mouseEntered(MouseEvent evt) {
-	mousePositionChanged(0, 0, true);
+        mousePositionChanged(0, 0, true);
     }
 
     @Override
     public void mouseExited(MouseEvent evt) {
-	mousePositionChanged(0, 0, false);
+        mousePositionChanged(0, 0, false);
     }
 
     @Override
     public void mousePressed(MouseEvent evt) {
-	day0 = (int) Math.floor(evt.getX() / getDayWidth());
-	minute0 = (int) Math.floor(evt.getY()
-		/ (getMinuteHeight() * TimeRect.minuteResterize))
-		* TimeRect.minuteResterize;
-	day1 = day0;
-	minute1 = minute0;
-	xDragStart = evt.getX();
-	yDragStart = evt.getY();
+        day0 = (int) Math.floor(evt.getX() / getDayWidth());
+        minute0 = (int) Math.floor(evt.getY() / (getMinuteHeight() * TimeRect.minuteResterize))
+        * TimeRect.minuteResterize;
+        day1 = day0;
+        minute1 = minute0;
+        xDragStart = evt.getX();
+        yDragStart = evt.getY();
     }
 
     @Override
     public void mouseReleased(MouseEvent evt) {
-	// mouse must be moved 5px before creating a rect
-	if (xDragStart == -1
-		|| Math.abs(evt.getX() - xDragStart)
-			+ Math.abs(evt.getY() - yDragStart) > 5) {
-	    int day2 = Math.min(day0, day1);
-	    int day3 = Math.max(day0, day1);
-	    int minute2 = Math.min(minute0, minute1);
-	    int minute3 = Math.max(minute0, minute1);
-
-	    TimeRect timeRect = new TimeRect(OheEditor.this, day2, day3,
-		    minute2, minute3);
-	    timeRects.add(timeRect);
-	    contentPanel.add(timeRect);
-	    timeRect.reposition();
-	    dialog.updateValueField(timeRects);
-
-	    day0 = -1;
-	    repaint();
-	}
+        // mouse must be moved 5px before creating a rect
+        if (xDragStart == -1 || Math.abs(evt.getX() - xDragStart) + Math.abs(evt.getY() - yDragStart) > 5) {
+            int day2 = Math.min(day0, day1);
+            int day3 = Math.max(day0, day1);
+            int minute2 = Math.min(minute0, minute1);
+            int minute3 = Math.max(minute0, minute1);
+
+            TimeRect timeRect = new TimeRect(OheEditor.this, day2, day3, minute2, minute3);
+            timeRects.add(timeRect);
+            contentPanel.add(timeRect);
+            timeRect.reposition();
+            dialog.updateValueField(timeRects);
+
+            day0 = -1;
+            repaint();
+        }
     }
 
     @Override
     public void mouseDragged(MouseEvent evt) {
-	// mouse must be moved 5px before drawing a rect
-	if (xDragStart == -1
-		|| Math.abs(evt.getX() - xDragStart)
-			+ Math.abs(evt.getY() - yDragStart) > 5) {
-	    xDragStart = -1;
-	    day1 = (int) Math.floor(evt.getX() / getDayWidth());
-	    minute1 = (int) Math.floor(evt.getY()
-		    / (getMinuteHeight() * TimeRect.minuteResterize))
-		    * TimeRect.minuteResterize;
-
-	    // ensure that the new time is in a valid range
-	    day1 = Math.max(day1, 0);
-	    day1 = Math.min(day1, 6);
-	    minute1 = Math.max(minute1, 0);
-	    minute1 = Math.min(minute1, 24 * 60);
-
-	    repaint();
-	}
-	mousePositionChanged(evt.getX(), evt.getY(), true);
+        // mouse must be moved 5px before drawing a rect
+        if (xDragStart == -1 || Math.abs(evt.getX() - xDragStart) + Math.abs(evt.getY() - yDragStart) > 5) {
+            xDragStart = -1;
+            day1 = (int) Math.floor(evt.getX() / getDayWidth());
+            minute1 = (int) Math.floor(evt.getY() / (getMinuteHeight() * TimeRect.minuteResterize))
+            * TimeRect.minuteResterize;
+
+            // ensure that the new time is in a valid range
+            day1 = Math.max(day1, 0);
+            day1 = Math.min(day1, 6);
+            minute1 = Math.max(minute1, 0);
+            minute1 = Math.min(minute1, 24 * 60);
+
+            repaint();
+        }
+        mousePositionChanged(evt.getX(), evt.getY(), true);
     }
 
     @Override
     public void mouseMoved(MouseEvent evt) {
-	mousePositionChanged(evt.getX(), evt.getY(), true);
-    }
-
-    public void mousePositionChanged(int x, int y,  boolean mouseInside) {
-	if (mouseInside) {
-	    int actualDay = (int) Math.floor(x / getDayWidth());
-	    int minutes = (int) Math.floor(y
-		    / (getMinuteHeight() * TimeRect.minuteResterize))
-		    * TimeRect.minuteResterize;
-	    actualDay = Math.max(0, Math.min(6, actualDay));
-	    minutes = Math.max(0, Math.min(24 * 60, minutes));
-	    dialog.setMousePositionText(OpeningTimeCompiler.WEEKDAYS[actualDay]
-		    + " " + OpeningTimeUtils.timeString(minutes));
-	} else
-	    dialog.setMousePositionText("-");
+        mousePositionChanged(evt.getX(), evt.getY(), true);
+    }
+
+    public void mousePositionChanged(int x, int y, boolean mouseInside) {
+        if (mouseInside) {
+            int actualDay = (int) Math.floor(x / getDayWidth());
+            int minutes = (int) Math.floor(y / (getMinuteHeight() * TimeRect.minuteResterize))
+            * TimeRect.minuteResterize;
+            actualDay = Math.max(0, Math.min(6, actualDay));
+            minutes = Math.max(0, Math.min(24 * 60, minutes));
+            dialog.setMousePositionText(OpeningTimeCompiler.WEEKDAYS[actualDay] + " "
+                    + OpeningTimeUtils.timeString(minutes, dialog.getHourMode(), true));
+        } else {
+            dialog.setMousePositionText("-");
+        }
     }
 }
