本文整理汇总了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);
}
示例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);
}
}
}
示例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);
}
示例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;
}
示例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;
}
示例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");
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}