📄 saisispot.java
字号:
/* * GesContrat.java * * Created on December 9, 2008, 5:21 PM */package view.swing;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.util.ArrayList;import java.util.Date;import java.util.List;import javax.swing.BorderFactory;import javax.swing.DefaultComboBoxModel;import javax.swing.DefaultListModel;import javax.swing.GroupLayout;import javax.swing.JButton;import javax.swing.JComboBox;import javax.swing.JLabel;import javax.swing.JList;import javax.swing.JOptionPane;import javax.swing.JPanel;import javax.swing.JScrollPane;import javax.swing.JTabbedPane;import javax.swing.JTextField;import javax.swing.LayoutStyle;import javax.swing.SwingConstants;import service.ServiceImpl;import util.Theme;import view.swing.model.CateComboxModel;import com.toedter.calendar.JDateChooser;import dao.model.Contrat;import dao.model.Passage;import dao.model.Spot;/** * * @author alex */public class SaisiSpot extends javax.swing.JPanel { private DefaultComboBoxModel myComboxModel; private DefaultListModel myListModel; private List<Passage> listPassage; /** Creates new form GesContrat */ public SaisiSpot() { initComponents(); listPassage=new ArrayList<Passage>(); } /** 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. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new JPanel(); jPanel2 = new JPanel(); jLabel1 = new JLabel(); jLabel2 = new JLabel(); jLabel3 = new JLabel(); cateCombox = new JComboBox(); nombreText = new JTextField(); jButton1 = new JButton(); jPanel3 = new JPanel(); jLabel4 = new JLabel(); jTextField1 = new JTextField(); jLabel5 = new JLabel(); jLabel6 = new JLabel(); themeCombox = new JComboBox(); jTextField3 = new JTextField(); jLabel7 = new JLabel(); dateChooser = new JDateChooser(); jPanel4 = new JPanel(); jScrollPane1 = new JScrollPane(); jList1 = new JList(); jButton2 = new JButton(); delPassage=new JButton("Del"); myComboxModel=new CateComboxModel(); myListModel=new DefaultListModel(); themeCombox.setModel(new DefaultComboBoxModel(new Theme().getThemes().toArray())); jPanel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Saisir un Spot")); jPanel2.setBorder(BorderFactory.createEtchedBorder()); jLabel1.setText("Passge :"); jLabel2.setText("Catégorie"); jLabel3.setText("Nombre"); cateCombox.setModel(myComboxModel); jButton1.setText("Add"); jButton1.addActionListener(new ActionListener(){ @Override public void actionPerformed(ActionEvent e) { addPassageActionPerformed(e); } }); delPassage.addActionListener(new ActionListener(){ @Override public void actionPerformed(ActionEvent e) { delPassageActionPerformed(e); } }); GroupLayout jPanel2Layout = new GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(22, 22, 22) .addComponent(jLabel1) .addGap(32, 32, 32) .addGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(cateCombox, GroupLayout.PREFERRED_SIZE, 115, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2)) .addGap(25, 25, 25) .addGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(nombreText, GroupLayout.PREFERRED_SIZE, 60, GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jButton1, GroupLayout.PREFERRED_SIZE, 59, GroupLayout.PREFERRED_SIZE) .addComponent(delPassage, GroupLayout.PREFERRED_SIZE, 59, GroupLayout.PREFERRED_SIZE)) .addComponent(jLabel3)) .addContainerGap(72, Short.MAX_VALUE)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(jLabel3)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(nombreText, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1) .addComponent(jButton1) .addComponent(delPassage) .addComponent(cateCombox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel3.setBorder(BorderFactory.createEtchedBorder()); jLabel4.setText("Titre :"); jLabel5.setText("Theme :"); jLabel6.setText("Durée :"); jLabel7.setText("Data Min :"); GroupLayout jPanel3Layout = new GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addGap(22, 22, 22) .addGroup(jPanel3Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false) .addComponent(jLabel6, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel7, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel5, GroupLayout.PREFERRED_SIZE, 47, Short.MAX_VALUE) .addGroup(jPanel3Layout.createSequentialGroup() .addComponent(jLabel4, GroupLayout.PREFERRED_SIZE, 55, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -