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
.TRAILING
)
77 .addGroup(layout
.createSequentialGroup()
78 .addComponent(buttonApply
, javax
.swing
.GroupLayout
.PREFERRED_SIZE
, 106, javax
.swing
.GroupLayout
.PREFERRED_SIZE
)
79 .addPreferredGap(javax
.swing
.LayoutStyle
.ComponentPlacement
.RELATED
)
80 .addComponent(buttonCancel
, javax
.swing
.GroupLayout
.PREFERRED_SIZE
, 106, javax
.swing
.GroupLayout
.PREFERRED_SIZE
))
81 .addGroup(layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.LEADING
, false)
82 .addComponent(checkClarificationPending
, javax
.swing
.GroupLayout
.DEFAULT_SIZE
, javax
.swing
.GroupLayout
.DEFAULT_SIZE
, Short
.MAX_VALUE
)
83 .addComponent(jLabel1
, javax
.swing
.GroupLayout
.DEFAULT_SIZE
, javax
.swing
.GroupLayout
.DEFAULT_SIZE
, Short
.MAX_VALUE
)
84 .addComponent(jScrollPane1
, javax
.swing
.GroupLayout
.DEFAULT_SIZE
, 369, Short
.MAX_VALUE
)))
85 .addContainerGap(21, Short
.MAX_VALUE
))
87 layout
.setVerticalGroup(
88 layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.LEADING
)
89 .addGroup(layout
.createSequentialGroup()
91 .addComponent(checkClarificationPending
)
92 .addPreferredGap(javax
.swing
.LayoutStyle
.ComponentPlacement
.UNRELATED
)
93 .addComponent(jLabel1
)
94 .addPreferredGap(javax
.swing
.LayoutStyle
.ComponentPlacement
.RELATED
)
95 .addComponent(jScrollPane1
, javax
.swing
.GroupLayout
.PREFERRED_SIZE
, 96, javax
.swing
.GroupLayout
.PREFERRED_SIZE
)
96 .addPreferredGap(javax
.swing
.LayoutStyle
.ComponentPlacement
.RELATED
, 17, Short
.MAX_VALUE
)
97 .addGroup(layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.BASELINE
)
98 .addComponent(buttonApply
)
99 .addComponent(buttonCancel
))
104 }// </editor-fold>//GEN-END:initComponents
106 private void buttonCancelActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_buttonCancelActionPerformed
107 // TODO add your handling code here:
109 }//GEN-LAST:event_buttonCancelActionPerformed
111 private void buttonApplyActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_buttonApplyActionPerformed
112 // TODO add your handling code here:
113 boolean rt
= Utility
.updateNoticeClarificationDetails (selected_id
,
114 checkClarificationPending
.isSelected(),
115 textClarificationRemarks
.getText());
117 JOptionPane
.showMessageDialog(this, ERROR_UPDATING
);
120 }//GEN-LAST:event_buttonApplyActionPerformed
121 private static final String ERROR_UPDATING
= "Error in updating";
124 * @param args the command line arguments
126 public static void main(String args
[]) {
127 /* Set the Nimbus look and feel */
128 //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
129 /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
130 * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
133 for (javax
.swing
.UIManager
.LookAndFeelInfo info
: javax
.swing
.UIManager
.getInstalledLookAndFeels()) {
134 if ("Nimbus".equals(info
.getName())) {
135 javax
.swing
.UIManager
.setLookAndFeel(info
.getClassName());
139 } catch (ClassNotFoundException ex
) {
140 java
.util
.logging
.Logger
.getLogger(ClarificationDetailsDialog
.class.getName()).log(java
.util
.logging
.Level
.SEVERE
, null, ex
);
141 } catch (InstantiationException ex
) {
142 java
.util
.logging
.Logger
.getLogger(ClarificationDetailsDialog
.class.getName()).log(java
.util
.logging
.Level
.SEVERE
, null, ex
);
143 } catch (IllegalAccessException ex
) {
144 java
.util
.logging
.Logger
.getLogger(ClarificationDetailsDialog
.class.getName()).log(java
.util
.logging
.Level
.SEVERE
, null, ex
);
145 } catch (javax
.swing
.UnsupportedLookAndFeelException ex
) {
146 java
.util
.logging
.Logger
.getLogger(ClarificationDetailsDialog
.class.getName()).log(java
.util
.logging
.Level
.SEVERE
, null, ex
);
150 /* Create and display the dialog */
151 java
.awt
.EventQueue
.invokeLater(new Runnable() {
153 ClarificationDetailsDialog dialog
= new ClarificationDetailsDialog(new javax
.swing
.JFrame(), true);
154 dialog
.addWindowListener(new java
.awt
.event
.WindowAdapter() {
156 public void windowClosing(java
.awt
.event
.WindowEvent e
) {
160 dialog
.setVisible(true);
165 // Variables declaration - do not modify//GEN-BEGIN:variables
166 private javax
.swing
.JButton buttonApply
;
167 private javax
.swing
.JButton buttonCancel
;
168 private javax
.swing
.JCheckBox checkClarificationPending
;
169 private javax
.swing
.JLabel jLabel1
;
170 private javax
.swing
.JScrollPane jScrollPane1
;
171 private javax
.swing
.JTextArea textClarificationRemarks
;
172 // End of variables declaration//GEN-END:variables
174 void setFields(int selid
, boolean clarification_pending
, String
175 clarification_remarks
) {
177 checkClarificationPending
.setSelected(clarification_pending
);
178 textClarificationRemarks
.setText(clarification_remarks
);