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


Java JXDatePicker.setName方法代码示例

本文整理汇总了Java中org.jdesktop.swingx.JXDatePicker.setName方法的典型用法代码示例。如果您正苦于以下问题:Java JXDatePicker.setName方法的具体用法?Java JXDatePicker.setName怎么用?Java JXDatePicker.setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jdesktop.swingx.JXDatePicker的用法示例。


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

示例1: interactiveCompoundFocusedProperty

import org.jdesktop.swingx.JXDatePicker; //导入方法依赖的package包/类
public void interactiveCompoundFocusedProperty() {
    JXPanel panel = new JXPanel();
    panel.setName("plain-panel");
    // add some components inside
    panel.add(new JTextField("something to .... focus"));
    JXDatePicker picker = new JXDatePicker(new Date());
    picker.setName("picker");
    panel.add(picker);
    JComboBox combo = new JComboBox(new Object[] {"dooooooooo", 1, 2, 3, 4 });
    combo.setEditable(true);
    panel.add(new JButton("something else to ... focus"));
    panel.add(combo);
    panel.setBorder(new TitledBorder("has focus dispatcher"));
    // register the compound dispatcher
    CompoundFocusListener focusDispatcher = new CompoundFocusListener(picker);
    PropertyChangeListener l = new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            LOG.info("focused on picker " +  evt.getNewValue());
            
        }};
    focusDispatcher.addPropertyChangeListener(l);    
    
    JComponent box = Box.createVerticalBox();
    box.add(panel);
    showInFrame(box, "CompoundFocusListener (on datePicker)");
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:29,代码来源:CompoundFocusListenerTest.java

示例2: initComponents

import org.jdesktop.swingx.JXDatePicker; //导入方法依赖的package包/类
private void initComponents() {
    setLayout(new BorderLayout());
    

    JPanel monthViewContainer = new JXPanel();
    FormLayout formLayout = new FormLayout(
            "5dlu, r:d:g, l:4dlu:n, f:d:g", // columns
            "c:d:n " +
            ", t:4dlu:n, c:d:n" +
            ", t:4dlu:n, c:d:n" +
            ", t:4dlu:n, c:d:n"
    ); // rows
    PanelBuilder builder = new PanelBuilder(formLayout, monthViewContainer);
    builder.setBorder(Borders.DLU4_BORDER);
    CellConstraints cl = new CellConstraints();
    CellConstraints cc = new CellConstraints();
    
    JXTitledSeparator areaSeparator = new JXTitledSeparator();
    areaSeparator.setName("listSeparator");
    builder.add(areaSeparator, cc.xywh(1, 1, 4, 1));

    int labelColumn = 2;
    int widgetColumn = labelColumn + 2;
    int currentRow = 3;

    //creates a new picker and sets the current date to today
    datePicker = new JXDatePicker(new Date());
    datePicker.setName("datePicker");
    JLabel datePickerLabel = builder.addLabel(
            "", cl.xywh(labelColumn, currentRow, 1, 1),
            datePicker, cc.xywh(widgetColumn, currentRow, 1, 1));
    datePickerLabel.setName("datePickerLabel");
    LabelHandler.bindLabelFor(datePickerLabel, datePicker);
    currentRow += 2;
    
    dateEchoField = new JFormattedTextField();
    dateEchoField.setName("dateEchoField");
    JLabel dateEchoLabel = builder.addLabel(
            "", cl.xywh(labelColumn, currentRow, 1, 1),
            dateEchoField, cc.xywh(widgetColumn, currentRow, 1, 1));
    dateEchoLabel.setName("dateEchoLabel");
    LabelHandler.bindLabelFor(dateEchoLabel, dateEchoField);
    currentRow += 2;
    
    add(monthViewContainer, BorderLayout.CENTER);
    
    JComponent panel = createControlPanel();
    
    add(panel, BorderLayout.SOUTH);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:51,代码来源:DatePickerDemo.java


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