package com.vci.client.workflow.eventEdit; import java.awt.Dimension; import java.awt.FlowLayout; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.WindowConstants; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableModel; import com.vci.client.ui.table.VCIBaseTableModel; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import java.awt.BorderLayout; /** * This code was edited or generated using CloudGarden's Jigloo * SWT/Swing GUI Builder, which is free for non-commercial * use. If Jigloo is being used commercially (ie, by a corporation, * company or business for any purpose whatever) then you * should purchase a license for each developer using Jigloo. * Please visit www.cloudgarden.com for details. * Use of Jigloo implies acceptance of these licensing terms. * A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR * THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED * LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE. */ public class EventEditPanel extends javax.swing.JPanel { private JScrollPane jsp; private JTable eventTable; private JPanel jPanel1; private JButton addBtn; private JButton saveBtn; private JPanel botPanel; private JButton delBtn; private JPanel btnPanel; /** * Auto-generated main method to display this * JPanel inside a new JFrame. */ public static void main(String[] args) { JFrame frame = new JFrame(); frame.getContentPane().add(new EventEditPanel()); frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); frame.pack(); frame.setVisible(true); } public EventEditPanel() { super(); initGUI(); } private void initGUI() { try { BorderLayout thisLayout = new BorderLayout(); this.setLayout(thisLayout); setPreferredSize(new Dimension(400, 300)); { jsp = new JScrollPane(); this.add(jsp, BorderLayout.CENTER); jsp.setPreferredSize(new java.awt.Dimension(198, 254)); { String[] columName = new String[] { "key", "value" }; Class[] classes = new Class[]{String.class,String.class}; VCIBaseTableModel tableModel = new VCIBaseTableModel(columName, classes); eventTable = new JTable(); jsp.setViewportView(eventTable); eventTable.setModel(tableModel); } } { btnPanel = new JPanel(); BorderLayout btnPanelLayout = new BorderLayout(); btnPanel.setLayout(btnPanelLayout); this.add(btnPanel, BorderLayout.EAST); } { jPanel1 = new JPanel(); BoxLayout jPanel1Layout = new BoxLayout(jPanel1, javax.swing.BoxLayout.Y_AXIS); jPanel1.setLayout(jPanel1Layout); this.add(jPanel1, BorderLayout.EAST); { addBtn = new JButton(); jPanel1.add(addBtn); addBtn.setText("添加"); } { delBtn = new JButton(); jPanel1.add(delBtn); delBtn.setText("删除"); } } { botPanel = new JPanel(); FlowLayout botPanelLayout = new FlowLayout(); this.add(botPanel, BorderLayout.SOUTH); botPanel.setLayout(botPanelLayout); { saveBtn = new JButton(); botPanel.add(saveBtn); saveBtn.setText("保存"); } } } catch (Exception e) { e.printStackTrace(); } } }