View Javadoc
1   /**
2    SpamSchutz - simple way to protect your mail adresses from naiive spammers
3    Copyright (C) 2011, Aiki IT
4   
5    This program is free software: you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation, either version 3 of the License, or
8    (at your option) any later version.
9   
10   This program is distributed in the hope that it will be useful,
11   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   GNU General Public License for more details.
14  
15   You should have received a copy of the GNU General Public License
16   along with this program.  If not, see <http://www.gnu.org/licenses/>.
17   */
18  
19  package de.aikiit.spamprotector;
20  import lombok.AccessLevel;
21  import lombok.NoArgsConstructor;
22  
23  import javax.swing.*;
24  import java.awt.*;
25  
26  import static de.aikiit.spamprotector.util.LocalizationHelper.getBundleString;
27  /**
28   * Application starter class.
29   *
30   * @author hirsch
31   * @version 2011-04-29, 01:51
32   */
33  @NoArgsConstructor(access = AccessLevel.PRIVATE)
34  public final class AntiSpamApplication {
35  
36      /**
37       * Helper that starts and initializes the application itself.
38       */
39      private static void initApplication() {
40          SwingUtilities.invokeLater(
41                  () -> {
42                      JFrame frame = new JFrame();
43                      GUI g = new GUI(false);
44                      frame.setTitle(getBundleString("spamschutz.main.title"));
45                      frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
46                      frame.setSize(new Dimension(800, 300));
47                      frame.add(g);
48                      frame.setVisible(true);
49                  }
50          );
51      }
52  
53      /**
54       * Main method that loads the application in a proper size.
55       *
56       * @param args Arguments from console.
57       */
58      public static void main(final String[] args) {
59          initApplication();
60      }
61  }