当前位置: 首页>>代码示例>>Java>>正文


Java JDateChooser类代码示例

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


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

示例1: NuevoPrestamo

import com.toedter.calendar.JDateChooser; //导入依赖的package包/类
public NuevoPrestamo(Connection conn, JFrameJTable principal) {
	setIconImage(Toolkit.getDefaultToolkit().getImage(NuevoPrestamo.class.getResource("/biblioteca/images/book.png")));
	setTitle("Realizar pr�stamo");
	this.conn=conn;
	this.principal=principal;
	this.principal.setVisible(false);
	initComponents();		
	
	fecha_prest = new JDateChooser();
	fecha_prest.setBounds(16, 208, 126, 23);
	contentPane.add(fecha_prest);
	
	btnAceptar = new JButton("Aceptar");
	btnAceptar.setBounds(162, 264, 89, 23);
	contentPane.add(btnAceptar);
	btnAceptar.addActionListener(this);
	btnAceptar.setEnabled(false);

}
 
开发者ID:JuandeLS3,项目名称:Library-app,代码行数:20,代码来源:NuevoPrestamo.java

示例2: clear

import com.toedter.calendar.JDateChooser; //导入依赖的package包/类
public static void clear(JPanel panel){
  Component[] comps = panel.getComponents();
  Component temp;
  for (int i = 0; i < panel.getComponentCount(); i++){
    temp = comps[i];
    if (temp instanceof JTextField){
      ((JTextField)temp).setText("");
    } else if (temp instanceof JScrollPane){
    	if (((JScrollPane)temp).getViewport().getComponent(0) instanceof JTextArea){
     	((JTextArea)((JScrollPane)temp).getViewport().getComponent(0)).setText("");
    	}
    } else if (temp instanceof JComboBox){
  	  if(((JComboBox)temp).getSelectedItem()!=null){
  	   ((JComboBox)temp).setSelectedIndex(0);
  	  }
    } else if (temp instanceof JDateChooser){
      ((JDateChooser)temp).setDate(null);
    } 
  }
}
 
开发者ID:unsftn,项目名称:bisis-v4,代码行数:21,代码来源:Utils.java

示例3: buildActionPanel

import com.toedter.calendar.JDateChooser; //导入依赖的package包/类
private void buildActionPanel() {
    JPanel actionPanel = new JPanel();
    actionPanel.setLayout(new BorderLayout());
    JButton listButton = new JButton(listEventsAction);
    listButton.setPreferredSize(new Dimension(100, 25));
    dateChooser = new JDateChooser(new Date());
    dateChooser.setPreferredSize(new Dimension(110, 25));
    JPanel componentPanel = new JPanel();
    componentPanel.add(listButton);
    componentPanel.add(dateChooser);
    JLabel filterLabel = new JLabel(resourceManager.getString("label.filter"), JLabel.RIGHT);
    JComboBox filterComboBox = new JComboBox();
    filterComboBox.addItem(REMOVE_FILTER);
    for (String type : Event.TYPES) {
        filterComboBox.addItem(type);
    }
    filterComboBox.addActionListener(new FilterActionListener());
    JPanel filterPanel = new JPanel();
    filterPanel.add(filterLabel);
    filterPanel.add(filterComboBox);
    actionPanel.add(componentPanel, BorderLayout.WEST);
    actionPanel.add(filterPanel, BorderLayout.EAST);
    add(actionPanel, BorderLayout.SOUTH);
}
 
开发者ID:objektwerks,项目名称:swing,代码行数:25,代码来源:EventPanel.java

示例4: generateReport

import com.toedter.calendar.JDateChooser; //导入依赖的package包/类
@Override
public DatasourceXml generateReport() {
    DatasourceXml xmlSource= new DatasourceXml();
    Date from = ((JDateChooser) fromDatePanel.getComponent(0)).getDate();
    Date to   = ((JDateChooser) toDatePanel.getComponent(0)).getDate();
    
    String strXmlSource = "";
    
    try {
        xmlSource = RawResultFile.getFileSystemXmlFile(
                IndexUtil.getAllFilesBetweenDates(this.reportPanel.getCaseFacade(),
                from, to)
        ,this.reportPanel.getCaseFacade());
    } catch (IOException ex) {
        Logger.getLogger(FilesReportPanel.class.getName()).log(Level.SEVERE, null, ex);
    }
    
    return xmlSource;
}
 
开发者ID:CoEIA,项目名称:DEM,代码行数:20,代码来源:FilesTimeReportPanel.java

示例5: createComponent

import com.toedter.calendar.JDateChooser; //导入依赖的package包/类
@Override
protected QuestionPanel createComponent() {
	QuestionPanel panel = createDefaultQuestionPanel(wizardElement, componentController.getCatalogService());

	calendar = new JDateChooser();
	
	if (wizardElement.isSetToday()){
		calendar.setDate(new Date());
	} else if (wizardElement.isSetDefaultValue()){
		calendar.setDate(wizardElement.getDefaultValue().getTime());
	}

	//add listener
	PropertyChangeListener listener = createDefaultListener();
	if (listener!= null){
		calendar.addPropertyChangeListener(listener);
	}

	panel.add(calendar);

	return panel;
}
 
开发者ID:lexml,项目名称:madoc,代码行数:23,代码来源:DateQuestionComponentSwing.java

示例6: updateProjectButtonActionPerformed

import com.toedter.calendar.JDateChooser; //导入依赖的package包/类
private void updateProjectButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_updateProjectButtonActionPerformed
    // TODO add your handling code here:
    Object projectItem = chooseProjectComboBox.getSelectedItem();
    if (!projectItem.toString().equals("Choose a Project")) {
        String projectId = ((ComboItem) projectItem).getValue();

        for (int i = 0; i < participantsList.size(); i++) {
            ProjectParticipants projectParticipants = participantsList.get(i);
            System.out.println("projectParticipants is : " + projectParticipants);
            System.out.println("project id :" + projectParticipants.getProjectParticipantsPK().getProjectId() + "; "
                    + "role id : " + projectParticipants.getProjectParticipantsPK().getDesignation() + "; "
                    + "participant id : " + projectParticipants.getProjectParticipantsPK().getParticipantId());
        }
        boolean success = editProjectParticipantsController.editProjectParticipants(projectId, participantsList);
        if (success) {
            JOptionPane.showMessageDialog(jPanel1, "Participants has been Updated succesfully");
            Component[] panels = jPanel1.getComponents();
            for (Component C : panels) {
                if (C instanceof JTextField || C instanceof JTextArea || C instanceof JTable
                        || C instanceof JDateChooser || C instanceof JFileChooser) {
                    ((JTextComponent) C).setText(""); //abstract superclass
                }
                if (C instanceof JComboBox) {

                }
            }


        } else {
            JOptionPane.showMessageDialog(jPanel1, "Participants could not be Updated");
        }
    } else {
        JOptionPane.showMessageDialog(this, "Please select a project first");
    }
}
 
开发者ID:hinsenchan,项目名称:fil_project_mgmt_app_v2,代码行数:36,代码来源:EditProjectParticipants.java

示例7: DateChooserPanel

import com.toedter.calendar.JDateChooser; //导入依赖的package包/类
public DateChooserPanel() {
	setName("JDateChooser");

	GridBagLayout gridbag = new GridBagLayout();
	GridBagConstraints c = new GridBagConstraints();
	c.fill = GridBagConstraints.BOTH;

	setLayout(gridbag);

	components = new JComponent[6];
	components[0] = new JDateChooser();
	components[1] = new JDateChooser();
	((JDateChooser) components[1]).getJCalendar().getDayChooser()
			.addDateEvaluator(new BirthdayEvaluator());
	((JDateChooser) components[1]).getJCalendar().getDayChooser()
			.addDateEvaluator(new TestDateEvaluator());
	((JDateChooser) components[1]).getJCalendar().setTodayButtonVisible(
			true);
	((JDateChooser) components[1]).getJCalendar().setNullDateButtonVisible(
			true);

	components[2] = new JDateChooser(new Date());
	components[3] = new JDateChooser(null, null, null,
			new JSpinnerDateEditor());
	components[4] = new JDateChooser("yyyy/MM/dd", "####/##/##", '_');
	components[5] = new DemoTable();

	addEntry("Default", components[0], gridbag);
	addEntry("Default (with addons)", components[1], gridbag);
	addEntry("Default with date set", components[2], gridbag);
	addEntry("Spinner Editor", components[3], gridbag);
	addEntry("Explicite date pattern and mask", components[4], gridbag);
	addEntry("Table with date editors", components[5], gridbag);
}
 
开发者ID:hinsenchan,项目名称:fil_project_mgmt_app_v2,代码行数:35,代码来源:DateChooserPanel.java

示例8: setDateField

import com.toedter.calendar.JDateChooser; //导入依赖的package包/类
private void setDateField(JDateChooser date, JPanel pane, String str) {
	CardLayout card = new CardLayout(0, 0);
	date.setMinimumSize(new Dimension(120, 20));
	date.setDateFormatString("dd/mm/yyyy");
	pane.setLayout(card);
	card.show(pane, str);
	pane.add(date);
}
 
开发者ID:markkohdev,项目名称:oStorybook,代码行数:9,代码来源:EditPerson.java

示例9: buildModelPanel

import com.toedter.calendar.JDateChooser; //导入依赖的package包/类
private void buildModelPanel() {
    JPanel modelPanel = new JPanel();
    modelPanel.setLayout(new SpringLayout());
    JLabel urlLabel = new JLabel(resourceManager.getString("label.url"), JLabel.TRAILING);
    urlTextField = new JTextField(32);
    urlTextField.setEnabled(false);
    JLabel crawlDepthLabel = new JLabel(resourceManager.getString("label.crawl.depth"), JLabel.TRAILING);
    JSpinner crawlDepthSpinner = new JSpinner();
    crawlDepthSpinnerModel = new SpinnerNumberModel(1, 1, 10, 1);
    crawlDepthSpinner.setModel(crawlDepthSpinnerModel);
    JLabel createdDateLabel = new JLabel(resourceManager.getString("label.created.date"), JLabel.TRAILING);
    createdDateTextField = new JTextField(32);
    createdDateTextField.setEnabled(false);
    JLabel crawlDateLabel = new JLabel(resourceManager.getString("label.crawl.date"), JLabel.TRAILING);
    crawlDateTextField = new JTextField(32);
    crawlDateTextField.setEnabled(false);
    JLabel nextCrawlDateLabel = new JLabel(resourceManager.getString("label.next.crawl.date"), JLabel.TRAILING);
    nextCrawlDateChooser = new JDateChooser(new Date());
    nextCrawlDateChooser.setDateFormatString("yyyy.MM.dd:HH.mm.ss");
    JLabel typeLabel = new JLabel(resourceManager.getString("label.type"), JLabel.TRAILING);
    typeComboBox = typeComboBox = new JComboBox(Domain.TYPES);
    JLabel indexLabel = new JLabel(resourceManager.getString("label.index"), JLabel.TRAILING);
    JLabel searchLabel = new JLabel(resourceManager.getString("label.search"), JLabel.TRAILING);
    JTextField searchTextField = new JTextField();
    searchTextField.setAction(searchDomainAction);
    searchTextField.setToolTipText(resourceManager.getString("tool.tip.search"));
    JLabel [] labels = new JLabel [] { urlLabel, crawlDepthLabel, createdDateLabel, crawlDateLabel, nextCrawlDateLabel, typeLabel, indexLabel, searchLabel };
    JComponent [] components = new JComponent [] { urlTextField, crawlDepthSpinner, createdDateTextField, crawlDateTextField, nextCrawlDateChooser, typeComboBox, indexComboBox, searchTextField };
    SpringLayoutManager.buildForm(modelPanel, labels, components);
    add(modelPanel);
}
 
开发者ID:objektwerks,项目名称:swing,代码行数:32,代码来源:GroupDomainPanel.java

示例10: EmailPanel

import com.toedter.calendar.JDateChooser; //导入依赖的package包/类
/** Creates new form EmailPanel */
    public EmailPanel(Case aIndex, JFrame parentFrame) {
        initComponents();
        
        this.index = aIndex;
        this.parentFrame = parentFrame;
        
        // configure file chooser to select files (txt)
        fileChooser = new JFileChooser();
        fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        fileChooser.setFileFilter(new GUIFileFilter("Text Files (*.txt)", "txt"));
        
        // add a native web browser
        webBrowser.setBarsVisible(false);
        webBrowser.setStatusBarVisible(false);
        HTMLRenderPanel.add(webBrowser, BorderLayout.CENTER);
        
        emailSearchTextField.getDocument().addDocumentListener(new EmailSearchInputListener());        
        
        // jcalendar initilizing
        toDatePanel.add(new JDateChooser(new Date()),BorderLayout.CENTER);
        fromDatePanel.add(new JDateChooser(new Date(0)),BorderLayout.CENTER);        
        
        // set outlook data to outlook combobox
//        for (String pstPath: index.getPstPath())
//            outlookComboBox.addItem( pstPath );      
        
        disableNotIndexedComponent();
        JTableUtil.setTableAlignmentValue(inboxTable, 2);
        JTableUtil.setTableAlignmentValue(sentItemTable, 2);
        JTableUtil.setTableAlignmentValue(espTable, 1);
        JTableUtil.setTableAlignmentValue(locationTable, 1);

    }
 
开发者ID:CoEIA,项目名称:DEM,代码行数:35,代码来源:EmailPanel.java

示例11: FilesTimeReportPanel

import com.toedter.calendar.JDateChooser; //导入依赖的package包/类
/** Creates new form ListFileTimeReportPanel */
public FilesTimeReportPanel(ReportPanel panel) {
    initComponents();
    this.reportPanel = panel;
    
    toDatePanel.add(new JDateChooser(new Date()),BorderLayout.CENTER);
    fromDatePanel.add(new JDateChooser(new Date(0)),BorderLayout.CENTER); 
}
 
开发者ID:CoEIA,项目名称:DEM,代码行数:9,代码来源:FilesTimeReportPanel.java

示例12: doBind

import com.toedter.calendar.JDateChooser; //导入依赖的package包/类
protected Binding doBind(JComponent control, FormModel formModel, String formPropertyPath, Map context) {
	Assert.isTrue(control instanceof JDateChooser, "Control must be an instance of JDateChooser.");
	JCalendarDateFieldBinding binding = new JCalendarDateFieldBinding((JDateChooser) control, formModel,
			formPropertyPath);
	applyContext(binding, context);

	return binding;
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:9,代码来源:JCalendarDateFieldBinder.java

示例13: createSearchPanel

import com.toedter.calendar.JDateChooser; //导入依赖的package包/类
private JPanel createSearchPanel() {
    JPanel searchPanel = new JPanel();
    searchPanel.setBorder(new TitledBorder(null, "Rechnungen suchen",
            TitledBorder.LEADING, TitledBorder.TOP, null, null));
    searchPanel.setLayout(new MigLayout("", "[][grow]", "[][grow][]"));

    JLabel lblEsWerdenNur = new JLabel(
            "<html>Es werden nur Rechnungen von Mitgliedern angezeigt, für die ein "
                    + "gültiges, aktives SEPA-Mandat vorhanden ist.");
    searchPanel.add(lblEsWerdenNur, "cell 0 0 2 1,wmax 100%");

    /*** Rechnungsdatum ***/
    chckbxRechnungsdatum = new JCheckBox("Rechnungsdatum:");
    chckbxRechnungsdatum
            .addItemListener(new RechnungsdatumCheckboxListener());
    searchPanel.add(chckbxRechnungsdatum, "flowx,cell 0 1");

    inputRechnungsdatum = new JDateChooser();
    inputRechnungsdatum.setEnabled(false);
    searchPanel.add(inputRechnungsdatum, "cell 1 1,growy");

    /*** Untere Zeile ***/
    JPanel sucheBottomPanel = new JPanel();
    searchPanel.add(sucheBottomPanel, "cell 0 2 2 1,growx");
    sucheBottomPanel.setLayout(new MigLayout("insets 0", "[][grow]", "[]"));

    chckbxBereitsErstellt = new JCheckBox(
            "Rechnungen, für die bereits eine Lastschrift erstellt wurde");
    sucheBottomPanel.add(chckbxBereitsErstellt,
            "cell 0 0,alignx left,growy");

    JButton btnSuchen = new JButton("Suchen");
    btnSuchen.addActionListener(new MandateSucheListener());
    sucheBottomPanel.add(btnSuchen, "cell 1 0,alignx right,aligny top");

    return searchPanel;
}
 
开发者ID:fabianlipp,项目名称:jnami,代码行数:38,代码来源:LastschriftErstellenWindow.java

示例14: createBezahltPanel

import com.toedter.calendar.JDateChooser; //导入依赖的package包/类
private JPanel createBezahltPanel() {
    JPanel panel = new JPanel();
    panel.setLayout(new MigLayout("", "[][grow]", "[][pref!][][][]"));

    chckbxBuchungenErstellen = new JCheckBox("Buchungen erstellen");
    chckbxBuchungenErstellen.setSelected(true);
    chckbxBuchungenErstellen
            .addItemListener(new BuchungenErstellenCheckboxListener());
    panel.add(chckbxBuchungenErstellen, "cell 0 0,span");

    halbjahrBetraegeScrollPane = new JScrollPane();
    halbjahrBetraegeModel = new HalbjahrBetraegeModel();
    halbjahrBetraegeTable = new JTable();
    halbjahrBetraegeTable.setModel(halbjahrBetraegeModel);
    setTablePreferredHeightInRows(halbjahrBetraegeTable, 2);
    halbjahrBetraegeScrollPane.setViewportView(halbjahrBetraegeTable);
    panel.add(halbjahrBetraegeScrollPane, "cell 0 1,grow,span");

    JLabel lblBuchungsdatum = new JLabel("Buchungsdatum:");
    panel.add(lblBuchungsdatum, "flowx,cell 0 2");
    inputBuchungsdatum = new JDateChooser(new Date());
    panel.add(inputBuchungsdatum, "cell 1 2");

    JLabel lblBuchungstyp = new JLabel("Buchungstyp:");
    panel.add(lblBuchungstyp, "flowx,cell 0 3");
    Buchungstyp[] allowedTypes = new Buchungstyp[] { Buchungstyp.BAR,
            Buchungstyp.LASTSCHRIFT, Buchungstyp.UEBERWEISUNG };
    inputBuchungstyp = new JComboBox<Buchungstyp>(allowedTypes);
    inputBuchungstyp.setSelectedItem(Buchungstyp.UEBERWEISUNG);
    panel.add(inputBuchungstyp, "cell 1 3");

    JButton btnRechnungBezahlt = new JButton("Rechnung bezahlt");
    btnRechnungBezahlt.addActionListener(new BezahltAction());
    panel.add(btnRechnungBezahlt, "cell 0 4,span,alignx right");

    return panel;
}
 
开发者ID:fabianlipp,项目名称:jnami,代码行数:38,代码来源:RechnungenVerwaltenWindow.java

示例15: createMahnungPanel

import com.toedter.calendar.JDateChooser; //导入依赖的package包/类
private JPanel createMahnungPanel() {
    JPanel panel = new JPanel();
    panel.setLayout(new MigLayout("", "[][]", "[][][][]"));

    JLabel lblDatum = new JLabel("Datum:");
    panel.add(lblDatum, "cell 0 0");
    inputMahnungDatum = new JDateChooser(new Date());
    inputMahnungDatum
            .addPropertyChangeListener(new RechnungsdatumAendernListener());
    panel.add(inputMahnungDatum, "cell 1 0,grow");

    JLabel lblFrist = new JLabel("Frist:");
    panel.add(lblFrist, "cell 0 1");
    inputFristDatum = new JDateChooser(getFristForDatum(new Date()));
    panel.add(inputFristDatum, "cell 1 1,grow");

    JLabel lblTyp = new JLabel("Typ:");
    panel.add(lblTyp, "cell 0 2");
    lblMahnungArt = new JLabel();
    panel.add(lblMahnungArt, "cell 1 2,grow");

    JButton btnMahnungErstellen = new JButton("Mahnung erstellen");
    btnMahnungErstellen.addActionListener(new MahnungAction());
    panel.add(btnMahnungErstellen, "cell 0 3,span,alignx right");

    return panel;
}
 
开发者ID:fabianlipp,项目名称:jnami,代码行数:28,代码来源:RechnungenVerwaltenWindow.java


注:本文中的com.toedter.calendar.JDateChooser类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。