/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * NotificationPopup.java * * Created on Nov 23, 2011, 11:03:26 PM */ package org.matveev.pomodoro4nb; /** * * @author Alexey Matveev <mvaleksej@gmail.com> */ public class NotificationPopup extends javax.swing.JDialog { /** Creates new form NotificationPopup */ public NotificationPopup(java.awt.Frame parent, boolean modal) { super(parent, modal); 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() { java.awt.GridBagConstraints gridBagConstraints; iconLabel = new javax.swing.JLabel(); captionLabel = new javax.swing.JLabel(); bodyLabel = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle(org.openide.util.NbBundle.getMessage(NotificationPopup.class, "NotificationPopup.title")); // NOI18N setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); setLocationByPlatform(true); setModal(true); getContentPane().setLayout(new java.awt.GridBagLayout()); iconLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/matveev/pomodoro4nb/resources/images/pomodoro_notify.png"))); // NOI18N iconLabel.setText(org.openide.util.NbBundle.getMessage(NotificationPopup.class, "NotificationPopup.iconLabel.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); getContentPane().add(iconLabel, gridBagConstraints); captionLabel.setText(org.openide.util.NbBundle.getMessage(NotificationPopup.class, "NotificationPopup.captionLabel.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); getContentPane().add(captionLabel, gridBagConstraints); bodyLabel.setText(org.openide.util.NbBundle.getMessage(NotificationPopup.class, "NotificationPopup.bodyLabel.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 5); getContentPane().add(bodyLabel, gridBagConstraints); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(NotificationPopup.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(NotificationPopup.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(NotificationPopup.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(NotificationPopup.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the dialog */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { NotificationPopup dialog = new NotificationPopup(new javax.swing.JFrame(), true); dialog.addWindowListener(new java.awt.event.WindowAdapter() { @Override public void windowClosing(java.awt.event.WindowEvent e) { System.exit(0); } }); dialog.setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel bodyLabel; private javax.swing.JLabel captionLabel; private javax.swing.JLabel iconLabel; // End of variables declaration//GEN-END:variables }