| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
package docrobot; |
| 20 |
|
| 21 |
import java.awt.FlowLayout; |
| 22 |
import java.util.Calendar; |
| 23 |
|
| 24 |
import javax.swing.*; |
| 25 |
|
| 26 |
import org.jdesktop.swingx.JXMonthView; |
| 27 |
import org.pushingpixels.substance.api.skin.SubstanceBusinessBlackSteelLookAndFeel; |
| 28 |
|
| 29 |
public class MonthViewFrame extends JFrame { |
| 30 |
public MonthViewFrame() { |
| 31 |
super("JXMonthView example"); |
| 32 |
|
| 33 |
Calendar cal = Calendar.getInstance(); |
| 34 |
cal.add(Calendar.DAY_OF_MONTH, 4); |
| 35 |
JXMonthView monthView = new JXMonthView(); |
| 36 |
monthView.setShowingLeadingDays(true); |
| 37 |
monthView.setShowingTrailingDays(true); |
| 38 |
monthView.setShowingWeekNumber(true); |
| 39 |
|
| 40 |
this.setLayout(new FlowLayout(FlowLayout.CENTER)); |
| 41 |
this.add(monthView); |
| 42 |
|
| 43 |
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
| 44 |
this.setSize(350, 250); |
| 45 |
this.setLocationRelativeTo(null); |
| 46 |
} |
| 47 |
|
| 48 |
public static void main(String[] args) throws Exception { |
| 49 |
JFrame.setDefaultLookAndFeelDecorated(true); |
| 50 |
UIManager.setLookAndFeel(new SubstanceBusinessBlackSteelLookAndFeel()); |
| 51 |
|
| 52 |
SwingUtilities.invokeLater(new Runnable() { |
| 53 |
public void run() { |
| 54 |
new MonthViewFrame().setVisible(true); |
| 55 |
} |
| 56 |
}); |
| 57 |
} |
| 58 |
} |