• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java UtilDateModel类的典型用法和代码示例

java 3次浏览

本文整理汇总了Java中org.jdatepicker.impl.UtilDateModel的典型用法代码示例。如果您正苦于以下问题:Java UtilDateModel类的具体用法?Java UtilDateModel怎么用?Java UtilDateModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

UtilDateModel类属于org.jdatepicker.impl包,在下文中一共展示了UtilDateModel类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: generateDatePicker

点赞 3

import org.jdatepicker.impl.UtilDateModel; //导入依赖的package包/类
/**
 * methode pour generer un objet DatePicker
 * @return datePicker JDatePickerImpl 
 */
private JDatePickerImpl generateDatePicker(){

	Properties p = new Properties();
	p.put("text.today", "today");
	p.put("text.month", "month");
	p.put("text.year", "year");
	
	UtilDateModel model = new UtilDateModel();
	JDatePanelImpl datePanel = new JDatePanelImpl(model, p);
	JDatePickerImpl datePicker = new JDatePickerImpl(datePanel, new DateComponentFormatter());
	
	return datePicker;
	
}
 

开发者ID:TeamLDCCIIT,
项目名称:Java_GestionProjet,
代码行数:19,
代码来源:PanneauHautProjet.java

示例2: generateDatePicker

点赞 2

import org.jdatepicker.impl.UtilDateModel; //导入依赖的package包/类
/**
 * methode pour genere un objet DatePicker
 * @return
 */
private JDatePickerImpl generateDatePicker(){

	Properties p = new Properties();
	p.put("text.today", "today");
	p.put("text.month", "month");
	p.put("text.year", "year");
	
	UtilDateModel model = new UtilDateModel();
	JDatePanelImpl datePanel = new JDatePanelImpl(model, p);
	JDatePickerImpl datePicker = new JDatePickerImpl(datePanel, new DateComponentFormatter());
	
	return datePicker;
	
}
 

开发者ID:TeamLDCCIIT,
项目名称:Java_GestionProjet,
代码行数:19,
代码来源:PanneauHautLot.java

示例3: DateField

点赞 2

import org.jdatepicker.impl.UtilDateModel; //导入依赖的package包/类
/**
 * Konstruktor
 * @param date Domyslna (poczatkowa) data
 */
public DateField(Date date) {
    
   super(new FlowLayout(FlowLayout.LEFT)); 
   setOpaque(false);
   
   final UtilDateModel model = new UtilDateModel();
   
   Properties pr = new Properties();
   pr.put("text.today", "Dzi\u015b");
   pr.put("text.month", "Miesi\u0105c");
   pr.put("text.year", "Rok");    
 
   JDatePanelImpl datePanel = new JDatePanelImpl(model, pr);
   datePicker = new JDatePickerImpl(datePanel, new DateLabelFormatter());
   
   if (date != null) {
     model.setDate(Integer.parseInt((new SimpleDateFormat("yyyy")).format(date)),
                   Integer.parseInt((new SimpleDateFormat("MM")).format(date))-1,
                   Integer.parseInt((new SimpleDateFormat("dd")).format(date)));
   }
   
   
   model.setSelected(true); 
   
   datePicker.setShowYearButtons(false);
   datePicker.setTextEditable(false);
   datePicker.setButtonFocusable(false);
   
   changeButton = (JButton) datePicker.getComponent(1);
   changeButton.setToolTipText("Ustaw dat\u0119");
   changeButton.setText("");
   changeButton.setIcon(ImageRes.getIcon("icons/calendar.png"));
   changeButton.setPreferredSize(new Dimension(30, 30));
   datePicker.getJFormattedTextField().setPreferredSize(new Dimension(120, 30));
   datePicker.getJFormattedTextField().setBackground(new Color(0xeaeaea));
   
   add(datePicker);              
         
   
}
 

开发者ID:makaw,
项目名称:somado,
代码行数:45,
代码来源:DateField.java

示例4: makeGUI

点赞 2

import org.jdatepicker.impl.UtilDateModel; //导入依赖的package包/类
private void makeGUI() {
	JLabel title = new JLabel(TextView.get("bookAdd"));
	Font police = new Font("Arial", Font.BOLD, 16);
	title.setFont(police);
	title.setHorizontalAlignment(JLabel.CENTER);
	this.add(title, BorderLayout.NORTH);

	JPanel bookPanel = new JPanel(new SpringLayout());

	// Nom du jeu
	JLabel bookGameNameLabel = new JLabel(TextView.get("bookGame"));
	bookPanel.add(bookGameNameLabel);
	this.gameComboBox = new JComboBox<Game>();
	this.gameComboBox.setModel(new PostLoadableGameComboBoxModel());
	this.gameComboBox.setMaximumSize(new Dimension(LudoTechApplication.WINDOW_WIDTH, 20));
	bookGameNameLabel.setLabelFor(this.gameComboBox);
	bookPanel.add(this.gameComboBox);

	// Nom du membre
	JLabel bookMemberNameLabel = new JLabel(TextView.get("bookMember"));
	bookPanel.add(bookMemberNameLabel);
	this.memberComboBox = new JComboBox<Member>();
	this.memberComboBox.setModel(new PostLoadableMemberComboBoxModel());
	this.memberComboBox.setMaximumSize(new Dimension(LudoTechApplication.WINDOW_WIDTH, 20));
	bookMemberNameLabel.setLabelFor(this.memberComboBox);
	bookPanel.add(this.memberComboBox);

	// Date de début
	JLabel beginningDateLabel = new JLabel(TextView.get("bookBeginningDate"));
	bookPanel.add(beginningDateLabel);
	UtilDateModel startDateModel = new UtilDateModel();
	startDateModel.setSelected(true);
	startDateModel.addDay(7 * durationBetweenBookingandBorrowingInWeeks);
	Properties startDateProperties = new Properties();
	startDateProperties.put("text.today", "Today");
	startDateProperties.put("text.month", "Month");
	startDateProperties.put("text.year", "Year");
	JDatePanelImpl startDatePanel = new JDatePanelImpl(startDateModel, startDateProperties);
	this.startDatePicker = new JDatePickerImpl(startDatePanel, new DateFormatter());
	beginningDateLabel.setLabelFor(this.startDatePicker);
	bookPanel.add(startDatePicker);

	// Date de fin
	JLabel endingDateLabel = new JLabel(TextView.get("bookEndingDate"));
	bookPanel.add(endingDateLabel);
	UtilDateModel endDateModel = new UtilDateModel();
	endDateModel.setSelected(true);
	endDateModel.addDay(7 * (durationBetweenBookingandBorrowingInWeeks + durationOfBorrowingsInWeeks));
	Properties endDateProperties = new Properties();
	endDateProperties.put("text.today", "Today");
	endDateProperties.put("text.month", "Month");
	endDateProperties.put("text.year", "Year");
	JDatePanelImpl endDatePanel = new JDatePanelImpl(endDateModel, endDateProperties);
	this.endDatePicker = new JDatePickerImpl(endDatePanel, new DateFormatter());
	beginningDateLabel.setLabelFor(this.endDatePicker);
	bookPanel.add(endDatePicker);

	// Nom de l'extension
	JLabel bookExtensionNameLabel = new JLabel(TextView.get("bookExtension"));
	bookPanel.add(bookExtensionNameLabel);
	this.extensionComboBox = new JComboBox<Extension>();
	this.extensionComboBox.setModel(new PostLoadableExtensionComboBoxModel());
	this.extensionComboBox.setMaximumSize(new Dimension(LudoTechApplication.WINDOW_WIDTH, 20));
	bookExtensionNameLabel.setLabelFor(this.extensionComboBox);
	bookPanel.add(this.extensionComboBox);

	SpringUtilities.makeCompactGrid(bookPanel, 5, 2, 6, 6, 6, 6);

	this.add(bookPanel, BorderLayout.CENTER);

	JPanel actionsPanel = new JPanel();
	this.validateButton = new JButton(TextView.get("validate"));
	actionsPanel.add(this.validateButton);
	this.cancelButton = new JButton(TextView.get("cancel"));
	actionsPanel.add(this.cancelButton);
	this.add(actionsPanel, BorderLayout.SOUTH);

}
 

开发者ID:TheoGauchoux,
项目名称:LudoTech,
代码行数:79,
代码来源:BookView.java

示例5: makeGUI

点赞 2

import org.jdatepicker.impl.UtilDateModel; //导入依赖的package包/类
private void makeGUI() {
	JLabel title = new JLabel(TextView.get("borrowAdd"));
	Font police = new Font("Arial", Font.BOLD, 16);
	title.setFont(police);
	title.setHorizontalAlignment(JLabel.CENTER);
	this.add(title, BorderLayout.NORTH);

	JPanel borrowPanel = new JPanel(new SpringLayout());

	// Nom du jeu
	JLabel borrowGameNameLabel = new JLabel(TextView.get("borrowGame"));
	borrowPanel.add(borrowGameNameLabel);
	this.gameComboBox = new JComboBox<Game>();
	this.gameComboBox.setModel(new PostLoadableGameComboBoxModel());
	this.gameComboBox.setMaximumSize(new Dimension(LudoTechApplication.WINDOW_WIDTH, 20));
	borrowGameNameLabel.setLabelFor(this.gameComboBox);
	borrowPanel.add(this.gameComboBox);

	// Nom du membre
	JLabel borrowMemberNameLabel = new JLabel(TextView.get("borrowMember"));
	borrowPanel.add(borrowMemberNameLabel);
	this.memberComboBox = new JComboBox<Member>();
	this.memberComboBox.setModel(new PostLoadableMemberComboBoxModel());
	this.memberComboBox.setMaximumSize(new Dimension(LudoTechApplication.WINDOW_WIDTH, 20));
	borrowMemberNameLabel.setLabelFor(this.memberComboBox);
	borrowPanel.add(this.memberComboBox);

	// Date de début
	JLabel beginningDateLabel = new JLabel(TextView.get("borrowBeginningDate"));
	borrowPanel.add(beginningDateLabel);
	UtilDateModel startDateModel = new UtilDateModel();
	startDateModel.setSelected(true);
	startDateModel.addDay(7 * durationBetweenBookingandBorrowingInWeeks);
	Properties startDateProperties = new Properties();
	startDateProperties.put("text.today", "Today");
	startDateProperties.put("text.month", "Month");
	startDateProperties.put("text.year", "Year");
	JDatePanelImpl startDatePanel = new JDatePanelImpl(startDateModel, startDateProperties);
	this.startDatePicker = new JDatePickerImpl(startDatePanel, new DateFormatter());
	beginningDateLabel.setLabelFor(this.startDatePicker);
	borrowPanel.add(startDatePicker);

	// Date de fin
	JLabel endingDateLabel = new JLabel(TextView.get("borrowEndingDate"));
	borrowPanel.add(endingDateLabel);
	UtilDateModel endDateModel = new UtilDateModel();
	endDateModel.setSelected(true);
	endDateModel.addDay(7 * (durationBetweenBookingandBorrowingInWeeks + durationOfBorrowingsInWeeks));
	Properties endDateProperties = new Properties();
	endDateProperties.put("text.today", "Today");
	endDateProperties.put("text.month", "Month");
	endDateProperties.put("text.year", "Year");
	JDatePanelImpl endDatePanel = new JDatePanelImpl(endDateModel, endDateProperties);
	this.endDatePicker = new JDatePickerImpl(endDatePanel, new DateFormatter());
	beginningDateLabel.setLabelFor(this.endDatePicker);
	borrowPanel.add(endDatePicker);

	// Nom de l'extension
	JLabel borrowExtensionNameLabel = new JLabel(TextView.get("borrowExtension"));
	borrowPanel.add(borrowExtensionNameLabel);
	this.extensionComboBox = new JComboBox<Extension>();
	this.extensionComboBox.setModel(new PostLoadableExtensionComboBoxModel());
	this.extensionComboBox.setMaximumSize(new Dimension(LudoTechApplication.WINDOW_WIDTH, 20));
	borrowExtensionNameLabel.setLabelFor(this.extensionComboBox);
	borrowPanel.add(this.extensionComboBox);

	SpringUtilities.makeCompactGrid(borrowPanel, 5, 2, 6, 6, 6, 6);

	this.add(borrowPanel, BorderLayout.CENTER);

	JPanel actionsPanel = new JPanel();
	this.validateButton = new JButton(TextView.get("validate"));
	actionsPanel.add(this.validateButton);
	this.cancelButton = new JButton(TextView.get("cancel"));
	actionsPanel.add(this.cancelButton);
	this.add(actionsPanel, BorderLayout.SOUTH);
}
 

开发者ID:TheoGauchoux,
项目名称:LudoTech,
代码行数:78,
代码来源:BorrowView.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)