/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package eu.ggnet.saft.sample.support; import eu.ggnet.saft.core.Ui; /** * * @author oliver.guenther */ public class PanelWithSelfCloser extends javax.swing.JPanel { Object closer; /** * Creates new form PanelWithSelfCloser */ public PanelWithSelfCloser() { initComponents(); } /** * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The * content of this method is always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); buttonPanel = new javax.swing.JPanel(); closeButton = new javax.swing.JButton(); setLayout(new java.awt.BorderLayout()); jLabel1.setFont(new java.awt.Font("DejaVu Sans", 0, 24)); // NOI18N jLabel1.setText("I'm a Panel with a Button to close me"); add(jLabel1, java.awt.BorderLayout.CENTER); buttonPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT)); closeButton.setText("Close"); closeButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { closeButtonActionPerformed(evt); } }); buttonPanel.add(closeButton); add(buttonPanel, java.awt.BorderLayout.PAGE_END); }// </editor-fold>//GEN-END:initComponents private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeButtonActionPerformed Ui.closeWindowOf(this); }//GEN-LAST:event_closeButtonActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JPanel buttonPanel; private javax.swing.JButton closeButton; private javax.swing.JLabel jLabel1; // End of variables declaration//GEN-END:variables }