Autopsy  4.0
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 
24  this(false);
25  }
26 
30  public AdvancedConfigurationCleanDialog(boolean resizable) {
31  super(new JFrame(), true);
32  setResizable(resizable);
33  if (resizable) {
34  this.setIconImage(null);
35  }
37  }
38 
44  public void display(JPanel panel) {
45  this.setTitle(panel.getName());
46 
47  panel.setAlignmentX(Component.CENTER_ALIGNMENT);
48  this.add(panel, 0);
49  this.pack();
50 
51  Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
52  // set the popUp window / JFrame
53  int w = this.getSize().width;
54  int h = this.getSize().height;
55 
56  // set the location of the popUp Window on the center of the screen
57  setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
58 
59  this.setVisible(true);
60  }
61 
65  public void close() {
66  this.dispose();
67  }
68 
74  @SuppressWarnings("unchecked")
75  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
76  private void initComponents() {
77 
78  setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
79  getContentPane().setLayout(new javax.swing.BoxLayout(getContentPane(), javax.swing.BoxLayout.LINE_AXIS));
80 
81  pack();
82  }// </editor-fold>//GEN-END:initComponents
83 
84  // Variables declaration - do not modify//GEN-BEGIN:variables
85  // End of variables declaration//GEN-END:variables
86 }

Copyright © 2012-2015 Basis Technology. Generated on: Wed Apr 6 2016
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.