BasicMonthViewUI extends MonthViewUI { protected int getFirstDisplayedMonth() { return getCalendar().get(Calendar.MONTH); }  @SuppressWarnings({"UnusedDeclaration"}) static ComponentUI createUI(JComponent c); @Override void installUI(JComponent c); @Override void uninstallUI(JComponent c); @Override String[] getDaysOfTheWeek(); boolean isUsingKeyboard(); void setUsingKeyboard(boolean val); @Override Date getDayAtLocation(int x, int y); @Override void update(Graphics g, JComponent c); @Override void paint(Graphics g, JComponent c); @Override Date getLastDisplayedDay(); static final int MONTH_DOWN; static final int MONTH_UP; }
@Test public void testUpdateUIFirstMonth() { Calendar cal = Calendar.getInstance(); cal.set(Calendar.MONTH, 5); final JXMonthView monthView = new JXMonthView(cal.getTime()); long first = ((BasicMonthViewUI) monthView.getUI()).getFirstDisplayedMonth(); monthView.updateUI(); assertEquals(first, ((BasicMonthViewUI) monthView.getUI()).getFirstDisplayedMonth()); }