AboutFrame.java
Go to the documentation of this file.
1 package p2pgui;
2 
8 public class AboutFrame extends javax.swing.JDialog {
10  public static final int RET_CANCEL = 0;
12  public static final int RET_OK = 1;
13 
18  public AboutFrame(java.awt.Frame parent, boolean modal) {
19  super(parent, modal);
21  }
22 
26  public int getReturnStatus() {
27  return returnStatus;
28  }
29 
34  @SuppressWarnings("unchecked")
35  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
36  private void initComponents() {
37 
38  okButton = new javax.swing.JButton();
39  jLabel1 = new javax.swing.JLabel();
40  jLabel2 = new javax.swing.JLabel();
41 
42  setTitle("P2PFileSystem - About");
43  setName("AboutFrame"); // NOI18N
44  addWindowListener(new java.awt.event.WindowAdapter() {
45  public void windowClosing(java.awt.event.WindowEvent evt) {
46  closeDialog(evt);
47  }
48  });
49 
50  okButton.setText("OK");
51  okButton.addActionListener(new java.awt.event.ActionListener() {
52  public void actionPerformed(java.awt.event.ActionEvent evt) {
54  }
55  });
56 
57  jLabel1.setText("<html>P2PFileSystem<br>Versione 1.0 <br><br> Authors: <br>(R)@ https://www.pietris.net <br>(R)@ Pietris.net <br>(R)@ Pietris.net </html>");
58  jLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
59 
60  jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/Help.png"))); // NOI18N
61 
62  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
63  getContentPane().setLayout(layout);
64  layout.setHorizontalGroup(
65  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
66  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
67  .addContainerGap()
68  .addComponent(jLabel2)
69  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE)
70  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
71  .addComponent(okButton, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
72  .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE))
73  .addGap(46, 46, 46))
74  );
75  layout.setVerticalGroup(
76  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
77  .addGroup(layout.createSequentialGroup()
78  .addContainerGap()
79  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
80  .addComponent(jLabel2)
81  .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE))
82  .addGap(18, 18, 18)
83  .addComponent(okButton)
84  .addContainerGap(24, Short.MAX_VALUE))
85  );
86 
87  pack();
88  }// </editor-fold>//GEN-END:initComponents
89 
94  private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
95  doClose(RET_OK);
96  }//GEN-LAST:event_okButtonActionPerformed
97 
102  private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
104  }//GEN-LAST:event_closeDialog
105 
110  private void doClose(int retStatus) {
111  returnStatus = retStatus;
112  setVisible(false);
113  dispose();
114  }
115 
116 
117  // Variables declaration - do not modify//GEN-BEGIN:variables
118  private javax.swing.JLabel jLabel1;
119  private javax.swing.JLabel jLabel2;
120  private javax.swing.JButton okButton;
121  // End of variables declaration//GEN-END:variables
122 
123  private int returnStatus = RET_CANCEL;
124 }
void okButtonActionPerformed(java.awt.event.ActionEvent evt)
Azione da effettuare se avviene la pressione del bottone OK.
Definition: AboutFrame.java:94
Classe che genera graficamente la finestra di "About", con informazioni sul software, la version e gli autori.
Definition: AboutFrame.java:8
void closeDialog(java.awt.event.WindowEvent evt)
Azione da effettuare se avviene la pressione della X per chiudere la finestra.
static final int RET_OK
Codice di ritorno della stato - ritorna se viene premuto il bottone OK.
Definition: AboutFrame.java:12
int getReturnStatus()
Funzione che fornisce lo stato di ritorno della finestra.
Definition: AboutFrame.java:26
void initComponents()
Metodo chiamato dal costruttore per inizializzare la form WARNING: Do NOT modify this code...
Definition: AboutFrame.java:36
javax.swing.JLabel jLabel1
AboutFrame(java.awt.Frame parent, boolean modal)
Costruttore della classe che crea un nuovo form AboutFrame.
Definition: AboutFrame.java:18
javax.swing.JLabel jLabel2
static final int RET_CANCEL
Codice di ritorno della stato - ritorna se viene premuto il bottone Cancel.
Definition: AboutFrame.java:10
void doClose(int retStatus)
Funzione imposta lo stato di ritorno in base a retStatus.
javax.swing.JButton okButton