Index: .hgignore
===================================================================
--- .hgignore	(revision 2:dc31dce8773f)
+++ .hgignore	(revision 13:b15d81be8af3)
@@ -6,2 +6,4 @@
 java/SuperPostak/build/*
 java/SuperPostak/nbproject/private/*
+
+grafika/logo.png
Index: java/Postak/nbproject/build-impl.xml
===================================================================
--- java/Postak/nbproject/build-impl.xml	(revision 8:218a80f12411)
+++ java/Postak/nbproject/build-impl.xml	(revision 13:b15d81be8af3)
@@ -56,5 +56,12 @@
     <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
         <available file="${manifest.file}" property="manifest.available"/>
-        <available file="${application.splash}" property="splashscreen.available"/>
+        <condition property="splashscreen.available">
+            <and>
+                <not>
+                    <equals arg1="${application.splash}" arg2="" trim="true"/>
+                </not>
+                <available file="${application.splash}"/>
+            </and>
+        </condition>
         <condition property="main.class.available">
             <and>
@@ -71,6 +78,12 @@
             </and>
         </condition>
+        <condition property="do.archive">
+            <not>
+                <istrue value="${jar.archive.disabled}"/>
+            </not>
+        </condition>
         <condition property="do.mkdist">
             <and>
+                <isset property="do.archive"/>
                 <isset property="libs.CopyLibs.classpath"/>
                 <not>
@@ -85,15 +98,4 @@
             </and>
         </condition>
-        <condition property="manifest.available+main.class+mkdist.available+splashscreen.available">
-            <and>
-                <istrue value="${manifest.available+main.class+mkdist.available}"/>
-                <istrue value="${splashscreen.available}"/>
-            </and>
-        </condition>
-        <condition property="do.archive">
-            <not>
-                <istrue value="${jar.archive.disabled}"/>
-            </not>
-        </condition>
         <condition property="do.archive+manifest.available">
             <and>
@@ -102,4 +104,16 @@
             </and>
         </condition>
+        <condition property="do.archive+main.class.available">
+            <and>
+                <isset property="main.class.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+splashscreen.available">
+            <and>
+                <isset property="splashscreen.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
         <condition property="do.archive+manifest.available+main.class">
             <and>
@@ -108,15 +122,15 @@
             </and>
         </condition>
-        <condition property="do.archive+manifest.available+main.class+mkdist.available">
-            <and>
-                <istrue value="${manifest.available+main.class+mkdist.available}"/>
-                <istrue value="${do.archive}"/>
-            </and>
-        </condition>
-        <condition property="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available">
-            <and>
-                <istrue value="${manifest.available+main.class+mkdist.available+splashscreen.available}"/>
-                <istrue value="${do.archive}"/>
-            </and>
+        <condition property="manifest.available-mkdist.available">
+            <or>
+                <istrue value="${manifest.available}"/>
+                <isset property="do.mkdist"/>
+            </or>
+        </condition>
+        <condition property="manifest.available+main.class-mkdist.available">
+            <or>
+                <istrue value="${manifest.available+main.class}"/>
+                <isset property="do.mkdist"/>
+            </or>
         </condition>
         <condition property="have.tests">
@@ -174,6 +188,15 @@
             <length length="0" string="${endorsed.classpath}" when="greater"/>
         </condition>
-        <property name="javac.fork" value="false"/>
+        <condition else="false" property="jdkBug6558476">
+            <and>
+                <matches pattern="1\.[56]" string="${java.specification.version}"/>
+                <not>
+                    <os family="unix"/>
+                </not>
+            </and>
+        </condition>
+        <property name="javac.fork" value="${jdkBug6558476}"/>
         <property name="jar.index" value="false"/>
+        <property name="jar.index.metainf" value="${jar.index}"/>
         <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
     </target>
@@ -303,5 +326,7 @@
                     <files includesfile="${javac.includesfile.binary}"/>
                 </delete>
-                <delete file="${javac.includesfile.binary}"/>
+                <delete>
+                    <fileset file="${javac.includesfile.binary}"/>
+                </delete>
             </sequential>
         </macrodef>
@@ -313,5 +338,6 @@
             <attribute default="**" name="testincludes"/>
             <sequential>
-                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}">
+                <property name="junit.forkmode" value="perTest"/>
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
                     <batchtest todir="${build.test.results.dir}">
                         <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
@@ -329,8 +355,53 @@
                     <formatter type="xml"/>
                     <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg value="-ea"/>
                     <jvmarg line="${run.jvmargs}"/>
                 </junit>
             </sequential>
         </macrodef>
+    </target>
+    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
+    <target name="-profile-pre-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-profile-post-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-profile-init-macrodef-profile">
+        <macrodef name="resolve">
+            <attribute name="name"/>
+            <attribute name="value"/>
+            <sequential>
+                <property name="@{name}" value="${env.@{value}}"/>
+            </sequential>
+        </macrodef>
+        <macrodef name="profile">
+            <attribute default="${main.class}" name="classname"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property environment="env"/>
+                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
+                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
+                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
+                    <jvmarg line="${profiler.info.jvmargs}"/>
+                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+                    <arg line="${application.args}"/>
+                    <classpath>
+                        <path path="${run.classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
+        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
+        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
     </target>
     <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
@@ -428,4 +499,5 @@
     <target name="-init-macrodef-copylibs">
         <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${manifest.file}" name="manifest"/>
             <element name="customize" optional="true"/>
             <sequential>
@@ -443,5 +515,5 @@
                 </pathconvert>
                 <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
-                <copylibs compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+                <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
                     <fileset dir="${build.classes.dir}"/>
                     <manifest>
@@ -572,8 +644,8 @@
         <!-- You can override this target in the ../build.xml file. -->
     </target>
-    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available">
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
         <j2seproject1:jar/>
     </target>
-    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
         <j2seproject1:jar manifest="${manifest.file}"/>
     </target>
@@ -584,5 +656,5 @@
             </j2seproject1:manifest>
         </j2seproject1:jar>
-        <echo>To run this application from the command line without Ant, try:</echo>
+        <echo level="info">To run this application from the command line without Ant, try:</echo>
         <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
         <property location="${dist.jar}" name="dist.jar.resolved"/>
@@ -591,35 +663,44 @@
             <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
         </pathconvert>
-        <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
-    </target>
-    <target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available" name="-do-jar-with-libraries-and-splashscreen">
+        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
+    </target>
+    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
+        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
+        <touch file="${tmp.manifest.file}" verbose="false"/>
+    </target>
+    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
+        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
+        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
+    </target>
+    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
+        <manifest file="${tmp.manifest.file}" mode="update">
+            <attribute name="Main-Class" value="${main.class}"/>
+        </manifest>
+    </target>
+    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
         <basename file="${application.splash}" property="splashscreen.basename"/>
         <mkdir dir="${build.classes.dir}/META-INF"/>
         <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
-        <j2seproject3:copylibs>
-            <customize>
-                <attribute name="Main-Class" value="${main.class}"/>
-                <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
-            </customize>
-        </j2seproject3:copylibs>
-        <echo>To run this application from the command line without Ant, try:</echo>
+        <manifest file="${tmp.manifest.file}" mode="update">
+            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
+        </manifest>
+    </target>
+    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
+        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
+        <echo level="info">To run this application from the command line without Ant, try:</echo>
         <property location="${dist.jar}" name="dist.jar.resolved"/>
-        <echo>java -jar "${dist.jar.resolved}"</echo>
-    </target>
-    <target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries" unless="splashscreen.available">
-        <j2seproject3:copylibs>
-            <customize>
-                <attribute name="Main-Class" value="${main.class}"/>
-            </customize>
-        </j2seproject3:copylibs>
-        <echo>To run this application from the command line without Ant, try:</echo>
-        <property location="${dist.jar}" name="dist.jar.resolved"/>
-        <echo>java -jar "${dist.jar.resolved}"</echo>
-    </target>
+        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
+    </target>
+    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
+        <delete>
+            <fileset file="${tmp.manifest.file}"/>
+        </delete>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
     <target name="-post-jar">
         <!-- Empty placeholder for easier customization. -->
         <!-- You can override this target in the ../build.xml file. -->
     </target>
-    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries-and-splashscreen,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
+    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
     <!--
                 =================
@@ -687,4 +768,70 @@
     <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
     <!--
+                =================
+                PROFILING SECTION
+                =================
+            -->
+    <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile/>
+    </target>
+    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
+        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile classname="${profile.class}"/>
+    </target>
+    <!--
+                =========================
+                APPLET PROFILING  SECTION
+                =========================
+            -->
+    <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </profile>
+    </target>
+    <!--
+                =========================
+                TESTS PROFILING  SECTION
+                =========================
+            -->
+    <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.test.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
+            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+            <jvmarg value="${profiler.info.jvmargs.agent}"/>
+            <jvmarg line="${profiler.info.jvmargs}"/>
+            <test name="${profile.class}"/>
+            <classpath>
+                <path path="${run.test.classpath}"/>
+            </classpath>
+            <syspropertyset>
+                <propertyref prefix="test-sys-prop."/>
+                <mapper from="test-sys-prop.*" to="*" type="glob"/>
+            </syspropertyset>
+            <formatter type="brief" usefile="false"/>
+            <formatter type="xml"/>
+        </junit>
+    </target>
+    <!--
                 ===============
                 JAVADOC SECTION
@@ -697,9 +844,10 @@
                 <path path="${javac.classpath}"/>
             </classpath>
-            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
+            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
                 <filename name="**/*.java"/>
             </fileset>
             <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
                 <include name="**/*.java"/>
+                <exclude name="*.java"/>
             </fileset>
         </javadoc>
@@ -732,5 +880,5 @@
         <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
     </target>
-    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
+    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
         <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
         <copy todir="${build.test.classes.dir}">
@@ -747,5 +895,5 @@
         <!-- You can override this target in the ../build.xml file. -->
     </target>
-    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
+    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
         <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
         <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
Index: java/Postak/nbproject/genfiles.properties
===================================================================
--- java/Postak/nbproject/genfiles.properties	(revision 8:218a80f12411)
+++ java/Postak/nbproject/genfiles.properties	(revision 13:b15d81be8af3)
@@ -5,4 +5,4 @@
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
 nbproject/build-impl.xml.data.CRC32=ecce8ba0
-nbproject/build-impl.xml.script.CRC32=bcebfc1f
-nbproject/build-impl.xml.stylesheet.CRC32=229523de@1.38.3.45
+nbproject/build-impl.xml.script.CRC32=c4083fc9
+nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45
Index: java/Postak/src/cz/frantovo/postak/HromadnaZprava.java
===================================================================
--- java/Postak/src/cz/frantovo/postak/HromadnaZprava.java	(revision 0:e76872ad5226)
+++ java/Postak/src/cz/frantovo/postak/HromadnaZprava.java	(revision 13:b15d81be8af3)
@@ -14,5 +14,5 @@
 public class HromadnaZprava implements Cloneable {
 
-    private static Logger log = Logger.getLogger(HromadnaZprava.class.getName());
+    private static final Logger log = Logger.getLogger(HromadnaZprava.class.getName());
     /** Předmět zprávy */
     private String predmet;
@@ -66,5 +66,5 @@
     public void pridejPrijemce(Collection<InternetAddressKomu> prijemci) {
         if (prijemci == null) {
-            log.log(Level.FINER, "Prázdná množina příjemců - nic nepřidáme");
+            log.log(Level.FINER, "Prázdná množina příjemců – nic nepřidáme");
         } else {
             this.prijemci.addAll(prijemci);
Index: java/SuperPostak/nbproject/build-impl.xml
===================================================================
--- java/SuperPostak/nbproject/build-impl.xml	(revision 7:66667bb5a6cc)
+++ java/SuperPostak/nbproject/build-impl.xml	(revision 13:b15d81be8af3)
@@ -57,5 +57,12 @@
     <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
         <available file="${manifest.file}" property="manifest.available"/>
-        <available file="${application.splash}" property="splashscreen.available"/>
+        <condition property="splashscreen.available">
+            <and>
+                <not>
+                    <equals arg1="${application.splash}" arg2="" trim="true"/>
+                </not>
+                <available file="${application.splash}"/>
+            </and>
+        </condition>
         <condition property="main.class.available">
             <and>
@@ -72,6 +79,12 @@
             </and>
         </condition>
+        <condition property="do.archive">
+            <not>
+                <istrue value="${jar.archive.disabled}"/>
+            </not>
+        </condition>
         <condition property="do.mkdist">
             <and>
+                <isset property="do.archive"/>
                 <isset property="libs.CopyLibs.classpath"/>
                 <not>
@@ -86,15 +99,4 @@
             </and>
         </condition>
-        <condition property="manifest.available+main.class+mkdist.available+splashscreen.available">
-            <and>
-                <istrue value="${manifest.available+main.class+mkdist.available}"/>
-                <istrue value="${splashscreen.available}"/>
-            </and>
-        </condition>
-        <condition property="do.archive">
-            <not>
-                <istrue value="${jar.archive.disabled}"/>
-            </not>
-        </condition>
         <condition property="do.archive+manifest.available">
             <and>
@@ -103,4 +105,16 @@
             </and>
         </condition>
+        <condition property="do.archive+main.class.available">
+            <and>
+                <isset property="main.class.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+splashscreen.available">
+            <and>
+                <isset property="splashscreen.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
         <condition property="do.archive+manifest.available+main.class">
             <and>
@@ -109,15 +123,15 @@
             </and>
         </condition>
-        <condition property="do.archive+manifest.available+main.class+mkdist.available">
-            <and>
-                <istrue value="${manifest.available+main.class+mkdist.available}"/>
-                <istrue value="${do.archive}"/>
-            </and>
-        </condition>
-        <condition property="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available">
-            <and>
-                <istrue value="${manifest.available+main.class+mkdist.available+splashscreen.available}"/>
-                <istrue value="${do.archive}"/>
-            </and>
+        <condition property="manifest.available-mkdist.available">
+            <or>
+                <istrue value="${manifest.available}"/>
+                <isset property="do.mkdist"/>
+            </or>
+        </condition>
+        <condition property="manifest.available+main.class-mkdist.available">
+            <or>
+                <istrue value="${manifest.available+main.class}"/>
+                <isset property="do.mkdist"/>
+            </or>
         </condition>
         <condition property="have.tests">
@@ -175,6 +189,15 @@
             <length length="0" string="${endorsed.classpath}" when="greater"/>
         </condition>
-        <property name="javac.fork" value="false"/>
+        <condition else="false" property="jdkBug6558476">
+            <and>
+                <matches pattern="1\.[56]" string="${java.specification.version}"/>
+                <not>
+                    <os family="unix"/>
+                </not>
+            </and>
+        </condition>
+        <property name="javac.fork" value="${jdkBug6558476}"/>
         <property name="jar.index" value="false"/>
+        <property name="jar.index.metainf" value="${jar.index}"/>
         <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
     </target>
@@ -304,5 +327,7 @@
                     <files includesfile="${javac.includesfile.binary}"/>
                 </delete>
-                <delete file="${javac.includesfile.binary}"/>
+                <delete>
+                    <fileset file="${javac.includesfile.binary}"/>
+                </delete>
             </sequential>
         </macrodef>
@@ -314,5 +339,6 @@
             <attribute default="**" name="testincludes"/>
             <sequential>
-                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}">
+                <property name="junit.forkmode" value="perTest"/>
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
                     <batchtest todir="${build.test.results.dir}">
                         <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
@@ -330,8 +356,53 @@
                     <formatter type="xml"/>
                     <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg value="-ea"/>
                     <jvmarg line="${run.jvmargs}"/>
                 </junit>
             </sequential>
         </macrodef>
+    </target>
+    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
+    <target name="-profile-pre-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-profile-post-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-profile-init-macrodef-profile">
+        <macrodef name="resolve">
+            <attribute name="name"/>
+            <attribute name="value"/>
+            <sequential>
+                <property name="@{name}" value="${env.@{value}}"/>
+            </sequential>
+        </macrodef>
+        <macrodef name="profile">
+            <attribute default="${main.class}" name="classname"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property environment="env"/>
+                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
+                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
+                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
+                    <jvmarg line="${profiler.info.jvmargs}"/>
+                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+                    <arg line="${application.args}"/>
+                    <classpath>
+                        <path path="${run.classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
+        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
+        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
     </target>
     <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
@@ -429,4 +500,5 @@
     <target name="-init-macrodef-copylibs">
         <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${manifest.file}" name="manifest"/>
             <element name="customize" optional="true"/>
             <sequential>
@@ -444,5 +516,5 @@
                 </pathconvert>
                 <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
-                <copylibs compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+                <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
                     <fileset dir="${build.classes.dir}"/>
                     <manifest>
@@ -587,8 +659,8 @@
         <!-- You can override this target in the ../build.xml file. -->
     </target>
-    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available">
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
         <j2seproject1:jar/>
     </target>
-    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
         <j2seproject1:jar manifest="${manifest.file}"/>
     </target>
@@ -599,5 +671,5 @@
             </j2seproject1:manifest>
         </j2seproject1:jar>
-        <echo>To run this application from the command line without Ant, try:</echo>
+        <echo level="info">To run this application from the command line without Ant, try:</echo>
         <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
         <property location="${dist.jar}" name="dist.jar.resolved"/>
@@ -606,35 +678,44 @@
             <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
         </pathconvert>
-        <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
-    </target>
-    <target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available" name="-do-jar-with-libraries-and-splashscreen">
+        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
+    </target>
+    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
+        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
+        <touch file="${tmp.manifest.file}" verbose="false"/>
+    </target>
+    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
+        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
+        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
+    </target>
+    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
+        <manifest file="${tmp.manifest.file}" mode="update">
+            <attribute name="Main-Class" value="${main.class}"/>
+        </manifest>
+    </target>
+    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
         <basename file="${application.splash}" property="splashscreen.basename"/>
         <mkdir dir="${build.classes.dir}/META-INF"/>
         <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
-        <j2seproject3:copylibs>
-            <customize>
-                <attribute name="Main-Class" value="${main.class}"/>
-                <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
-            </customize>
-        </j2seproject3:copylibs>
-        <echo>To run this application from the command line without Ant, try:</echo>
+        <manifest file="${tmp.manifest.file}" mode="update">
+            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
+        </manifest>
+    </target>
+    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
+        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
+        <echo level="info">To run this application from the command line without Ant, try:</echo>
         <property location="${dist.jar}" name="dist.jar.resolved"/>
-        <echo>java -jar "${dist.jar.resolved}"</echo>
-    </target>
-    <target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries" unless="splashscreen.available">
-        <j2seproject3:copylibs>
-            <customize>
-                <attribute name="Main-Class" value="${main.class}"/>
-            </customize>
-        </j2seproject3:copylibs>
-        <echo>To run this application from the command line without Ant, try:</echo>
-        <property location="${dist.jar}" name="dist.jar.resolved"/>
-        <echo>java -jar "${dist.jar.resolved}"</echo>
-    </target>
+        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
+    </target>
+    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
+        <delete>
+            <fileset file="${tmp.manifest.file}"/>
+        </delete>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
     <target name="-post-jar">
         <!-- Empty placeholder for easier customization. -->
         <!-- You can override this target in the ../build.xml file. -->
     </target>
-    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries-and-splashscreen,-do-jar-with-libraries,-post-jar,jnlp" description="Build JAR." name="jar"/>
+    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar,jnlp" description="Build JAR." name="jar"/>
     <!--
                 =================
@@ -702,4 +783,70 @@
     <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
     <!--
+                =================
+                PROFILING SECTION
+                =================
+            -->
+    <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile/>
+    </target>
+    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
+        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile classname="${profile.class}"/>
+    </target>
+    <!--
+                =========================
+                APPLET PROFILING  SECTION
+                =========================
+            -->
+    <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </profile>
+    </target>
+    <!--
+                =========================
+                TESTS PROFILING  SECTION
+                =========================
+            -->
+    <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.test.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
+            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+            <jvmarg value="${profiler.info.jvmargs.agent}"/>
+            <jvmarg line="${profiler.info.jvmargs}"/>
+            <test name="${profile.class}"/>
+            <classpath>
+                <path path="${run.test.classpath}"/>
+            </classpath>
+            <syspropertyset>
+                <propertyref prefix="test-sys-prop."/>
+                <mapper from="test-sys-prop.*" to="*" type="glob"/>
+            </syspropertyset>
+            <formatter type="brief" usefile="false"/>
+            <formatter type="xml"/>
+        </junit>
+    </target>
+    <!--
                 ===============
                 JAVADOC SECTION
@@ -712,9 +859,10 @@
                 <path path="${javac.classpath}"/>
             </classpath>
-            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
+            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
                 <filename name="**/*.java"/>
             </fileset>
             <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
                 <include name="**/*.java"/>
+                <exclude name="*.java"/>
             </fileset>
         </javadoc>
@@ -747,5 +895,5 @@
         <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
     </target>
-    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
+    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
         <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
         <copy todir="${build.test.classes.dir}">
@@ -762,5 +910,5 @@
         <!-- You can override this target in the ../build.xml file. -->
     </target>
-    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
+    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
         <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
         <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
Index: java/SuperPostak/nbproject/genfiles.properties
===================================================================
--- java/SuperPostak/nbproject/genfiles.properties	(revision 7:66667bb5a6cc)
+++ java/SuperPostak/nbproject/genfiles.properties	(revision 13:b15d81be8af3)
@@ -5,4 +5,4 @@
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
 nbproject/build-impl.xml.data.CRC32=d917048a
-nbproject/build-impl.xml.script.CRC32=232b6b6d
-nbproject/build-impl.xml.stylesheet.CRC32=229523de@1.38.3.45
+nbproject/build-impl.xml.script.CRC32=ccb272cf
+nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45
Index: java/SuperPostak/src/cz/frantovo/superPostak/Data.java
===================================================================
--- java/SuperPostak/src/cz/frantovo/superPostak/Data.java	(revision 3:03d27d3b3f7b)
+++ java/SuperPostak/src/cz/frantovo/superPostak/Data.java	(revision 13:b15d81be8af3)
@@ -16,5 +16,5 @@
 public class Data {
 
-    private static Logger log = Logger.getLogger(Data.class.getName());
+    private static final Logger log = Logger.getLogger(Data.class.getName());
     private static Connection spojeni;
     private static byte[] hash;
@@ -49,5 +49,5 @@
         hash = hashuj(url, jmeno, heslo);
         spojeni = DriverManager.getConnection(url, jmeno, String.valueOf(heslo));
-        log.log(Level.INFO, "Otevřeno nové spoejní spojení k databázi: " + url);
+        log.log(Level.INFO, "Otevřeno nové spoejní spojení k databázi: {0}", url);
         return spojeni;
     }
Index: java/SuperPostak/src/cz/frantovo/superPostak/DataSQL.java
===================================================================
--- java/SuperPostak/src/cz/frantovo/superPostak/DataSQL.java	(revision 3:03d27d3b3f7b)
+++ java/SuperPostak/src/cz/frantovo/superPostak/DataSQL.java	(revision 13:b15d81be8af3)
@@ -18,5 +18,5 @@
 public class DataSQL {
 
-    private static Logger log = Logger.getLogger(DataSQL.class.getName());
+    private static final Logger log = Logger.getLogger(DataSQL.class.getName());
     private Connection spojeni;
 
Index: java/SuperPostak/src/cz/frantovo/superPostak/SuperPostak.java
===================================================================
--- java/SuperPostak/src/cz/frantovo/superPostak/SuperPostak.java	(revision 7:66667bb5a6cc)
+++ java/SuperPostak/src/cz/frantovo/superPostak/SuperPostak.java	(revision 13:b15d81be8af3)
@@ -45,31 +45,31 @@
 public class SuperPostak extends javax.swing.JFrame {
 
-    /** Soubor, kde je uložené nastavení */
-    private static final String NASTAVENI_SOUBOR = "Nastaveni.xml.gz";
-    private static final String CERTIFIKATY_SOUBOR = "DuveryhodneCertifikaty.keystore";
-    private static final String NASTAVENI_SLOZKA = ".SuperPostak";
-    private static final String DOMACI_ADRESAR = System.getProperty("user.home");
-    private static final Logger log = Logger.getLogger(SuperPostak.class.getName());
-    private static final long serialVersionUID = -7026850569575604048L;
-    private Nastaveni nastaveni = new Nastaveni();
-    private Postak postak = new Postak(nastaveni);
-
-    /**
-     * Creates new form SuperPostak
-     * @param ladit předvyplní testovací hodnoty - zprávu
-     * @param exit při zavření okna ukončí program     
-     */
-    public SuperPostak(boolean ladit, boolean exit) {
-        log.log(Level.WARNING, "Program byl spuštěn.");
-        nactiOvladaceJDBC();
-        vytvorSlozkuProgramu();
-        initComponents();
-
-        nactiNastaveni();
-        ulozNastaveni();
-        nastaveni.setCestaKCertifikatum(getCestaKCertifikatum());
-
-        inicializujCardLayout();
-        setLocationRelativeTo(null);
+	/** Soubor, kde je uložené nastavení */
+	private static final String NASTAVENI_SOUBOR = "Nastaveni.xml.gz";
+	private static final String CERTIFIKATY_SOUBOR = "DuveryhodneCertifikaty.keystore";
+	private static final String NASTAVENI_SLOZKA = ".SuperPostak";
+	private static final String DOMACI_ADRESAR = System.getProperty("user.home");
+	private static final Logger log = Logger.getLogger(SuperPostak.class.getName());
+	private static final long serialVersionUID = -7026850569575604048L;
+	private Nastaveni nastaveni = new Nastaveni();
+	private Postak postak = new Postak(nastaveni);
+
+	/**
+	 * Creates new form SuperPostak
+	 * @param ladit předvyplní testovací hodnoty - zprávu
+	 * @param exit při zavření okna ukončí program
+	 */
+	public SuperPostak(boolean ladit, boolean exit) {
+		log.log(Level.WARNING, "Program byl spuštěn.");
+		nactiOvladaceJDBC();
+		vytvorSlozkuProgramu();
+		initComponents();
+
+		nactiNastaveni();
+		ulozNastaveni();
+		nastaveni.setCestaKCertifikatum(getCestaKCertifikatum());
+
+		inicializujCardLayout();
+		setLocationRelativeTo(null);
 
 		/** Kvůli souborovým dialogům – aby se otvírali ve stejné složce jako minule. */
@@ -78,220 +78,220 @@
 		prijemciZkusebni.setNastaveni(nastaveni);
 
-        /** Vyřešíme problém TAB vs. Focus */
-        vyresitTabFocusProblem(vstupSQL);
-        vyresitTabFocusProblem(vstupZprava);
-
-        /** Ladicí hodnoty */
-        if (ladit) {
-            nastavLadiciHodnoty();
-        }
-
-        if (exit) {
-            setDefaultCloseOperation(EXIT_ON_CLOSE);
-        }
-
-
-    }
-
-    private void inicializujCardLayout() {
-        panelDatabaze.setName("panelDatabaze");
-        panelOdeslat.setName("panelOdeslat");
-        panelPrijemci.setName("panelPrijemci");
-        panelServer.setName("panelServer");
-        panelVychoziPrijemci.setName("panelVychoziPrijemci");
-        panelZprava.setName("panelZprava");
-
-        panel.add(panelDatabaze, panelDatabaze.getName());
-        panel.add(panelOdeslat, panelOdeslat.getName());
-        panel.add(panelPrijemci, panelPrijemci.getName());
-        panel.add(panelServer, panelServer.getName());
-        panel.add(panelVychoziPrijemci, panelVychoziPrijemci.getName());
-        panel.add(panelZprava, panelZprava.getName());
-
-        setPanel(panelZprava);
-        pack();
-    }
-
-    /**
-     * Vyplní formuláře (odesílatel, předmět, zpráva, příjemci...) výchozími hodnotami,
-     * aby se dal program testovat jedním kliknutím.
-     */
-    private void nastavLadiciHodnoty() {
-        try {
-            vstupAdresaOdesilatele.setText("SuperPostak@frantovo.cz");
-            vstupJmenoOdesilatele.setText("SuperPošťák");
-            vstupPredmet.setText("Zkušební zpráva od SuperPošťáka");
-            vstupZprava.setText("Toto je obyčejná zkušební zpráva v češtině :-)");
-            ArrayList<InternetAddressKomu> adresy = new ArrayList<InternetAddressKomu>();
-            adresy.add(new InternetAddressKomu("SuperPostak@frantovo.cz", "SuperPošťák"));
-            prijemciZkusebni.setAdresy(adresy);
-        } catch (UnsupportedEncodingException e) {
-            log.log(Level.SEVERE, null, e);
-        }
-    }
-
-    /**
-     * Pokusíme se načíst ovladače pro různé DB a výsledek zapíšeme do logu.
-     * Další ovladače je možné přidat pomocí manifestu v příslušných knihovnách.
-     * viz http://www.sweb.cz/pichlik/archive/2006_08_06_archive.html#115502885631518161
-     */
-    private void nactiOvladaceJDBC() {
-        nactiOvladacJDBC("org.postgresql.Driver", "PostgreSQL");
-        nactiOvladacJDBC("com.mysql.jdbc.Driver", "MySQL");
-        nactiOvladacJDBC("net.sourceforge.jtds.jdbc.Driver", "jTDS Sybase a MS SQL");
-        nactiOvladacJDBC("com.sybase.jdbc2.jdbc.SybDriver", "Sybase.com");
-        nactiOvladacJDBC("oracle.jdbc.OracleDriver", "Oracle");
-    }
-
-    /**
-     * @param trida ovladač databáze, který se má načíst
-     * @param jmeno název databáze     
-     */
-    private void nactiOvladacJDBC(String trida, String jmeno) {
-        try {
-            Class.forName(trida);
-            log.log(Level.INFO, "JDBC ovladač pro " + jmeno + " byl úspěšně načten.");
-        } catch (ClassNotFoundException e) {
-            log.log(Level.INFO, "JDBC ovladač pro " + jmeno + " se nepodařilo načíst.");
-        }
-    }
-
-    /** Vrací plnou cestu k souboru s nastavením */
-    protected static String getCestaKCertifikatum() {
-        return getCestaKeSlozceProgramu() + CERTIFIKATY_SOUBOR;
-    }
-
-    /** Vrací plnou cestu k souboru s nastavením */
-    protected static String getCestaKNastaveni() {
-        return getCestaKeSlozceProgramu() + NASTAVENI_SOUBOR;
-    }
-
-    /** Vrací plnou cestu ke složce programu (nastavení, certifikáty a logy) */
-    protected static String getCestaKeSlozceProgramu() {
-        return DOMACI_ADRESAR + File.separator + NASTAVENI_SLOZKA + File.separator;
-    }
-
-    /** Načte nastavení ze souboru */
-    private void nactiNastaveni() {
-        try {
-            XMLDecoder d = new XMLDecoder(new BufferedInputStream(new GZIPInputStream(new FileInputStream(getCestaKNastaveni()))));
-            Object xmlObjekt = d.readObject();
-            d.close();
-
-            if (xmlObjekt instanceof Nastaveni) {
-                nastaveni = (Nastaveni) xmlObjekt;
-            } else {
-                nastaveni = new Nastaveni();
-                log.log(Level.SEVERE, "Nepodařilo se načíst nastavení: není instancí");
-            }
-
-            nactiNastaveniGUI();
-
-            log.log(Level.INFO, "Nastavení bylo načteno.");
-        } catch (FileNotFoundException ex) {
-            log.log(Level.SEVERE, "Nepodařilo se načíst nastavení: soubor nenalezen", ex);
-        } catch (IOException ex) {
-            log.log(Level.SEVERE, "Nastavení se nepodařilo načíst: I/O.", ex);
-        }
-    }
-
-    /** Vytvoří (pokud neexistuje) v domovském adresáři složku, kam se ukládá nastavení a případně logy */
-    private static boolean vytvorSlozkuProgramu() {
-        if (new File(getCestaKeSlozceProgramu()).mkdirs()) {
-            log.log(Level.INFO, "Složka pro nastavení programu byla vytvořena: " + getCestaKeSlozceProgramu());
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    /** Uloží nastavení do souboru */
-    private void ulozNastaveni() {
-        try {
-            ulozNastaveniGUI();
-
-            vytvorSlozkuProgramu();
-
-            XMLEncoder e = new XMLEncoder(new BufferedOutputStream(new GZIPOutputStream(new FileOutputStream(getCestaKNastaveni()))));
-            e.writeObject(nastaveni);
-            e.close();
-            log.log(Level.INFO, "Nastavení bylo uloženo.");
-        } catch (FileNotFoundException ex) {
-            log.log(Level.SEVERE, "Nastavení se nepodařilo uložit: soubor nenalezen.", ex);
-        } catch (IOException ex) {
-            log.log(Level.SEVERE, "Nastavení se nepodařilo uložit: I/O.", ex);
-        }
-    }
-
-    /** Posbírá zadané hodnoty z GUI a uloží je do objektu nastaveni */
-    private void ulozNastaveniGUI() {
-        nastaveni.setDatabaze(vstupDatabaze.getText());
-        nastaveni.setDbHeslo(vstupDBheslo.getPassword());
-        nastaveni.setDbJmeno(vstupDBjmeno.getText());
-        nastaveni.setLimitZprav((Integer) vstupSMTPlimitPrijemcu.getValue());
-        nastaveni.setPostovniHeslo(vstupSMTPheslo.getPassword());
-        nastaveni.setPostovniJmeno(vstupSMTPjmeno.getText());
-        nastaveni.setPostovniPort((Integer) vstupSMTPport.getValue());
-        nastaveni.setPostovniServer(vstupSMTPserver.getText());
-        nastaveni.setVychoziPrijemci(prijemciVychozi.getAdresy());
-    }
-
-    /** Aktualizuje GUI formuláře hodnotami z objektu nastaveni */
-    private void nactiNastaveniGUI() {
-        vstupDatabaze.setText(nastaveni.getDatabaze());
-        if (nastaveni.getDbHeslo() != null) {
-            vstupDBheslo.setText(String.valueOf(nastaveni.getDbHeslo()));
-        }
-        vstupDBjmeno.setText(nastaveni.getDbJmeno());
-        vstupSMTPlimitPrijemcu.setValue(nastaveni.getLimitZprav());
-        if (nastaveni.getPostovniHeslo() != null) {
-            vstupSMTPheslo.setText(String.valueOf(nastaveni.getPostovniHeslo()));
-        }
-        vstupSMTPjmeno.setText(nastaveni.getPostovniJmeno());
-        vstupSMTPport.setValue(nastaveni.getPostovniPort());
-        vstupSMTPserver.setText(nastaveni.getPostovniServer());
-        prijemciVychozi.setAdresy(nastaveni.getVychoziPrijemci());
-    }
-
-    protected static void zobrazChybovyDialog(Component vlastnik, String strucnaZprava, Throwable vyjimka, Level zavaznost, boolean logovat) {
-        zobrazChybovyDialog(vlastnik, "Chyba", strucnaZprava, null, vyjimka, zavaznost, logovat);
-    }
-
-    protected static void zobrazInformacniDialog(Component vlastnik, String nadpis, String text, boolean loguj) {
-        JOptionPane.showMessageDialog(vlastnik, text, nadpis, JOptionPane.INFORMATION_MESSAGE);
-        if (loguj) {
-            log.log(Level.INFO, nadpis + ": " + text);
-        }
-    }
-
-    protected static void zobrazChybovyDialog(Component vlastnik, String nadpis, String strucnaZprava, String podrobnaZprava, Throwable vyjimka, Level zavaznost, boolean logovat) {
-        if (logovat) {
-            log.log(zavaznost, strucnaZprava, vyjimka);
-        }
-
-        JXErrorPane chybovyPanel = new JXErrorPane();
-        ErrorInfo chybovaInformace = new ErrorInfo(nadpis, strucnaZprava, podrobnaZprava, null, vyjimka, zavaznost, null);
-        chybovyPanel.setErrorInfo(chybovaInformace);
-        JDialog dialog = JXErrorPane.createDialog(vlastnik, chybovyPanel);
-        dialog.setVisible(true);
-    }
-
-    private void zobrazChybovyDialog(String strucnaZprava, Throwable vyjimka, Level zavaznost, boolean logovat) {
-        zobrazChybovyDialog(this, strucnaZprava, vyjimka, zavaznost, logovat);
-    }
-
-    private void zobrazInformacniDialog(String nadpis, String text, boolean loguj) {
-        zobrazInformacniDialog(this, nadpis, text, loguj);
-    }
-
-    private void zobrazChybovyDialog(String nadpis, String strucnaZprava, String podrobnaZprava, Throwable vyjimka, Level zavaznost, boolean logovat) {
-        zobrazChybovyDialog(this, nadpis, strucnaZprava, podrobnaZprava, vyjimka, zavaznost, logovat);
-    }
-
-    /** 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.
-     */
+		/** Vyřešíme problém TAB vs. Focus */
+		vyresitTabFocusProblem(vstupSQL);
+		vyresitTabFocusProblem(vstupZprava);
+
+		/** Ladicí hodnoty */
+		if (ladit) {
+			nastavLadiciHodnoty();
+		}
+
+		if (exit) {
+			setDefaultCloseOperation(EXIT_ON_CLOSE);
+		}
+
+
+	}
+
+	private void inicializujCardLayout() {
+		panelDatabaze.setName("panelDatabaze");
+		panelOdeslat.setName("panelOdeslat");
+		panelPrijemci.setName("panelPrijemci");
+		panelServer.setName("panelServer");
+		panelVychoziPrijemci.setName("panelVychoziPrijemci");
+		panelZprava.setName("panelZprava");
+
+		panel.add(panelDatabaze, panelDatabaze.getName());
+		panel.add(panelOdeslat, panelOdeslat.getName());
+		panel.add(panelPrijemci, panelPrijemci.getName());
+		panel.add(panelServer, panelServer.getName());
+		panel.add(panelVychoziPrijemci, panelVychoziPrijemci.getName());
+		panel.add(panelZprava, panelZprava.getName());
+
+		setPanel(panelZprava);
+		pack();
+	}
+
+	/**
+	 * Vyplní formuláře (odesílatel, předmět, zpráva, příjemci...) výchozími hodnotami,
+	 * aby se dal program testovat jedním kliknutím.
+	 */
+	private void nastavLadiciHodnoty() {
+		try {
+			vstupAdresaOdesilatele.setText("SuperPostak@frantovo.cz");
+			vstupJmenoOdesilatele.setText("SuperPošťák");
+			vstupPredmet.setText("Zkušební zpráva od SuperPošťáka");
+			vstupZprava.setText("Toto je obyčejná zkušební zpráva v češtině :-)");
+			ArrayList<InternetAddressKomu> adresy = new ArrayList<InternetAddressKomu>();
+			adresy.add(new InternetAddressKomu("SuperPostak@frantovo.cz", "SuperPošťák"));
+			prijemciZkusebni.setAdresy(adresy);
+		} catch (UnsupportedEncodingException e) {
+			log.log(Level.SEVERE, null, e);
+		}
+	}
+
+	/**
+	 * Pokusíme se načíst ovladače pro různé DB a výsledek zapíšeme do logu.
+	 * Další ovladače je možné přidat pomocí manifestu v příslušných knihovnách.
+	 * viz http://www.sweb.cz/pichlik/archive/2006_08_06_archive.html#115502885631518161
+	 */
+	private void nactiOvladaceJDBC() {
+		nactiOvladacJDBC("org.postgresql.Driver", "PostgreSQL");
+		nactiOvladacJDBC("com.mysql.jdbc.Driver", "MySQL");
+		nactiOvladacJDBC("net.sourceforge.jtds.jdbc.Driver", "jTDS Sybase a MS SQL");
+		nactiOvladacJDBC("com.sybase.jdbc2.jdbc.SybDriver", "Sybase.com");
+		nactiOvladacJDBC("oracle.jdbc.OracleDriver", "Oracle");
+	}
+
+	/**
+	 * @param trida ovladač databáze, který se má načíst
+	 * @param jmeno název databáze
+	 */
+	private void nactiOvladacJDBC(String trida, String jmeno) {
+		try {
+			Class.forName(trida);
+			log.log(Level.INFO, "JDBC ovladač pro {0} byl úspěšně načten.", jmeno);
+		} catch (ClassNotFoundException e) {
+			log.log(Level.INFO, "JDBC ovladač pro {0} se nepodařilo načíst.", jmeno);
+		}
+	}
+
+	/** Vrací plnou cestu k souboru s nastavením */
+	protected static String getCestaKCertifikatum() {
+		return getCestaKeSlozceProgramu() + CERTIFIKATY_SOUBOR;
+	}
+
+	/** Vrací plnou cestu k souboru s nastavením */
+	protected static String getCestaKNastaveni() {
+		return getCestaKeSlozceProgramu() + NASTAVENI_SOUBOR;
+	}
+
+	/** Vrací plnou cestu ke složce programu (nastavení, certifikáty a logy) */
+	protected static String getCestaKeSlozceProgramu() {
+		return DOMACI_ADRESAR + File.separator + NASTAVENI_SLOZKA + File.separator;
+	}
+
+	/** Načte nastavení ze souboru */
+	private void nactiNastaveni() {
+		try {
+			XMLDecoder d = new XMLDecoder(new BufferedInputStream(new GZIPInputStream(new FileInputStream(getCestaKNastaveni()))));
+			Object xmlObjekt = d.readObject();
+			d.close();
+
+			if (xmlObjekt instanceof Nastaveni) {
+				nastaveni = (Nastaveni) xmlObjekt;
+			} else {
+				nastaveni = new Nastaveni();
+				log.log(Level.SEVERE, "Nepodařilo se načíst nastavení: není instancí");
+			}
+
+			nactiNastaveniGUI();
+
+			log.log(Level.INFO, "Nastavení bylo načteno.");
+		} catch (FileNotFoundException ex) {
+			log.log(Level.SEVERE, "Nepodařilo se načíst nastavení: soubor nenalezen", ex);
+		} catch (IOException ex) {
+			log.log(Level.SEVERE, "Nastavení se nepodařilo načíst: I/O.", ex);
+		}
+	}
+
+	/** Vytvoří (pokud neexistuje) v domovském adresáři složku, kam se ukládá nastavení a případně logy */
+	private static boolean vytvorSlozkuProgramu() {
+		if (new File(getCestaKeSlozceProgramu()).mkdirs()) {
+			log.log(Level.INFO, "Složka pro nastavení programu byla vytvořena: {0}", getCestaKeSlozceProgramu());
+			return true;
+		} else {
+			return false;
+		}
+	}
+
+	/** Uloží nastavení do souboru */
+	private void ulozNastaveni() {
+		try {
+			ulozNastaveniGUI();
+
+			vytvorSlozkuProgramu();
+
+			XMLEncoder e = new XMLEncoder(new BufferedOutputStream(new GZIPOutputStream(new FileOutputStream(getCestaKNastaveni()))));
+			e.writeObject(nastaveni);
+			e.close();
+			log.log(Level.INFO, "Nastavení bylo uloženo.");
+		} catch (FileNotFoundException ex) {
+			log.log(Level.SEVERE, "Nastavení se nepodařilo uložit: soubor nenalezen.", ex);
+		} catch (IOException ex) {
+			log.log(Level.SEVERE, "Nastavení se nepodařilo uložit: I/O.", ex);
+		}
+	}
+
+	/** Posbírá zadané hodnoty z GUI a uloží je do objektu nastaveni */
+	private void ulozNastaveniGUI() {
+		nastaveni.setDatabaze(vstupDatabaze.getText());
+		nastaveni.setDbHeslo(vstupDBheslo.getPassword());
+		nastaveni.setDbJmeno(vstupDBjmeno.getText());
+		nastaveni.setLimitZprav((Integer) vstupSMTPlimitPrijemcu.getValue());
+		nastaveni.setPostovniHeslo(vstupSMTPheslo.getPassword());
+		nastaveni.setPostovniJmeno(vstupSMTPjmeno.getText());
+		nastaveni.setPostovniPort((Integer) vstupSMTPport.getValue());
+		nastaveni.setPostovniServer(vstupSMTPserver.getText());
+		nastaveni.setVychoziPrijemci(prijemciVychozi.getAdresy());
+	}
+
+	/** Aktualizuje GUI formuláře hodnotami z objektu nastaveni */
+	private void nactiNastaveniGUI() {
+		vstupDatabaze.setText(nastaveni.getDatabaze());
+		if (nastaveni.getDbHeslo() != null) {
+			vstupDBheslo.setText(String.valueOf(nastaveni.getDbHeslo()));
+		}
+		vstupDBjmeno.setText(nastaveni.getDbJmeno());
+		vstupSMTPlimitPrijemcu.setValue(nastaveni.getLimitZprav());
+		if (nastaveni.getPostovniHeslo() != null) {
+			vstupSMTPheslo.setText(String.valueOf(nastaveni.getPostovniHeslo()));
+		}
+		vstupSMTPjmeno.setText(nastaveni.getPostovniJmeno());
+		vstupSMTPport.setValue(nastaveni.getPostovniPort());
+		vstupSMTPserver.setText(nastaveni.getPostovniServer());
+		prijemciVychozi.setAdresy(nastaveni.getVychoziPrijemci());
+	}
+
+	protected static void zobrazChybovyDialog(Component vlastnik, String strucnaZprava, Throwable vyjimka, Level zavaznost, boolean logovat) {
+		zobrazChybovyDialog(vlastnik, "Chyba", strucnaZprava, null, vyjimka, zavaznost, logovat);
+	}
+
+	protected static void zobrazInformacniDialog(Component vlastnik, String nadpis, String text, boolean loguj) {
+		JOptionPane.showMessageDialog(vlastnik, text, nadpis, JOptionPane.INFORMATION_MESSAGE);
+		if (loguj) {
+			log.log(Level.INFO, "{0}: {1}", new Object[]{nadpis, text});
+		}
+	}
+
+	protected static void zobrazChybovyDialog(Component vlastnik, String nadpis, String strucnaZprava, String podrobnaZprava, Throwable vyjimka, Level zavaznost, boolean logovat) {
+		if (logovat) {
+			log.log(zavaznost, strucnaZprava, vyjimka);
+		}
+
+		JXErrorPane chybovyPanel = new JXErrorPane();
+		ErrorInfo chybovaInformace = new ErrorInfo(nadpis, strucnaZprava, podrobnaZprava, null, vyjimka, zavaznost, null);
+		chybovyPanel.setErrorInfo(chybovaInformace);
+		JDialog dialog = JXErrorPane.createDialog(vlastnik, chybovyPanel);
+		dialog.setVisible(true);
+	}
+
+	private void zobrazChybovyDialog(String strucnaZprava, Throwable vyjimka, Level zavaznost, boolean logovat) {
+		zobrazChybovyDialog(this, strucnaZprava, vyjimka, zavaznost, logovat);
+	}
+
+	private void zobrazInformacniDialog(String nadpis, String text, boolean loguj) {
+		zobrazInformacniDialog(this, nadpis, text, loguj);
+	}
+
+	private void zobrazChybovyDialog(String nadpis, String strucnaZprava, String podrobnaZprava, Throwable vyjimka, Level zavaznost, boolean logovat) {
+		zobrazChybovyDialog(this, nadpis, strucnaZprava, podrobnaZprava, vyjimka, zavaznost, logovat);
+	}
+
+	/** 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.
+	 */
     // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
     private void initComponents() {
@@ -927,247 +927,247 @@
 
     private void lnTextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_lnTextActionPerformed
-        setPanel(panelZprava);
+		setPanel(panelZprava);
     }//GEN-LAST:event_lnTextActionPerformed
 
     private void lnPrijemciActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_lnPrijemciActionPerformed
-        setPanel(panelPrijemci);
+		setPanel(panelPrijemci);
     }//GEN-LAST:event_lnPrijemciActionPerformed
 
     private void lnOdeslatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_lnOdeslatActionPerformed
-        setPanel(panelOdeslat);
+		setPanel(panelOdeslat);
     }//GEN-LAST:event_lnOdeslatActionPerformed
 
     private void lnServerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_lnServerActionPerformed
-        setPanel(panelServer);
+		setPanel(panelServer);
     }//GEN-LAST:event_lnServerActionPerformed
 
     private void lnDatabazeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_lnDatabazeActionPerformed
-        setPanel(panelDatabaze);
+		setPanel(panelDatabaze);
     }//GEN-LAST:event_lnDatabazeActionPerformed
 
     private void lnVychoziPrijemciActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_lnVychoziPrijemciActionPerformed
-        setPanel(panelVychoziPrijemci);
+		setPanel(panelVychoziPrijemci);
     }//GEN-LAST:event_lnVychoziPrijemciActionPerformed
 
     private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
-        ulozNastaveni();
-        log.log(Level.WARNING, "Ukončuji program.");
+		ulozNastaveni();
+		log.log(Level.WARNING, "Ukončuji program.");
     }//GEN-LAST:event_formWindowClosing
 
-    /**
-     * Sestaví zprávu na základě GUI vstupů. Všechno kromě příjemců,
-     * ti se přidají až dodatečně, podle toho,
-     * jestli jde o zkušební nebo skutečné rozesílání.
-     */
-    private HromadnaZprava getZprava() throws UnsupportedEncodingException {
-        HromadnaZprava zprava = new HromadnaZprava();
-        zprava.setOdesilatel(new InternetAddress(vstupAdresaOdesilatele.getText(), vstupJmenoOdesilatele.getText()));
-        zprava.setPredmet(vstupPredmet.getText());
-        zprava.setText(vstupZprava.getText());
-        zprava.setFormatHTML(vstupFormatHTML.isSelected());
-
-        if (Postak.zkontrolujAdresu(odpovedetKomuAdresa.getText())) {
-            InternetAddress komu = new InternetAddress();
-            komu.setPersonal(odpovedetKomuJmeno.getText());
-            komu.setAddress(odpovedetKomuAdresa.getText());
-            zprava.setOdpovedetKomu(komu);
-        }
-
-        return zprava;
-    }
-
-    /** Všichni příjemci, kterým bude odeslána ostrá zpráva. */
-    private ArrayList<InternetAddressKomu> getPrijemciVsichni() throws SQLException, UnsupportedEncodingException {
-        ArrayList<InternetAddressKomu> vsichni = new ArrayList<InternetAddressKomu>();
-        Collection<InternetAddressKomu> adresyVychozi = nastaveni.getVychoziPrijemci();
-        Collection<InternetAddressKomu> adresySQL = getPrijemciSQL();
-        Collection<InternetAddressKomu> adresyDodatecne = prijemciDodatecni.getAdresy();
-
-        if (adresyVychozi != null) {
-            vsichni.addAll(adresyVychozi);
-        }
-        if (adresySQL != null) {
-            vsichni.addAll(adresySQL);
-        }
-        if (adresyDodatecne != null) {
-            vsichni.addAll(adresyDodatecne);
-        }
-        return vsichni;
-    }
+	/**
+	 * Sestaví zprávu na základě GUI vstupů. Všechno kromě příjemců,
+	 * ti se přidají až dodatečně, podle toho,
+	 * jestli jde o zkušební nebo skutečné rozesílání.
+	 */
+	private HromadnaZprava getZprava() throws UnsupportedEncodingException {
+		HromadnaZprava zprava = new HromadnaZprava();
+		zprava.setOdesilatel(new InternetAddress(vstupAdresaOdesilatele.getText(), vstupJmenoOdesilatele.getText()));
+		zprava.setPredmet(vstupPredmet.getText());
+		zprava.setText(vstupZprava.getText());
+		zprava.setFormatHTML(vstupFormatHTML.isSelected());
+
+		if (Postak.zkontrolujAdresu(odpovedetKomuAdresa.getText())) {
+			InternetAddress komu = new InternetAddress();
+			komu.setPersonal(odpovedetKomuJmeno.getText());
+			komu.setAddress(odpovedetKomuAdresa.getText());
+			zprava.setOdpovedetKomu(komu);
+		}
+
+		return zprava;
+	}
+
+	/** Všichni příjemci, kterým bude odeslána ostrá zpráva. */
+	private ArrayList<InternetAddressKomu> getPrijemciVsichni() throws SQLException, UnsupportedEncodingException {
+		ArrayList<InternetAddressKomu> vsichni = new ArrayList<InternetAddressKomu>();
+		Collection<InternetAddressKomu> adresyVychozi = nastaveni.getVychoziPrijemci();
+		Collection<InternetAddressKomu> adresySQL = getPrijemciSQL();
+		Collection<InternetAddressKomu> adresyDodatecne = prijemciDodatecni.getAdresy();
+
+		if (adresyVychozi != null) {
+			vsichni.addAll(adresyVychozi);
+		}
+		if (adresySQL != null) {
+			vsichni.addAll(adresySQL);
+		}
+		if (adresyDodatecne != null) {
+			vsichni.addAll(adresyDodatecne);
+		}
+		return vsichni;
+	}
 
     private void rozeslatHromadnouZpravuTlacitkoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rozeslatHromadnouZpravuTlacitkoActionPerformed
-        try {
-            ulozNastaveniGUI();
-            HromadnaZprava zprava = getZprava();
-            zprava.setPrijemci(getPrijemciVsichni());
-
-            int volba = JOptionPane.showOptionDialog(this, "Počet příjemců hromadné zprávy: " + zprava.getPrijemci().size() + "\nPřejete si zprávu odeslat?", "Potvrdit odeslání", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE, null, null, null);
-            if (volba == JOptionPane.YES_OPTION) {
-                odesli(zprava);
-                Postak.vypisPrijemce(zprava.getPrijemci());
-                zobrazInformacniDialog("Odesláno", "Zpráva byla odeslána.\nPočet příjemců: " + zprava.getPrijemci().size(), true);
-            }
-        } catch (Exception e) {
-            zobrazChybovyDialog("Zprávu se nepodařilo odeslat", e, Level.SEVERE, true);
-        }
+		try {
+			ulozNastaveniGUI();
+			HromadnaZprava zprava = getZprava();
+			zprava.setPrijemci(getPrijemciVsichni());
+
+			int volba = JOptionPane.showOptionDialog(this, "Počet příjemců hromadné zprávy: " + zprava.getPrijemci().size() + "\nPřejete si zprávu odeslat?", "Potvrdit odeslání", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE, null, null, null);
+			if (volba == JOptionPane.YES_OPTION) {
+				odesli(zprava);
+				Postak.vypisPrijemce(zprava.getPrijemci());
+				zobrazInformacniDialog("Odesláno", "Zpráva byla odeslána.\nPočet příjemců: " + zprava.getPrijemci().size(), true);
+			}
+		} catch (Exception e) {
+			zobrazChybovyDialog("Zprávu se nepodařilo odeslat", e, Level.SEVERE, true);
+		}
 }//GEN-LAST:event_rozeslatHromadnouZpravuTlacitkoActionPerformed
 
     private void rozeslatZkusebniTlacitkoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rozeslatZkusebniTlacitkoActionPerformed
-        try {
-            ulozNastaveniGUI();
-            HromadnaZprava zprava = getZprava();
-            zprava.setPrijemci(prijemciZkusebni.getAdresy());
-
-            odesli(zprava);
-
-            zobrazInformacniDialog("Odesláno", "Zkušební zpráva byla odeslána.\nPočet adresátů: " + zprava.getPrijemci().size(), true);
-        } catch (Exception e) {
-            zobrazChybovyDialog("Zkušební zprávu se nepodařilo odeslat", e, Level.SEVERE, true);
-        }
+		try {
+			ulozNastaveniGUI();
+			HromadnaZprava zprava = getZprava();
+			zprava.setPrijemci(prijemciZkusebni.getAdresy());
+
+			odesli(zprava);
+
+			zobrazInformacniDialog("Odesláno", "Zkušební zpráva byla odeslána.\nPočet adresátů: " + zprava.getPrijemci().size(), true);
+		} catch (Exception e) {
+			zobrazChybovyDialog("Zkušební zprávu se nepodařilo odeslat", e, Level.SEVERE, true);
+		}
     }//GEN-LAST:event_rozeslatZkusebniTlacitkoActionPerformed
 
     private void vyzkousetPripojeniTlacitkoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_vyzkousetPripojeniTlacitkoActionPerformed
-        try {
+		try {
             getSpojeni();//GEN-LAST:event_vyzkousetPripojeniTlacitkoActionPerformed
-            zobrazInformacniDialog("Připojeno k DB", "Připojení k DB proběhlo úspěšně", false);
-        } catch (SQLException e) {
-            zobrazChybovyDialog("Spojení s DB", "Připojení k databázi selhalo", null, e, Level.SEVERE, true);
-        }
-    }
+			zobrazInformacniDialog("Připojeno k DB", "Připojení k DB proběhlo úspěšně", false);
+		} catch (SQLException e) {
+			zobrazChybovyDialog("Spojení s DB", "Připojení k databázi selhalo", null, e, Level.SEVERE, true);
+		}
+	}
 
     private void vyzkousetSQLTlacitkoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_vyzkousetSQLTlacitkoActionPerformed
-        try {
+		try {
             Collection<InternetAddressKomu> adresy = getPrijemciSQL();//GEN-LAST:event_vyzkousetSQLTlacitkoActionPerformed
-            if (adresy == null) {
-                zobrazInformacniDialog("SQL dotaz", "Dotaz do databáze neproběhl.\nSQL dotaz je prázdný.", false);
-            } else {
-                zobrazInformacniDialog("SQL dotaz", "Dotaz do databáze byl úspěšný.\nPočet získaných záznamů: " + adresy.size(), false);
-            }
-        } catch (Exception e) {
-            zobrazChybovyDialog("SQL dotaz", "Provedení SQL příkazu selhalo selhalo", null, e, Level.SEVERE, true);
-        }
-    }
+			if (adresy == null) {
+				zobrazInformacniDialog("SQL dotaz", "Dotaz do databáze neproběhl.\nSQL dotaz je prázdný.", false);
+			} else {
+				zobrazInformacniDialog("SQL dotaz", "Dotaz do databáze byl úspěšný.\nPočet získaných záznamů: " + adresy.size(), false);
+			}
+		} catch (Exception e) {
+			zobrazChybovyDialog("SQL dotaz", "Provedení SQL příkazu selhalo selhalo", null, e, Level.SEVERE, true);
+		}
+	}
 
     private void zobrazitSQLPrijemceTlacitkoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_zobrazitSQLPrijemceTlacitkoActionPerformed
-        try {
-            Collection<InternetAddressKomu> adresy = getPrijemciSQL();
-
-            ZobrazovacAdres zobrazovac = new ZobrazovacAdres(this, false);
+		try {
+			Collection<InternetAddressKomu> adresy = getPrijemciSQL();
+
+			ZobrazovacAdres zobrazovac = new ZobrazovacAdres(this, false);
 			zobrazovac.setNastaveni(nastaveni);
-            zobrazovac.setAdresy(adresy);
-            zobrazovac.setLocationRelativeTo(this);
-            zobrazovac.setVisible(true);
-
-        } catch (Exception e) {
-            zobrazChybovyDialog("SQL dotaz", "Provedení SQL příkazu selhalo selhalo", null, e, Level.SEVERE, true);
-        }
+			zobrazovac.setAdresy(adresy);
+			zobrazovac.setLocationRelativeTo(this);
+			zobrazovac.setVisible(true);
+
+		} catch (Exception e) {
+			zobrazChybovyDialog("SQL dotaz", "Provedení SQL příkazu selhalo selhalo", null, e, Level.SEVERE, true);
+		}
     }//GEN-LAST:event_zobrazitSQLPrijemceTlacitkoActionPerformed
 
     private void zobrazitVsechnyPrijemceTlacitkoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_zobrazitVsechnyPrijemceTlacitkoActionPerformed
-        try {
-            Collection<InternetAddressKomu> adresy = getPrijemciVsichni();
-
-            ZobrazovacAdres zobrazovac = new ZobrazovacAdres(this, false);
-            zobrazovac.setAdresy(adresy);
-            zobrazovac.setLocationRelativeTo(this);
-            zobrazovac.setVisible(true);
-
-        } catch (Exception e) {
-            zobrazChybovyDialog("SQL dotaz", "Provedení SQL příkazu selhalo selhalo", null, e, Level.SEVERE, true);
-        }
+		try {
+			Collection<InternetAddressKomu> adresy = getPrijemciVsichni();
+
+			ZobrazovacAdres zobrazovac = new ZobrazovacAdres(this, false);
+			zobrazovac.setAdresy(adresy);
+			zobrazovac.setLocationRelativeTo(this);
+			zobrazovac.setVisible(true);
+
+		} catch (Exception e) {
+			zobrazChybovyDialog("SQL dotaz", "Provedení SQL příkazu selhalo selhalo", null, e, Level.SEVERE, true);
+		}
     }//GEN-LAST:event_zobrazitVsechnyPrijemceTlacitkoActionPerformed
 
     private void odpovedetKomuOdkazActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_odpovedetKomuOdkazActionPerformed
-        odpovedetKomuDialog.pack();
-        odpovedetKomuDialog.setLocationRelativeTo(this);
-        odpovedetKomuDialog.setModalityType(ModalityType.APPLICATION_MODAL);
-        odpovedetKomuDialog.getRootPane().setDefaultButton(odpovedetKomuHotovo);
-        odpovedetKomuDialog.setVisible(true);
+		odpovedetKomuDialog.pack();
+		odpovedetKomuDialog.setLocationRelativeTo(this);
+		odpovedetKomuDialog.setModalityType(ModalityType.APPLICATION_MODAL);
+		odpovedetKomuDialog.getRootPane().setDefaultButton(odpovedetKomuHotovo);
+		odpovedetKomuDialog.setVisible(true);
 }//GEN-LAST:event_odpovedetKomuOdkazActionPerformed
 
     private void odpovedetKomuHotovoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_odpovedetKomuHotovoActionPerformed
-        odpovedetKomuDialog.setVisible(false);
+		odpovedetKomuDialog.setVisible(false);
 }//GEN-LAST:event_odpovedetKomuHotovoActionPerformed
 
-    /** Provede uživatelem zadaný SQL dotaz a vrátí získané příjemce */
-    private Collection<InternetAddressKomu> getPrijemciSQL() throws SQLException, UnsupportedEncodingException {
-        if ("".equals(vstupSQL.getText())) {
-            return null;
-        } else {
-            return getSpojeni().getAdresy(vstupSQL.getText());
-        }
-    }
-
-    private DataSQL getSpojeni() throws SQLException {
-        return Data.getSpojeniSQL(vstupDatabaze.getText(), vstupDBjmeno.getText(), vstupDBheslo.getPassword());
-    }
-
-    /** Obalovací třída, která v průběhu odesílání zobrazuje kurzor s hodinami. */
-    private void odesli(HromadnaZprava zprava) throws MessagingException {
-        setCursor(new Cursor(Cursor.WAIT_CURSOR));
-        try {
-            postak.setNastaveni(nastaveni);
-            postak.odesli(zprava);
-
-        } catch (MessagingException e) {
-            throw e;
-        } finally {
-            setCursor(Cursor.getDefaultCursor());
-        }
-    }
-
-    private void setPanel(JComponent komponenta) {
-
-        if (panel.getLayout() instanceof CardLayout) {
-            CardLayout l = (CardLayout) panel.getLayout();
-            l.show(panel, komponenta.getName());
-        } else {
-            log.log(Level.WARNING, "Neplatí: panel.getLayout() instanceof CardLayout");
-        }
-
-    }
-
-    /** Změní chování tabulátoru v textovém poli - aby se pomocí TABu dalo skočit na další komponentu */
-    private void vyresitTabFocusProblem(JTextArea textArea) {
-        textArea.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, null);
-        textArea.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, null);
-    }
-
-    public JXTaskPaneContainer getTaskPanel() {
-        return taskPanel;
-    }
-
-    /**
-     * @param args the command line arguments
-     */
-    public static void main(String args[]) {
-        final boolean ladit = (args != null && args.length > 0 && args[0].equals("ladit"));
-
-        try {
-            //LookAndFeel laf = UIManager.getLookAndFeel();
-
-            //laf = new SubstanceLookAndFeel();
-            //laf = new SubstanceBusinessLookAndFeel();
-            //laf = new SubstanceBusinessBlueSteelLookAndFeel();
-            //laf = new SubstanceBusinessBlackSteelLookAndFeel();
-
-            UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceBusinessBlueSteelLookAndFeel");
-        } catch (ClassNotFoundException ex) {
-            log.log(Level.SEVERE, null, ex);
-        } catch (InstantiationException ex) {
-            log.log(Level.SEVERE, null, ex);
-        } catch (IllegalAccessException ex) {
-            log.log(Level.SEVERE, null, ex);
-        } catch (UnsupportedLookAndFeelException ex) {
-            log.log(Level.SEVERE, null, ex);
-        }
-
-        java.awt.EventQueue.invokeLater(new Runnable() {
-
-            public void run() {
-                new SuperPostak(ladit, true).setVisible(true);
-            }
-        });
-    }
+	/** Provede uživatelem zadaný SQL dotaz a vrátí získané příjemce */
+	private Collection<InternetAddressKomu> getPrijemciSQL() throws SQLException, UnsupportedEncodingException {
+		if ("".equals(vstupSQL.getText())) {
+			return null;
+		} else {
+			return getSpojeni().getAdresy(vstupSQL.getText());
+		}
+	}
+
+	private DataSQL getSpojeni() throws SQLException {
+		return Data.getSpojeniSQL(vstupDatabaze.getText(), vstupDBjmeno.getText(), vstupDBheslo.getPassword());
+	}
+
+	/** Obalovací třída, která v průběhu odesílání zobrazuje kurzor s hodinami. */
+	private void odesli(HromadnaZprava zprava) throws MessagingException {
+		setCursor(new Cursor(Cursor.WAIT_CURSOR));
+		try {
+			postak.setNastaveni(nastaveni);
+			postak.odesli(zprava);
+
+		} catch (MessagingException e) {
+			throw e;
+		} finally {
+			setCursor(Cursor.getDefaultCursor());
+		}
+	}
+
+	private void setPanel(JComponent komponenta) {
+
+		if (panel.getLayout() instanceof CardLayout) {
+			CardLayout l = (CardLayout) panel.getLayout();
+			l.show(panel, komponenta.getName());
+		} else {
+			log.log(Level.WARNING, "Neplatí: panel.getLayout() instanceof CardLayout");
+		}
+
+	}
+
+	/** Změní chování tabulátoru v textovém poli - aby se pomocí TABu dalo skočit na další komponentu */
+	private void vyresitTabFocusProblem(JTextArea textArea) {
+		textArea.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, null);
+		textArea.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, null);
+	}
+
+	public JXTaskPaneContainer getTaskPanel() {
+		return taskPanel;
+	}
+
+	/**
+	 * @param args the command line arguments
+	 */
+	public static void main(String args[]) {
+		final boolean ladit = (args != null && args.length > 0 && args[0].equals("ladit"));
+
+		try {
+			//LookAndFeel laf = UIManager.getLookAndFeel();
+
+			//laf = new SubstanceLookAndFeel();
+			//laf = new SubstanceBusinessLookAndFeel();
+			//laf = new SubstanceBusinessBlueSteelLookAndFeel();
+			//laf = new SubstanceBusinessBlackSteelLookAndFeel();
+
+			UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceBusinessBlueSteelLookAndFeel");
+		} catch (ClassNotFoundException ex) {
+			log.log(Level.SEVERE, null, ex);
+		} catch (InstantiationException ex) {
+			log.log(Level.SEVERE, null, ex);
+		} catch (IllegalAccessException ex) {
+			log.log(Level.SEVERE, null, ex);
+		} catch (UnsupportedLookAndFeelException ex) {
+			log.log(Level.SEVERE, null, ex);
+		}
+
+		java.awt.EventQueue.invokeLater(new Runnable() {
+
+			public void run() {
+				new SuperPostak(ladit, true).setVisible(true);
+			}
+		});
+	}
     // Variables declaration - do not modify//GEN-BEGIN:variables
     private javax.swing.JLabel jLabel1;
