mport javax.swing. * ;
import com.l2fprod.common.swing. * ;
import java.awt. * ;
import java.awt.event. * ;
import java.text. * ;
/**
*
* @author zwql
*/
public class JTaskPaneTest extends javax.swing.JFrame {
/**
* Creates new form JTaskPaneTest
*/
public JTaskPaneTest() {
initComponents();
jTaskPaneGroup1.setTitle( " aaa is aa's son " );
jTaskPaneGroup2.setTitle( " xx is xxx's father " );
DateFormat[] dateFormat = new DateFormat[ 1 ];
dateFormat[ 0 ] = new SimpleDateFormat( " yyyy-MM-dd " );
jXDatePicker1.setFormats(dateFormat);
jXDatePicker1.setDate( null );
}
Action makeAction(String title, String tooltiptext, String iconPath) {
Action action = new AbstractAction(title) {
public void actionPerformed(ActionEvent e) {}
} ;
action.putValue(Action.SMALL_ICON, new ImageIcon(iconPath));
action.putValue(Action.SHORT_DESCRIPTION, tooltiptext);
return action;
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc=" 生成的代码 ">
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
jTaskPane1 = new com.l2fprod.common.swing.JTaskPane();
jTaskPaneGroup1 = new com.l2fprod.common.swing.JTaskPaneGroup();
jButton1 = new javax.swing.JButton();
jLinkButton1 = new JLinkButton( " xxxxx " , new ImageIcon( " d:/wqlfiles/icon/z.ico " ));
jTaskPaneGroup2 = new com.l2fprod.common.swing.JTaskPaneGroup();
jButton2 = new javax.swing.JButton();
jTextField1 = new javax.swing.JTextField();
jButton3 = new javax.swing.JButton();
jXDatePicker1 = new org.jdesktop.swingx.JXDatePicker();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jButton1.setText( " jButton1 " );
jLinkButton1.setText( " jLinkButton1 " );
jLinkButton1.addActionListener( new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jLinkButton1ActionPerformed(evt);
}
} );
org.jdesktop.layout.GroupLayout jTaskPaneGroup1Layout = new org.jdesktop.layout.GroupLayout(jTaskPaneGroup1.getContentPane());
jTaskPaneGroup1.getContentPane().setLayout(jTaskPaneGroup1Layout);
jTaskPaneGroup1Layout.setHorizontalGroup(
jTaskPaneGroup1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jButton1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 209 , Short.MAX_VALUE)
.add(jLinkButton1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 209 , Short.MAX_VALUE)
);
jTaskPaneGroup1Layout.setVerticalGroup(
jTaskPaneGroup1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jTaskPaneGroup1Layout.createSequentialGroup()
.add(jLinkButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 11 , Short.MAX_VALUE)
.add(jButton1))
);
jButton2.setText( " jButton2 " );
jTextField1.setText( " jTextField1 " );
jButton3.setText( " jButton3 " );
org.jdesktop.layout.GroupLayout jTaskPaneGroup2Layout = new org.jdesktop.layout.GroupLayout(jTaskPaneGroup2.getContentPane());
jTaskPaneGroup2.getContentPane().setLayout(jTaskPaneGroup2Layout);
jTaskPaneGroup2Layout.setHorizontalGroup(
jTaskPaneGroup2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jButton2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 209 , Short.MAX_VALUE)
.add(jTaskPaneGroup2Layout.createSequentialGroup()
.add( 10 , 10 , 10 )
.add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 151 , org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButton3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 40 , org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add( 45 , 45 , 45 ))
);
jTaskPaneGroup2Layout.setVerticalGroup(
jTaskPaneGroup2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jTaskPaneGroup2Layout.createSequentialGroup()
.addContainerGap()
.add(jTaskPaneGroup2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jButton3))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 18 , Short.MAX_VALUE)
.add(jButton2))
);
org.jdesktop.layout.GroupLayout jTaskPane1Layout = new org.jdesktop.layout.GroupLayout(jTaskPane1);
jTaskPane1.setLayout(jTaskPane1Layout);
jTaskPane1Layout.setHorizontalGroup(
jTaskPane1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jTaskPane1Layout.createSequentialGroup()
.addContainerGap()
.add(jTaskPane1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false )
.add(org.jdesktop.layout.GroupLayout.LEADING, jTaskPaneGroup1, 0 , org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, jTaskPaneGroup2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 231 , Short.MAX_VALUE))
.addContainerGap())
);
jTaskPane1Layout.setVerticalGroup(
jTaskPane1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jTaskPane1Layout.createSequentialGroup()
.addContainerGap()
.add(jTaskPaneGroup1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add( 39 , 39 , 39 )
.add(jTaskPaneGroup2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap( 94 , Short.MAX_VALUE))
);
jScrollPane1.setViewportView(jTaskPane1);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add( 72 , 72 , 72 )
.add(jXDatePicker1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 119 , org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap( 119 , Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 299 , Short.MAX_VALUE))
.add(layout.createSequentialGroup()
.add( 38 , 38 , 38 )
.add(jXDatePicker1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);
pack();
} // </editor-fold>
private void jLinkButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO 将在此处添加您的处理代码:
JDirectoryChooser dc = new JDirectoryChooser();
dc.showOpenDialog( this );
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater( new Runnable() {
public void run() {
new JTaskPaneTest().setVisible( true );
}
} );
}
// 变量声明 - 不进行修改
public javax.swing.JButton jButton1;
public javax.swing.JButton jButton2;
public javax.swing.JButton jButton3;
public com.l2fprod.common.swing.JLinkButton jLinkButton1;
public javax.swing.JScrollPane jScrollPane1;
public com.l2fprod.common.swing.JTaskPane jTaskPane1;
public com.l2fprod.common.swing.JTaskPaneGroup jTaskPaneGroup1;
public com.l2fprod.common.swing.JTaskPaneGroup jTaskPaneGroup2;
public javax.swing.JTextField jTextField1;
public org.jdesktop.swingx.JXDatePicker jXDatePicker1;
// 变量声明结束
}