1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
|
public class ChoixCatalogue extends JFrame {
private JPanel contentPane;
private Database scherzo = new Database();
private QueryDataSet queryDataSetCatal = new QueryDataSet();
private String requete = "select CAT_LIB,CAT_CODE,"
+
" TO_CHAR(TRUNC(CAT_DATE)-41, 'DD/MM/YYYY') AS DATED,"
+
" TO_CHAR(TRUNC(CAT_DATE), 'DD/MM/YYYY') AS DATEF,"
+
" DECODE(SIGN(CAT_DATEF-(TRUNC(SYSDATE)-41)),-1,'Terminé','En cours') AS ETAT"
+ " FROM CATA"
+ " WHERE CAT_DATEF>=TRUNC(SYSDATE)-75"
+ " AND CAT_DATE>=TRUNC(SYSDATE)"
+ " AND CAT_DATE<=TRUNC(SYSDATE+41)"
+ " ORDER BY CAT_LIB";
private JComboBox jComboBoxCata = new JComboBox();
private JLabel jLabel1 = new JLabel();
private JButton jButtonVisual = new JButton();
private JPanel jPanel1 = new JPanel();
private JLabel jLabel2 = new JLabel();
private GridLayout gridLayout1 = new GridLayout();
private JLabel jLabel3 = new JLabel();
private ImageIcon imgCharg;
private TitledBorder titledBorder1 = new TitledBorder("");
private String[][] lesCatas;
private Connection conn;
//private JChargement jchargmt;
private JChargThread jct;
public ChoixCatalogue() {
try {
setDefaultCloseOperation(EXIT_ON_CLOSE);
jct = new JChargThread();
jct.start();
jbInit();
// Centrer la fenêtre
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize = this.getSize();
if (frameSize.height > screenSize.height) {
frameSize.height = screenSize.height;
}
if (frameSize.width > screenSize.width) {
frameSize.width = screenSize.width;
}
this.setLocation((screenSize.width - frameSize.width) / 2,
(screenSize.height - frameSize.height) / 2);
this.setVisible(true);
} catch (Exception exception) {
exception.printStackTrace();
}
}
/**
* Initialisation du composant.
*
* @throws java.lang.Exception
*/
private void jbInit() throws Exception {
contentPane = (JPanel) getContentPane();
contentPane.setLayout(null);
setSize(new Dimension(400, 300));
setTitle("Reporting Catalogue V2 - Choix d'un catalogue");
this.addWindowListener(new ChoixCatalogue_this_windowAdapter(this));
scherzo.setConnection(new ConnectionDescriptor(
"jdbc:oracle:thin:@192.165.1.5:1521:PSZO", "scherzo",
"carrefour", false, "oracle.jdbc.driver.OracleDriver"));
queryDataSetCatal.setQuery(new QueryDescriptor(scherzo, "", null, false,
Load.ALL));
jComboBoxCata.setForeground(Color.black);
jComboBoxCata.setBounds(new Rectangle(66, 74, 269, 24));
ResultSet rslt = exec_query(requete);
createCombo(rslt);
//jchargmt.dispose();
jct.arret();
jLabel1.setFont(new java.awt.Font("Tempus Sans ITC", Font.BOLD,
28));
jLabel1.setAlignmentX((float) 0.5);
jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
jLabel1.setHorizontalTextPosition(SwingConstants.CENTER);
jLabel1.setText("Sélection d\'un catalogue");
jLabel1.setBounds(new Rectangle(19, 13, 362, 43));
jButtonVisual.setBounds(new Rectangle(144, 115, 113, 34));
jButtonVisual.setFont(new java.awt.Font("Times New Roman",
Font.BOLD,
15));
jButtonVisual.setText("Visualiser");
jButtonVisual.addActionListener(new
ChoixCatalogue_jButtonVisual_actionAdapter(this));
jLabel2.setFont(new java.awt.Font("Tempus Sans ITC",
Font.BOLD | Font.ITALIC, 16));
jLabel2.setForeground(new Color(0, 111, 227));
jLabel2.setHorizontalAlignment(SwingConstants.CENTER);
jLabel2.setHorizontalTextPosition(SwingConstants.CENTER);
contentPane.add(jLabel1);
contentPane.add(jComboBoxCata);
contentPane.add(jButtonVisual);
imgCharg = new ImageIcon(ReportingCatalogueV2.class.getResource(
"chargBarre.gif"));
}
... |