コード例 #1
0
ファイル: AppFrame.java プロジェクト: midnightcreepa/sockso
  /** the panel across the bottom of the window */
  private JPanel getBottomPane() {

    final JButton exit =
        new JButton(
            locale.getString("gui.label.exit"), new ImageIcon(r.getImage("icons/22x22/exit.png")));
    exit.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            AppFrame.this.exit();
          }
        });

    final JButton hide =
        new JButton(
            locale.getString("gui.label.hide"), new ImageIcon(r.getImage("icons/22x22/hide.png")));
    hide.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            AppFrame.this.setVisible(false);
          }
        });

    final JButton console =
        new JButton(
            locale.getString("gui.label.showConsoleWindow"),
            new ImageIcon(r.getImage("icons/22x22/console.png")));
    console.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            if (consoleFrame == null) {
              consoleFrame = injector.getInstance(ConsoleFrame.class);
              consoleFrame.setBounds(100, 100, 600, 500);
            }
            consoleFrame.setVisible(true);
          }
        });

    // in admin mode we won't have a server
    if (sv != null) {
      urlLabel.setText(locale.getString("gui.label.gettingIPAddress"));
      urlLabel.addMouseListener(injector.getInstance(UrlLabelMouseAdapter.class));
      urlLabel.setToolTipText("Click to open Sockso in your browser.");
      updateUrlLabel();
    }

    final JPanel buttons = new JPanel();
    buttons.setLayout(new FlowLayout(FlowLayout.RIGHT));
    buttons.add(console);
    buttons.add(exit);
    if (tray.isActive()) buttons.add(hide);

    final JPanel panel = new JPanel(new BorderLayout());
    panel.add(buttons, BorderLayout.EAST);
    panel.add(urlLabel, BorderLayout.WEST);

    return panel;
  }
コード例 #2
0
ファイル: AppFrame.java プロジェクト: midnightcreepa/sockso
  public void open() {

    initComponents();
    layoutComponents();

    // check to see if we should start minimized or not
    boolean setVisible = true;
    if (tray.isActive() && p.get(Constants.APP_START_MINIMIZED).equals(Properties.YES))
      setVisible = false;
    setVisible(setVisible);
  }