<?xml version="1.0" encoding="UTF-8" ?>
-<Form version="1.4" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
+<Form version="1.4" maxVersion="1.4" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="0"/>
<Property name="title" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jButtonQuit" linkSize="1" min="-2" max="-2" attributes="0"/>
- <EmptySpace pref="133" max="32767" attributes="0"/>
+ <EmptySpace pref="148" max="32767" attributes="0"/>
<Component id="jButtonOK" linkSize="1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jButtonCancel" linkSize="1" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel1" linkSize="2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
- <Component id="jTextFieldReceiverPort" pref="51" max="32767" attributes="0"/>
+ <Component id="jTextFieldReceiverPort" pref="73" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jCheckBoxEnableRemoteConnect" min="-2" pref="207" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
- <Component id="jTextFieldConfirmTimeout" pref="237" max="32767" attributes="0"/>
+ <Component id="jTextFieldConfirmTimeout" pref="265" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel2" linkSize="2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
- <Component id="jTextFieldServerHost" pref="143" max="32767" attributes="0"/>
+ <Component id="jTextFieldServerHost" pref="155" max="32767" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
- <Component id="jTextFieldServerPort" pref="69" max="32767" attributes="0"/>
+ <Component id="jTextFieldServerPort" pref="82" max="32767" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jTextFieldServerPort" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
- <EmptySpace pref="27" max="32767" attributes="0"/>
+ <EmptySpace pref="31" max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jTextFieldConfirmTimeout" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
- <Component id="jTextFieldAttribute" alignment="0" pref="288" max="32767" attributes="0"/>
- <Component id="jTextFieldBaseDn" pref="288" max="32767" attributes="0"/>
+ <Component id="jTextFieldAttribute" alignment="0" pref="296" max="32767" attributes="0"/>
+ <Component id="jTextFieldBaseDn" pref="296" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
- <Component id="jTextFieldProviderUrl" pref="205" max="32767" attributes="0"/>
+ <Component id="jTextFieldProviderUrl" pref="222" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jCheckBoxIsSjis" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jTextFieldAttribute" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
- <EmptySpace max="32767" attributes="0"/>
+ <EmptySpace pref="17" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabelSfURL" min="-2" max="-2" attributes="0"/>
- <EmptySpace pref="57" max="32767" attributes="0"/>
+ <EmptySpace pref="58" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabelProgramName">
<Properties>
- <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor">
- <FontInfo relative="false">
- <Font name="Dialog" size="18" style="1"/>
- </FontInfo>
+ <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Dialog" size="18" style="1"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jent/checksmtp/Bundle.properties" key="ApplicationUI.jLabelProgramName.text" replaceFormat="java.util.ResourceBundle.getBundle("{bundleNameSlashes}").getString("{key}")"/>
</Component>
<Component class="javax.swing.JLabel" name="jLabelProgramVersion">
<Properties>
- <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor">
- <FontInfo relative="false">
- <Font name="Dialog" size="18" style="1"/>
- </FontInfo>
+ <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Dialog" size="18" style="1"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jent/checksmtp/Bundle.properties" key="ApplicationUI.jLabelProgramVersion.text" replaceFormat="java.util.ResourceBundle.getBundle("{bundleNameSlashes}").getString("{key}")"/>
</Component>
<Component class="javax.swing.JLabel" name="jLabelSfURL">
<Properties>
- <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor">
- <FontInfo relative="false">
- <Font name="Dialog" size="14" style="1"/>
- </FontInfo>
+ <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Dialog" size="14" style="1"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jent/checksmtp/Bundle.properties" key="ApplicationUI.jLabelSfURL.text" replaceFormat="java.util.ResourceBundle.getBundle("{bundleNameSlashes}").getString("{key}")"/>
package org.jent.checksmtp;
+import java.awt.AWTException;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Image;
+import java.awt.MenuItem;
import java.awt.Point;
+import java.awt.PopupMenu;
+import java.awt.SystemTray;
import java.awt.Toolkit;
+import java.awt.TrayIcon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ImageIcon;
private boolean initSystemTray() {
- boolean useSystemTray = false;
+ useSystemTray = false;
try {
Class.forName("java.awt.SystemTray"); // NOI18N
- /* TODO: SystemTray suuport
- SystemTray tray = SystemTray.getSystemTray();
- if(tray.isSupported()){
+ /* SystemTray suuport */
+ final SystemTray tray = SystemTray.getSystemTray();
+ if(SystemTray.isSupported()){
final PopupMenu popup = new PopupMenu();
- TrayIcon trayIcon = new TrayIcon(loadIconImage(),
- "mdc", popup);
+ final TrayIcon trayIcon = new TrayIcon(loadImageIcon(),
+ java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("ApplicationUI.shortTitle"),
+ popup);
trayIcon.setImageAutoSize(true);
- MenuItem menuItemOpen = new MenuItem("Properties...");
+ MenuItem menuItemOpen = new MenuItem(java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("ApplicationUI.title"));
menuItemOpen.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- setVisible(true);
- if ( this.getExtendedState() == ICONIFIED ) {
- this.setExtendedState(NORMAL);
- }
+ deicoified();
}
});
- MenuItem menuItemQuit = new MenuItem("Quit");
+ MenuItem menuItemQuit = new MenuItem(java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("ApplicationUI.jButtonQuit.text"));
menuItemQuit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- tray.remove(icon);
+ tray.remove(trayIcon);
dispose();
System.exit(0);
}
popup.add(menuItemOpen);
popup.add(menuItemQuit);
tray.add(trayIcon);
+
+ this.jButtonQuit.setVisible(false); //unvisible QUIT button.
useSystemTray = true;
}
- */
+ /**/
+ } catch (AWTException ex) {
+ System.err.println("SystemTray initialize error.");
+ ex.printStackTrace();
} catch (ClassNotFoundException ex) {
// Do not support SystemTray on this VM.
}
}
}
+ private void deicoified() {
+ if ( useSystemTray ) {
+ this.setVisible(true);
+ } else {
+ this.setExtendedState(NORMAL);
+ }
+ }
+
private Image loadImageIcon() {
ImageIcon imageIcon = new ImageIcon( getClass()
.getResource("images/mdc-icon16x16.png") // NOI18N
}
}
});
-
smtpClient = new SMTPclient();
}
private static SMTPclient smtpClient = null;