Example usage for javax.swing WindowConstants DISPOSE_ON_CLOSE

List of usage examples for javax.swing WindowConstants DISPOSE_ON_CLOSE

Introduction

In this page you can find the example usage for javax.swing WindowConstants DISPOSE_ON_CLOSE.

Prototype

int DISPOSE_ON_CLOSE

To view the source code for javax.swing WindowConstants DISPOSE_ON_CLOSE.

Click Source Link

Document

The dispose-window default window close operation.

Usage

From source file:org.nebulaframework.ui.swing.AboutDialog.java

/**
 * No-args Constructor constructs and displays 
 * the about dialog as a modal dialog of the
 * specified owner frame./*  w  ww  .j a va  2s. co  m*/
 * 
 * @param owner Owner frame
 */
public AboutDialog(Frame owner) {
    super(owner, true);

    setTitle("About Nebula Framework " + Grid.VERSION);
    this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    this.setSize(320, 500);
    this.setLayout(new BorderLayout());

    this.setLocationRelativeTo(this); // Center on Main UI

    /* -- Logo Image Section -- */
    JLabel lbl = new JLabel(
            new ImageIcon(ClassLoader.getSystemResource("META-INF/resources/nebula-about.png")));
    this.add(lbl, BorderLayout.CENTER);

    JPanel southPanel = new JPanel();
    southPanel.setLayout(new BoxLayout(southPanel, BoxLayout.Y_AXIS));

    this.add(southPanel, BorderLayout.SOUTH);

    /* -- Information Section -- */
    JPanel information = new JPanel();
    information.setBorder(BorderFactory.createTitledBorder("Information"));
    information.setLayout(new BorderLayout());

    JPanel westPanel = new JPanel();
    westPanel.setLayout(new BoxLayout(westPanel, BoxLayout.Y_AXIS));
    information.add(westPanel, BorderLayout.WEST);

    JPanel centerPanel = new JPanel();
    centerPanel.setLayout(new BoxLayout(centerPanel, BoxLayout.Y_AXIS));
    information.add(centerPanel, BorderLayout.CENTER);

    westPanel.add(new JLabel("Version : "));
    centerPanel.add(new JLabel(Grid.VERSION));

    westPanel.add(new JLabel("Project Site :   "));
    final String site_link = "http://code.google.com/p/nebulaframework";
    JLabel siteLabel = new JLabel(
            "<html><body><a href=\"" + site_link + "\">" + site_link + "</a></body></html>");
    centerPanel.add(siteLabel);
    siteLabel.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseClicked(MouseEvent evt) {
            try {
                Browser.displayURL(site_link);
            } catch (IOException e) {
                log.warn("[UI] Unable to invoke Browser", e);
            }
        }
    });

    westPanel.add(new JLabel("Project Blog :   "));
    final String blog_link = "http://nebulaframework.blogspot.com";
    JLabel blogLabel = new JLabel(
            "<html><body><a href=\"" + blog_link + "\">" + blog_link + "</a></body></html>");
    centerPanel.add(blogLabel);
    blogLabel.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseClicked(MouseEvent evt) {
            try {
                Browser.displayURL(blog_link);
            } catch (IOException e) {
                log.warn("[UI] Unable to invoke Browser", e);
            }
        }

    });

    westPanel.add(new JLabel("License : "));
    centerPanel.add(new JLabel("Apache 2.0 License"));

    southPanel.add(information);

    /* -- Copyright Section -- */

    JPanel developedBy = new JPanel();
    developedBy.setBorder(BorderFactory.createTitledBorder("Developer / Copyright"));
    developedBy.setLayout(new BorderLayout());
    developedBy.add(new JLabel("Copyright (C) 2008 Yohan Liyanage", JLabel.CENTER), BorderLayout.CENTER);
    southPanel.add(developedBy);

    // Resize to fit to size
    this.pack();
    this.setResizable(false);

    // Initialize Browser
    Browser.init();

    // Show 
    this.setVisible(true);
}

From source file:org.nuxeo.launcher.gui.NuxeoFrame.java

/**
 * @since 5.6//  w  ww  . j av  a 2s  .c  o  m
 */
public void close() {
    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    Toolkit.getDefaultToolkit().getSystemEventQueue()
            .postEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING));
}

From source file:org.omegat.gui.scripting.ScriptingWindow.java

private void initWindowLayout() {
    // set default size and position
    frame.setBounds(50, 80, 1150, 650);// www  .  ja va 2 s . c o  m
    StaticUIUtils.persistGeometry(frame, Preferences.SCRIPTWINDOW_GEOMETRY_PREFIX);

    frame.getContentPane().setLayout(new BorderLayout(0, 0));

    m_scriptList = new JList<>();
    JScrollPane scrollPaneList = new JScrollPane(m_scriptList);

    m_scriptList.addListSelectionListener(new ListSelectionListener() {
        @Override
        public void valueChanged(ListSelectionEvent evt) {
            if (!evt.getValueIsAdjusting()) {
                onListSelectionChanged();
            }
        }
    });

    m_scriptList.addMouseMotionListener(new MouseMotionAdapter() {

        @Override
        public void mouseMoved(MouseEvent e) {
            ListModel<ScriptItem> lm = m_scriptList.getModel();
            int index = m_scriptList.locationToIndex(e.getPoint());
            if (index > -1) {
                m_scriptList.setToolTipText(lm.getElementAt(index).getFile().getName());
            }
        }

    });

    m_txtResult = new JEditorPane();
    JScrollPane scrollPaneResults = new JScrollPane(m_txtResult);

    //m_txtScriptEditor = new StandardScriptEditor();
    m_txtScriptEditor = getScriptEditor();

    m_txtScriptEditor.initLayout(this);

    JSplitPane splitPane1 = new JSplitPane(JSplitPane.VERTICAL_SPLIT, m_txtScriptEditor.getPanel(),
            scrollPaneResults);
    splitPane1.setOneTouchExpandable(true);
    splitPane1.setDividerLocation(430);
    Dimension minimumSize1 = new Dimension(100, 50);
    //scrollPaneEditor.setMinimumSize(minimumSize1);
    scrollPaneResults.setMinimumSize(minimumSize1);

    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scrollPaneList, splitPane1);
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(250);

    Dimension minimumSize = new Dimension(100, 50);
    scrollPaneList.setMinimumSize(minimumSize);
    scrollPaneResults.setMinimumSize(minimumSize);

    frame.getContentPane().add(splitPane, BorderLayout.CENTER);

    JPanel panelSouth = new JPanel();
    FlowLayout fl_panelSouth = (FlowLayout) panelSouth.getLayout();
    fl_panelSouth.setAlignment(FlowLayout.LEFT);
    frame.getContentPane().add(panelSouth, BorderLayout.SOUTH);
    setupRunButtons(panelSouth);

    frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

    frame.setJMenuBar(createMenuBar());
}

From source file:org.openconcerto.map.ui.ITextComboVilleViewer.java

public ITextComboVilleViewer() {
    this.setOpaque(false);
    this.setLayout(new BorderLayout());

    this.supp = new ValueChangeSupport<String>(this);
    this.emptyHelper = new EmptyObjectHelper(this, new Predicate() {
        public boolean evaluate(final Object object) {
            // object: le getUncheckedValue()
            return ITextComboVilleViewer.this.getValue() == null
                    || ITextComboVilleViewer.this.getValue().trim().length() == 0;
        }//from  www .ja  va  2 s  . c o  m
    });
    this.text.addValueListener(new PropertyChangeListener() {
        public void propertyChange(final PropertyChangeEvent evt) {
            ITextComboVilleViewer.this.supp.fireValueChange();
        }
    });

    this.cache = new ITextComboCacheVille();
    this.text.initCache(this.cache);
    this.add(this.text, BorderLayout.CENTER);

    this.add(this.button, BorderLayout.EAST);
    this.button.addActionListener(new ActionListener() {

        public void actionPerformed(final ActionEvent e) {
            final JFrame f = new JFrame();
            final MapViewerPanel mapViewerPanel = new MapViewerPanel(true);

            f.setContentPane(mapViewerPanel);
            f.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
            f.setSize(600, 500);
            f.setMinimumSize(new Dimension(600, 500));
            final File conf = new File(System.getProperty("user.home"),
                    ".java" + File.separator + "ilm" + File.separator + "map" + File.separator);
            new WindowStateManager(f, new File(conf, "Configuration" + File.separator + "MapFrame.properties"),
                    true).loadState();
            f.setVisible(true);
            if (ITextComboVilleViewer.this.currentVille != null) {
                final long x = ITextComboVilleViewer.this.currentVille.getXLambert();
                final long y = ITextComboVilleViewer.this.currentVille.getYLambert();
                f.setTitle(ITextComboVilleViewer.this.currentVille.getName());
                mapViewerPanel.getVilleRendererPanel().centerScreenXYLambert(x, y);
                mapViewerPanel.getVilleRendererPanel().setHighlight(ITextComboVilleViewer.this.currentVille);
                mapViewerPanel.getVilleRendererPanel().setAlwayVisible(ITextComboVilleViewer.this.currentVille);
            }
        }
    });
    this.text.getDocument().addDocumentListener(new DocumentListener() {

        public void changedUpdate(final DocumentEvent e) {
            ITextComboVilleViewer.this.currentVille = Ville
                    .getVilleFromVilleEtCode(ITextComboVilleViewer.this.text.getValue());
            ITextComboVilleViewer.this.button.setEnabled(
                    ITextComboVilleViewer.this.currentVille != null && ITextComboVilleViewer.this.isEnabled());

        }

        public void insertUpdate(final DocumentEvent e) {
            this.changedUpdate(e);
        }

        public void removeUpdate(final DocumentEvent e) {
            this.changedUpdate(e);
        }
    });
    final JPopupMenu popupMenu = new JPopupMenu();
    // FIXME ajouter la possibilit de supprimer une ville prcdemment enregistre
    final JMenuItem menuItem = new JMenuItem("Enregistrer cette ville");
    menuItem.addActionListener(new ActionListener() {

        public void actionPerformed(final ActionEvent e) {
            final String t = ITextComboVilleViewer.this.text.getTextComp().getText();
            ITextComboVilleViewer.this.cache.addToCache(t);
            final Ville createVilleFrom = ITextComboVilleViewer.this.cache.createVilleFrom(t);
            if (createVilleFrom != null) {
                final String villeEtCode = createVilleFrom.getVilleEtCode();
                ITextComboVilleViewer.this.setValue(villeEtCode);
                ITextComboVilleViewer.this.firePropertyChange("value", null, villeEtCode);
            }
        }
    });
    popupMenu.add(menuItem);

    this.text.getTextComp().addMouseListener(new PopupMouseListener(popupMenu));

}

From source file:org.panbox.desktop.common.gui.PairNewDeviceDialog.java

/**
 * 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./*ww  w .j a  v  a  2  s . c o m*/
 */
// <editor-fold defaultstate="collapsed"
// desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    pairingPanel = new javax.swing.JPanel();
    pairingQrCodePanel = new javax.swing.JPanel();
    pairingPasswordField = new javax.swing.JTextField();
    pairingModeSelectionComboBox = new javax.swing.JComboBox<>();
    cancelPairingButton = new javax.swing.JButton();
    statusInfoLabel = new javax.swing.JLabel();
    qrCode = new javax.swing.JLabel();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle(bundle.getString("client.deviceList.devicepairing.title"));
    setResizable(false);

    pairingPanel.setMaximumSize(new java.awt.Dimension(390, 330));
    pairingPanel.setMinimumSize(new java.awt.Dimension(390, 330));

    pairingQrCodePanel.setLayout(new java.awt.GridLayout(1, 1));
    pairingQrCodePanel.add(qrCode);

    pairingPasswordField.setText("");
    pairingPasswordField.setEditable(false);

    pairingModeSelectionComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(
            new String[] { bundle.getString("client.deviceList.devicepairing.slave"),
                    bundle.getString("client.deviceList.devicepairing.master") }));
    pairingModeSelectionComboBox.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            pairingModeSelectionComboBoxActionPerformed(evt);
        }
    });

    statusInfoLabel.setText("");

    javax.swing.GroupLayout pairingPanelLayout = new javax.swing.GroupLayout(pairingPanel);
    pairingPanel.setLayout(pairingPanelLayout);
    pairingPanelLayout.setHorizontalGroup(pairingPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pairingPanelLayout.createSequentialGroup().addContainerGap()
                    .addGroup(pairingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(pairingModeSelectionComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(pairingQrCodePanel, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(pairingPasswordField, javax.swing.GroupLayout.DEFAULT_SIZE, 354,
                                    Short.MAX_VALUE))
                    .addContainerGap()));
    pairingPanelLayout.setVerticalGroup(pairingPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pairingPanelLayout.createSequentialGroup().addContainerGap()
                    .addComponent(pairingQrCodePanel, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(pairingPasswordField, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(pairingModeSelectionComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(331, Short.MAX_VALUE)));

    cancelPairingButton.setText(bundle.getString("client.cancel"));
    cancelPairingButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            cancelPairingButtonActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(pairingPanel, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(layout.createSequentialGroup()
                                    .addComponent(statusInfoLabel, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(cancelPairingButton)))
                    .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap()
                    .addComponent(pairingPanel, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cancelPairingButton).addComponent(statusInfoLabel))
                    .addContainerGap()));

    pack();
}

From source file:org.piraso.ui.api.StackTraceFilterDialog.java

/**
 * 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./*from ww  w.  j a  v a 2s .  co  m*/
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jLabel1 = new javax.swing.JLabel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jtable = new javax.swing.JTable();
    jPanel2 = new javax.swing.JPanel();
    btnAdd = new javax.swing.JButton();
    btnRemove = new javax.swing.JButton();
    btnEdit = new javax.swing.JButton();
    btnSave = new javax.swing.JButton();
    btnCancel = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

    jLabel1.setText(org.openide.util.NbBundle.getMessage(StackTraceFilterDialog.class,
            "StackTraceFilterDialog.jLabel1.text_1")); // NOI18N

    jtable.setModel(tableModel);
    jScrollPane1.setViewportView(jtable);

    btnAdd.setText(org.openide.util.NbBundle.getMessage(StackTraceFilterDialog.class,
            "StackTraceFilterDialog.btnAdd.text_1")); // NOI18N
    btnAdd.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnAddActionPerformed(evt);
        }
    });

    btnRemove.setText(org.openide.util.NbBundle.getMessage(StackTraceFilterDialog.class,
            "StackTraceFilterDialog.btnRemove.text_1")); // NOI18N
    btnRemove.setEnabled(false);
    btnRemove.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnRemoveActionPerformed(evt);
        }
    });

    btnEdit.setText(org.openide.util.NbBundle.getMessage(StackTraceFilterDialog.class,
            "StackTraceFilterDialog.btnEdit.text_1")); // NOI18N
    btnEdit.setEnabled(false);
    btnEdit.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnEditActionPerformed(evt);
        }
    });

    org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(btnAdd, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 106,
                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
            .add(btnRemove, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 106,
                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
            .add(btnEdit, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 106,
                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE));
    jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup().add(btnAdd).add(1, 1, 1).add(btnRemove)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED,
                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(btnEdit).addContainerGap()));

    btnSave.setText(org.openide.util.NbBundle.getMessage(StackTraceFilterDialog.class,
            "StackTraceFilterDialog.btnSave.text_1")); // NOI18N
    btnSave.setEnabled(false);
    btnSave.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnSaveActionPerformed(evt);
        }
    });

    btnCancel.setText(org.openide.util.NbBundle.getMessage(StackTraceFilterDialog.class,
            "StackTraceFilterDialog.btnCancel.text_1")); // NOI18N
    btnCancel.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnCancelActionPerformed(evt);
        }
    });

    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(layout
            .createSequentialGroup()
            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(layout
                    .createSequentialGroup().add(14, 14, 14)
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(layout.createSequentialGroup().add(jLabel1).add(0, 0, Short.MAX_VALUE))
                            .add(org.jdesktop.layout.GroupLayout.TRAILING,
                                    layout.createSequentialGroup()
                                            .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                    0, Short.MAX_VALUE)
                                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                            .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING,
                            layout.createSequentialGroup().addContainerGap(291, Short.MAX_VALUE).add(btnSave)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(btnCancel)))
            .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(layout
            .createSequentialGroup().addContainerGap().add(jLabel1)
            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 206, Short.MAX_VALUE))
            .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED).add(layout
                    .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(btnCancel).add(btnSave))
            .add(12, 12, 12)));

    pack();
}

From source file:org.piraso.ui.api.WorkingSetDialog.java

/**
 * 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.//ww  w. ja  v a2s .  c o  m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jLabel1 = new javax.swing.JLabel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jtable = new javax.swing.JTable();
    jPanel2 = new javax.swing.JPanel();
    btnAdd = new javax.swing.JButton();
    btnRemove = new javax.swing.JButton();
    btnEdit = new javax.swing.JButton();
    btnSave = new javax.swing.JButton();
    btnCancel = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

    jLabel1.setText(
            org.openide.util.NbBundle.getMessage(WorkingSetDialog.class, "WorkingSetDialog.jLabel1.text_1")); // NOI18N

    jtable.setModel(tableModel);
    jScrollPane1.setViewportView(jtable);

    btnAdd.setText(
            org.openide.util.NbBundle.getMessage(WorkingSetDialog.class, "WorkingSetDialog.btnAdd.text_1")); // NOI18N
    btnAdd.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnAddActionPerformed(evt);
        }
    });

    btnRemove.setText(
            org.openide.util.NbBundle.getMessage(WorkingSetDialog.class, "WorkingSetDialog.btnRemove.text_1")); // NOI18N
    btnRemove.setEnabled(false);
    btnRemove.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnRemoveActionPerformed(evt);
        }
    });

    btnEdit.setText(
            org.openide.util.NbBundle.getMessage(WorkingSetDialog.class, "WorkingSetDialog.btnEdit.text_1")); // NOI18N
    btnEdit.setEnabled(false);
    btnEdit.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnEditActionPerformed(evt);
        }
    });

    org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(btnAdd, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 106,
                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
            .add(btnRemove, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 106,
                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
            .add(btnEdit, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 106,
                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE));
    jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup().add(btnAdd).add(1, 1, 1).add(btnRemove)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED,
                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(btnEdit).addContainerGap()));

    btnSave.setText(
            org.openide.util.NbBundle.getMessage(WorkingSetDialog.class, "WorkingSetDialog.btnSave.text_1")); // NOI18N
    btnSave.setEnabled(false);
    btnSave.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnSaveActionPerformed(evt);
        }
    });

    btnCancel.setText(
            org.openide.util.NbBundle.getMessage(WorkingSetDialog.class, "WorkingSetDialog.btnCancel.text_1")); // NOI18N
    btnCancel.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnCancelActionPerformed(evt);
        }
    });

    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(layout
            .createSequentialGroup()
            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(layout
                    .createSequentialGroup().add(14, 14, 14)
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(layout.createSequentialGroup().add(jLabel1).add(0, 0, Short.MAX_VALUE))
                            .add(org.jdesktop.layout.GroupLayout.TRAILING,
                                    layout.createSequentialGroup()
                                            .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                    0, Short.MAX_VALUE)
                                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                            .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING,
                            layout.createSequentialGroup().addContainerGap(291, Short.MAX_VALUE).add(btnSave)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(btnCancel)))
            .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(layout
            .createSequentialGroup().addContainerGap().add(jLabel1)
            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 206, Short.MAX_VALUE))
            .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED).add(layout
                    .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(btnCancel).add(btnSave))
            .add(12, 12, 12)));

    pack();
}

From source file:org.piraso.ui.base.ContextMonitorDialog.java

/**
 * 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./*from w  w  w. ja v a2 s.c om*/
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    buttonGroup1 = new javax.swing.ButtonGroup();
    btnClose = new javax.swing.JButton();
    jSplitPane1 = new javax.swing.JSplitPane();
    jPanel2 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    jScrollPane1 = new javax.swing.JScrollPane();
    lstMonitors = new javax.swing.JList();
    chkWorkingSet = new javax.swing.JCheckBox();
    jPanel3 = new javax.swing.JPanel();
    txtName = new javax.swing.JTextField();
    jPanel1 = new javax.swing.JPanel();
    btnSave = new javax.swing.JButton();
    btnRemove = new javax.swing.JButton();
    btnClear = new javax.swing.JButton();
    jtab = new javax.swing.JTabbedPane();
    jLabel4 = new javax.swing.JLabel();
    txtAddr = new javax.swing.JTextField();
    rdoOthers = new javax.swing.JRadioButton();
    jLabel3 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    rdoMyAddress = new javax.swing.JRadioButton();
    cboHost = new javax.swing.JComboBox();
    deleteAll = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

    btnClose.setText(org.openide.util.NbBundle.getMessage(ContextMonitorDialog.class,
            "ContextMonitorDialog.btnClose.text")); // NOI18N
    btnClose.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnCloseActionPerformed(evt);
        }
    });

    jSplitPane1.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
    jSplitPane1.setDividerLocation(300);
    jSplitPane1.setDividerSize(5);

    jLabel1.setText(org.openide.util.NbBundle.getMessage(ContextMonitorDialog.class,
            "ContextMonitorDialog.jLabel1.text")); // NOI18N

    lstMonitors.setModel(new javax.swing.AbstractListModel() {
        String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };

        public int getSize() {
            return strings.length;
        }

        public Object getElementAt(int i) {
            return strings[i];
        }
    });
    jScrollPane1.setViewportView(lstMonitors);

    chkWorkingSet.setSelected(true);
    chkWorkingSet.setText(org.openide.util.NbBundle.getMessage(ContextMonitorDialog.class,
            "ContextMonitorDialog.chkWorkingSet.text")); // NOI18N
    chkWorkingSet.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            chkWorkingSetActionPerformed(evt);
        }
    });

    org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup().addContainerGap()
                    .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jPanel2Layout.createSequentialGroup().add(6, 6, 6).add(jScrollPane1,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE))
                            .add(jLabel1).add(chkWorkingSet))
                    .add(7, 7, 7)));
    jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup().addContainerGap().add(jLabel1)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 520, Short.MAX_VALUE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(chkWorkingSet)
                    .addContainerGap()));

    jSplitPane1.setLeftComponent(jPanel2);

    txtName.setText(org.openide.util.NbBundle.getMessage(ContextMonitorDialog.class,
            "ContextMonitorDialog.txtName.text")); // NOI18N

    btnSave.setText(org.openide.util.NbBundle.getMessage(ContextMonitorDialog.class,
            "ContextMonitorDialog.btnSave.text")); // NOI18N
    btnSave.setEnabled(false);
    btnSave.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnSaveActionPerformed(evt);
        }
    });

    btnRemove.setText(org.openide.util.NbBundle.getMessage(ContextMonitorDialog.class,
            "ContextMonitorDialog.btnRemove.text")); // NOI18N
    btnRemove.setEnabled(false);
    btnRemove.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnRemoveActionPerformed(evt);
        }
    });

    btnClear.setText(org.openide.util.NbBundle.getMessage(ContextMonitorDialog.class,
            "ContextMonitorDialog.btnClear.text")); // NOI18N
    btnClear.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnClearActionPerformed(evt);
        }
    });

    org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(btnSave, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 106,
                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
            .add(btnRemove, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 106,
                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
            .add(btnClear, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 106,
                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup().add(btnSave).add(1, 1, 1).add(btnRemove)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED,
                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(btnClear).addContainerGap()));

    jLabel4.setText(org.openide.util.NbBundle.getMessage(ContextMonitorDialog.class,
            "ContextMonitorDialog.jLabel4.text")); // NOI18N

    txtAddr.setText(org.openide.util.NbBundle.getMessage(ContextMonitorDialog.class,
            "ContextMonitorDialog.txtAddr.text")); // NOI18N
    txtAddr.setEnabled(false);

    buttonGroup1.add(rdoOthers);
    rdoOthers.setText(org.openide.util.NbBundle.getMessage(ContextMonitorDialog.class,
            "ContextMonitorDialog.rdoOthers.text")); // NOI18N
    rdoOthers.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            rdoOthersActionPerformed(evt);
        }
    });

    jLabel3.setText(org.openide.util.NbBundle.getMessage(ContextMonitorDialog.class,
            "ContextMonitorDialog.jLabel3.text")); // NOI18N

    jLabel2.setText(org.openide.util.NbBundle.getMessage(ContextMonitorDialog.class,
            "ContextMonitorDialog.jLabel2.text")); // NOI18N

    buttonGroup1.add(rdoMyAddress);
    rdoMyAddress.setSelected(true);
    rdoMyAddress.setText(org.openide.util.NbBundle.getMessage(ContextMonitorDialog.class,
            "ContextMonitorDialog.rdoMyAddress.text")); // NOI18N
    rdoMyAddress.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            rdoMyAddressActionPerformed(evt);
        }
    });

    cboHost.setEditable(true);
    cboHost.setModel(
            new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

    org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel3Layout.createSequentialGroup().add(jPanel3Layout
                    .createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(jPanel3Layout.createSequentialGroup().add(jLabel3)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED).add(rdoMyAddress)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(rdoOthers)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                            .add(txtAddr, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 223, Short.MAX_VALUE))
                    .add(jPanel3Layout.createSequentialGroup()
                            .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jLabel4).add(jLabel2))
                            .add(18, 18, 18)
                            .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(cboHost, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                            Short.MAX_VALUE)
                                    .add(txtName))))
                    .add(10, 10, 10)
                    .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(9, 9, 9))
            .add(jtab));
    jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel3Layout.createSequentialGroup().add(23, 23, 23).add(jPanel3Layout
                    .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel3Layout.createSequentialGroup()
                            .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(jLabel4).add(txtName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                            .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(jLabel2).add(cboHost, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                            .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(rdoMyAddress).add(rdoOthers)
                                    .add(txtAddr, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(jLabel3)))
                    .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(jtab, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 448, Short.MAX_VALUE)
                    .addContainerGap()));

    jSplitPane1.setRightComponent(jPanel3);

    deleteAll.setText(org.openide.util.NbBundle.getMessage(ContextMonitorDialog.class,
            "ContextMonitorDialog.deleteAll.text")); // NOI18N
    deleteAll.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            deleteAllActionPerformed(evt);
        }
    });

    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup().addContainerGap()
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(jSplitPane1)
                            .add(layout.createSequentialGroup().add(6, 6, 6).add(deleteAll)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED,
                                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .add(btnClose)))
                    .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(layout
            .createSequentialGroup().addContainerGap().add(jSplitPane1)
            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(layout
                    .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(btnClose).add(deleteAll))
            .add(8, 8, 8)));

    pack();
}

From source file:org.piraso.ui.base.ExportDialog.java

/**
 * 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./*from  w  w w .  j av a  2  s.c  o m*/
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jLabel1 = new javax.swing.JLabel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jtable = new javax.swing.JTable();
    jLabel2 = new javax.swing.JLabel();
    txtTargetFile = new javax.swing.JTextField();
    btnBrowse = new javax.swing.JButton();
    btnExport = new javax.swing.JButton();
    btnCancel = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

    jLabel1.setText(org.openide.util.NbBundle.getMessage(ExportDialog.class, "ExportDialog.jLabel1.text")); // NOI18N

    jtable.setModel(tableModel);
    jScrollPane1.setViewportView(jtable);

    jLabel2.setText(org.openide.util.NbBundle.getMessage(ExportDialog.class, "ExportDialog.jLabel2.text")); // NOI18N

    txtTargetFile.setEditable(false);
    txtTargetFile.setText(
            org.openide.util.NbBundle.getMessage(ExportDialog.class, "ExportDialog.txtTargetFile.text")); // NOI18N

    btnBrowse.setText(org.openide.util.NbBundle.getMessage(ExportDialog.class, "ExportDialog.btnBrowse.text")); // NOI18N
    btnBrowse.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnBrowseActionPerformed(evt);
        }
    });

    btnExport.setText(org.openide.util.NbBundle.getMessage(ExportDialog.class, "ExportDialog.btnExport.text")); // NOI18N
    btnExport.setEnabled(false);
    btnExport.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnExportActionPerformed(evt);
        }
    });

    btnCancel.setText(org.openide.util.NbBundle.getMessage(ExportDialog.class, "ExportDialog.btnCancel.text")); // NOI18N
    btnCancel.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnCancelActionPerformed(evt);
        }
    });

    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(layout
            .createSequentialGroup().add(12, 12, 12)
            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(layout.createSequentialGroup().add(jLabel1).addContainerGap())
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup().add(layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(layout.createSequentialGroup().add(jLabel2)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(txtTargetFile)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(btnBrowse))
                            .add(jScrollPane1)).add(12, 12, 12))))
            .add(org.jdesktop.layout.GroupLayout.TRAILING,
                    layout.createSequentialGroup().addContainerGap(392, Short.MAX_VALUE).add(btnExport)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(btnCancel)
                            .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup().add(7, 7, 7)
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel2)
                            .add(txtTargetFile, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(btnBrowse))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jLabel1)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 298, Short.MAX_VALUE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(btnCancel)
                            .add(btnExport))
                    .addContainerGap()));

    pack();
}

From source file:org.piraso.ui.base.ImportDialog.java

/**
 * 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.//from  ww  w.  j  a v a 2s . c o  m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jLabel1 = new javax.swing.JLabel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jtable = new javax.swing.JTable();
    jLabel2 = new javax.swing.JLabel();
    txtSourceFile = new javax.swing.JTextField();
    btnBrowse = new javax.swing.JButton();
    btnImport = new javax.swing.JButton();
    btnCancel = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

    jLabel1.setText(org.openide.util.NbBundle.getMessage(ImportDialog.class, "ImportDialog.jLabel1.text")); // NOI18N

    jtable.setModel(tableModel);
    jScrollPane1.setViewportView(jtable);

    jLabel2.setText(org.openide.util.NbBundle.getMessage(ImportDialog.class, "ImportDialog.jLabel2.text")); // NOI18N

    txtSourceFile.setEditable(false);
    txtSourceFile.setText(
            org.openide.util.NbBundle.getMessage(ImportDialog.class, "ImportDialog.txtSourceFile.text")); // NOI18N

    btnBrowse.setText(org.openide.util.NbBundle.getMessage(ImportDialog.class, "ImportDialog.btnBrowse.text")); // NOI18N
    btnBrowse.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnBrowseActionPerformed(evt);
        }
    });

    btnImport.setText(org.openide.util.NbBundle.getMessage(ImportDialog.class, "ImportDialog.btnImport.text")); // NOI18N
    btnImport.setEnabled(false);
    btnImport.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnImportActionPerformed(evt);
        }
    });

    btnCancel.setText(org.openide.util.NbBundle.getMessage(ImportDialog.class, "ImportDialog.btnCancel.text")); // NOI18N
    btnCancel.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnCancelActionPerformed(evt);
        }
    });

    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(layout
            .createSequentialGroup().add(12, 12, 12)
            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(layout.createSequentialGroup().add(jLabel1).addContainerGap())
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup().add(layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(layout.createSequentialGroup().add(jLabel2)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(txtSourceFile)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(btnBrowse))
                            .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0,
                                    Short.MAX_VALUE))
                            .add(12, 12, 12))))
            .add(org.jdesktop.layout.GroupLayout.TRAILING,
                    layout.createSequentialGroup().addContainerGap(369, Short.MAX_VALUE).add(btnImport)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(btnCancel)
                            .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup().add(7, 7, 7)
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel2)
                            .add(txtSourceFile, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(btnBrowse))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jLabel1)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 277, Short.MAX_VALUE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(btnCancel)
                            .add(btnImport))
                    .addContainerGap()));

    pack();
}