Esempio n. 1
0
 private void init() {
   setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
   addWindowListener(
       new WindowAdapter() {
         @Override
         public void windowClosing(final WindowEvent e) {
           cleanExit();
         }
       });
   addWindowStateListener(
       new WindowStateListener() {
         public void windowStateChanged(final WindowEvent arg0) {
           switch (arg0.getID()) {
             case WindowEvent.WINDOW_ICONIFIED:
               lessCpu(true);
               break;
             case WindowEvent.WINDOW_DEICONIFIED:
               lessCpu(false);
               break;
           }
         }
       });
   setIconImage(Configuration.getImage(Configuration.Paths.Resources.ICON));
   JPopupMenu.setDefaultLightWeightPopupEnabled(false);
   WindowUtil.setFrame(this);
   panel = new BotPanel();
   menuBar = new BotMenuBar(this);
   toolBar = new BotToolBar(this, menuBar);
   panel.setFocusTraversalKeys(0, new HashSet<AWTKeyStroke>());
   new BotKeyboardShortcuts(KeyboardFocusManager.getCurrentKeyboardFocusManager(), this, this);
   menuBar.setBot(null);
   setJMenuBar(menuBar);
   textScroll =
       new JScrollPane(
           TextAreaLogHandler.TEXT_AREA,
           ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
           ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
   textScroll.setBorder(null);
   textScroll.setPreferredSize(new Dimension(PANEL_WIDTH, 120));
   textScroll.setVisible(true);
   JScrollPane scrollableBotPanel = new JScrollPane(panel);
   add(toolBar, BorderLayout.NORTH);
   add(scrollableBotPanel, BorderLayout.CENTER);
   add(textScroll, BorderLayout.SOUTH);
 }