我正在使用来自 Androsov Vadim 的 DateChooser Lib,可以在这里找到: Sourceforge Link
我想要实现的是,只需在显示框架时显示弹出菜单。这是 DateChooserCombo 的简单实现
package testapp;
public class TestFrame extends javax.swing.JFrame {
public TestFrame() {
initComponents();
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
dateChooserCombo1 = new datechooser.beans.DateChooserCombo();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(124, Short.MAX_VALUE)
.addComponent(dateChooserCombo1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(121, 121, 121))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(22, 22, 22)
.addComponent(dateChooserCombo1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(258, Short.MAX_VALUE))
);
pack();
}// </editor-fold>
// Variables declaration - do not modify
private datechooser.beans.DateChooserCombo dateChooserCombo1;
// End of variables declaration
}
这是它现在的样子:
这就是我想要实现的目标:
如果有人做了同样的事情并且可以帮助我实现这一点,那就太好了。