2 * To change this license header, choose License Headers in Project Properties.
3 * To change this template file, choose Tools | Templates
4 * and open the template in the editor.
8 import javax
.swing
.JOptionPane
;
14 public class ClarificationDetailsDialog
extends javax
.swing
.JDialog
{
16 private int selected_id
;
19 * Creates new form ClarificationDetailsDialog
21 public ClarificationDetailsDialog(java
.awt
.Frame parent
, boolean modal
) {
27 * This method is called from within the constructor to initialize the form.
28 * WARNING: Do NOT modify this code. The content of this method is always
29 * regenerated by the Form Editor.
31 @SuppressWarnings("unchecked")
32 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
33 private void initComponents() {
35 checkClarificationPending
= new javax
.swing
.JCheckBox();
36 jLabel1
= new javax
.swing
.JLabel();
37 jScrollPane1
= new javax
.swing
.JScrollPane();
38 textClarificationRemarks
= new javax
.swing
.JTextArea();
39 buttonApply
= new javax
.swing
.JButton();
40 buttonCancel
= new javax
.swing
.JButton();
42 setDefaultCloseOperation(javax
.swing
.WindowConstants
.DISPOSE_ON_CLOSE
);
43 setTitle("Clarification Details");
44 setLocationByPlatform(true);
46 checkClarificationPending
.setText("Clarification Pending");
48 jLabel1
.setText("Clarification Remarks");
50 textClarificationRemarks
.setColumns(20);
51 textClarificationRemarks
.setRows(5);
52 jScrollPane1
.setViewportView(textClarificationRemarks
);
54 buttonApply
.setMnemonic('a');
55 buttonApply
.setText("Apply");
56 buttonApply
.addActionListener(new java
.awt
.event
.ActionListener() {
57 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
58 buttonApplyActionPerformed(evt
);
62 buttonCancel
.setMnemonic('c');
63 buttonCancel
.setText("Cancel");
64 buttonCancel
.addActionListener(new java
.awt
.event
.ActionListener() {
65 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
66 buttonCancelActionPerformed(evt
);
70 javax
.swing
.GroupLayout layout
= new javax
.swing
.GroupLayout(getContentPane());
71 getContentPane().setLayout(layout
);
72 layout
.setHorizontalGroup(
73 layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.LEADING
)
74 .addGroup(layout
.createSequentialGroup()
75 .addContainerGap(javax
.swing
.GroupLayout
.DEFAULT_SIZE
, Short
.MAX_VALUE
)
76 .addGroup(layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.LEADING
)
77 .addComponent(jScrollPane1
, javax
.swing
.GroupLayout
.PREFERRED_SIZE
, 378, javax
.swing
.GroupLayout
.PREFERRED_SIZE
)
78 .addGroup(layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.TRAILING
)
79 .addGroup(layout
.createSequentialGroup()
80 .addComponent(buttonApply
, javax
.swing
.GroupLayout
.PREFERRED_SIZE
, 106, javax
.swing
.GroupLayout
.PREFERRED_SIZE
)
81 .addPreferredGap(javax
.swing
.LayoutStyle
.ComponentPlacement
.RELATED
)
82 .addComponent(buttonCancel
, javax
.swing
.GroupLayout
.PREFERRED_SIZE
, 106, javax
.swing
.GroupLayout
.PREFERRED_SIZE
))
83 .addGroup(layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.LEADING
, false)
84 .addComponent(checkClarificationPending
, javax
.swing
.GroupLayout
.DEFAULT_SIZE
, 369, Short
.MAX_VALUE
)
85 .addComponent(jLabel1
, javax
.swing
.GroupLayout
.DEFAULT_SIZE
, javax
.swing
.GroupLayout
.DEFAULT_SIZE
, Short
.MAX_VALUE
))))
86 .addContainerGap(javax
.swing
.GroupLayout
.DEFAULT_SIZE
, Short
.MAX_VALUE
))
88 layout
.setVerticalGroup(
89 layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.LEADING
)
90 .addGroup(layout
.createSequentialGroup()
92 .addComponent(checkClarificationPending
)
93 .addPreferredGap(javax
.swing
.LayoutStyle
.ComponentPlacement
.UNRELATED
)
94 .addComponent(jLabel1
)
95 .addPreferredGap(javax
.swing
.LayoutStyle
.ComponentPlacement
.RELATED
)
96 .addComponent(jScrollPane1
, javax
.swing
.GroupLayout
.DEFAULT_SIZE
, 83, Short
.MAX_VALUE
)
97 .addPreferredGap(javax
.swing
.LayoutStyle
.ComponentPlacement
.UNRELATED
)
98 .addGroup(layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.BASELINE
)
99 .addComponent(buttonApply
)
100 .addComponent(buttonCancel
))
105 }// </editor-fold>//GEN-END:initComponents
107 private void buttonCancelActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_buttonCancelActionPerformed
108 // TODO add your handling code here:
110 }//GEN-LAST:event_buttonCancelActionPerformed
112 private void buttonApplyActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_buttonApplyActionPerformed
113 // TODO add your handling code here:
114 boolean rt
= Utility
.updateNoticeClarificationDetails (selected_id
,
115 checkClarificationPending
.isSelected(),
116 textClarificationRemarks
.getText());
118 JOptionPane
.showMessageDialog(this, ERROR_UPDATING
);
121 }//GEN-LAST:event_buttonApplyActionPerformed
122 private static final String ERROR_UPDATING
= "Error in updating";
125 * @param args the command line arguments
127 public static void main(String args
[]) {
128 /* Set the Nimbus look and feel */
129 //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
130 /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
131 * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
134 for (javax
.swing
.UIManager
.LookAndFeelInfo info
: javax
.swing
.UIManager
.getInstalledLookAndFeels()) {
135 if ("Nimbus".equals(info
.getName())) {
136 javax
.swing
.UIManager
.setLookAndFeel(info
.getClassName());
140 } catch (ClassNotFoundException ex
) {
141 java
.util
.logging
.Logger
.getLogger(ClarificationDetailsDialog
.class.getName()).log(java
.util
.logging
.Level
.SEVERE
, null, ex
);
142 } catch (InstantiationException ex
) {
143 java
.util
.logging
.Logger
.getLogger(ClarificationDetailsDialog
.class.getName()).log(java
.util
.logging
.Level
.SEVERE
, null, ex
);
144 } catch (IllegalAccessException ex
) {
145 java
.util
.logging
.Logger
.getLogger(ClarificationDetailsDialog
.class.getName()).log(java
.util
.logging
.Level
.SEVERE
, null, ex
);
146 } catch (javax
.swing
.UnsupportedLookAndFeelException ex
) {
147 java
.util
.logging
.Logger
.getLogger(ClarificationDetailsDialog
.class.getName()).log(java
.util
.logging
.Level
.SEVERE
, null, ex
);
151 /* Create and display the dialog */
152 java
.awt
.EventQueue
.invokeLater(new Runnable() {
154 ClarificationDetailsDialog dialog
= new ClarificationDetailsDialog(new javax
.swing
.JFrame(), true);
155 dialog
.addWindowListener(new java
.awt
.event
.WindowAdapter() {
157 public void windowClosing(java
.awt
.event
.WindowEvent e
) {
161 dialog
.setVisible(true);
166 // Variables declaration - do not modify//GEN-BEGIN:variables
167 private javax
.swing
.JButton buttonApply
;
168 private javax
.swing
.JButton buttonCancel
;
169 private javax
.swing
.JCheckBox checkClarificationPending
;
170 private javax
.swing
.JLabel jLabel1
;
171 private javax
.swing
.JScrollPane jScrollPane1
;
172 private javax
.swing
.JTextArea textClarificationRemarks
;
173 // End of variables declaration//GEN-END:variables
175 void setFields(int selid
, boolean clarification_pending
, String
176 clarification_remarks
) {
178 checkClarificationPending
.setSelected(clarification_pending
);
179 textClarificationRemarks
.setText(clarification_remarks
);