View Javadoc
1   ///usr/bin/env jbang "$0" "$@" ; exit $?
2   //DEPS org.projectlombok:lombok:1.18.28
3   //DEPS com.google.guava:guava:32.1.2-jre
4   //DEPS org.apache.logging.log4j:log4j-core:3.0.0-alpha1
5   //SOURCES **
6   // how to integrate properties - https://github.com/jbangdev/jbang/issues/1665
7   //FILES ../../../../resources/spamprotector.properties
8   //FILES ../../../../resources/spamprotector_en.properties
9   // https://github.com/jbangdev/jbang/issues/1666 - adding as file is not working
10  
11  // #94: including as SOURCE yields compile error as package does not seem to match
12  /*SOURCEs ../../../../resources/Version.java */
13  /* FILES de.aikiit.spamprotector.util.Version.java=../../../../resources/Version.java */
14  
15  /**
16   * SpamSchutz - simple way to protect your mail addresses from naïve spammers
17   * Copyright (C) 2011, Aiki IT
18   * <p>
19   * This program is free software: you can redistribute it and/or modify
20   * it under the terms of the GNU General Public License as published by
21   * the Free Software Foundation, either version 3 of the License, or
22   * (at your option) any later version.
23   * <p>
24   * This program is distributed in the hope that it will be useful,
25   * but WITHOUT ANY WARRANTY; without even the implied warranty of
26   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27   * GNU General Public License for more details.
28   * <p>
29   * You should have received a copy of the GNU General Public License
30   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
31   */
32  
33  
34  package de.aikiit.spamprotector;
35  
36  import lombok.AccessLevel;
37  import lombok.NoArgsConstructor;
38  
39  import javax.swing.*;
40  import java.awt.*;
41  
42  import static de.aikiit.spamprotector.util.LocalizationHelper.getBundleString;
43  
44  /**
45   * Application starter class.
46   */
47  @NoArgsConstructor(access = AccessLevel.PRIVATE)
48  public final class AntiSpamApplication {
49  
50      /**
51       * Helper that starts and initializes the application itself.
52       */
53      private static void initApplication() {
54          SwingUtilities.invokeLater(
55                  () -> {
56                      JFrame frame = new JFrame();
57                      GUI g = new GUI();
58                      frame.setTitle(getBundleString("spamschutz.main.title"));
59                      frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
60                      frame.setSize(new Dimension(800, 300));
61                      frame.add(g);
62                      frame.setVisible(true);
63                  }
64          );
65      }
66  
67      /**
68       * Main method that loads the application in a proper size.
69       *
70       * @param args Arguments from console.
71       */
72      public static void main(final String[] args) {
73          initApplication();
74      }
75  }