Autopsy  3.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
AdvancedConfigurationCleanDialog.java
Go to the documentation of this file.
1 /*
2  * To change this template, choose Tools | Templates
3  * and open the template in the editor.
4  */
5 package org.sleuthkit.autopsy.corecomponents;
6 
7 import java.awt.Component;
8 import java.awt.Dimension;
9 import java.awt.Toolkit;
10 import javax.swing.JFrame;
11 import javax.swing.JPanel;
12 
18  public class AdvancedConfigurationCleanDialog extends javax.swing.JDialog {
19 
22  this(false);
23  }
24 
26  public AdvancedConfigurationCleanDialog(boolean resizable) {
27  super(new JFrame(), true);
28  setResizable(resizable);
29  if(resizable) {
30  this.setIconImage(null);
31  }
33  }
34 
39  public void display(JPanel panel) {
40  this.setTitle(panel.getName());
41 
42  panel.setAlignmentX(Component.CENTER_ALIGNMENT);
43  this.add(panel, 0);
44  this.pack();
45 
46  Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
47  // set the popUp window / JFrame
48  int w = this.getSize().width;
49  int h = this.getSize().height;
50 
51  // set the location of the popUp Window on the center of the screen
52  setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
53 
54  this.setVisible(true);
55  }
56 
60  public void close() {
61  this.dispose();
62  }
63 
69  @SuppressWarnings("unchecked")
70  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
71  private void initComponents() {
72 
73  setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
74  getContentPane().setLayout(new javax.swing.BoxLayout(getContentPane(), javax.swing.BoxLayout.LINE_AXIS));
75 
76  pack();
77  }// </editor-fold>//GEN-END:initComponents
78 
79  // Variables declaration - do not modify//GEN-BEGIN:variables
80  // End of variables declaration//GEN-END:variables
81 }

Copyright © 2012-2015 Basis Technology. Generated on: Mon Oct 19 2015
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.