Пример #1
0
  private JPanel createWaitingPanel() {
    logger.entry();
    JPanel panel = new JPanel();
    panel.setBorder(BorderFactory.createEmptyBorder(0, 50, 10, 50));
    panel.setOpaque(false);

    panel.add(new JLabel(getLocalized(AUTHORIZE)));

    try {
      BufferedImage myPicture = ImageIO.read(ResourceLoader.getURL(Template.AUTHORIZE));
      JLabel picLabel = new JLabel();
      ImageIcon icon = new ImageIcon(myPicture);
      picLabel.setIcon(icon);
      picLabel.setPreferredSize(new Dimension(PANEL_WIDTH, LIST_HEIGHT));
      panel.add(picLabel);
    } catch (IOException e) {
    }

    nextButton = new ModernButton(getLocalized(NEXT_BUTTON_NAME));
    nextButton.setPreferredSize(new Dimension(PANEL_WIDTH, 30));
    nextButton.addActionListener(
        new ActionListener() {

          @Override
          public void actionPerformed(ActionEvent arg0) {
            requestAccessToken();
          }
        });
    panel.add(nextButton);

    return logger.exit(panel);
  }
Пример #2
0
  private void createView() {
    logger.entry();
    this.setTitle(getLocalized(LOGIN_WINDOW_TITLE));

    this.addWindowListener(
        new WindowAdapter() {
          @Override
          public void windowClosing(WindowEvent arg0) {
            fireNavigationEvent();
          }
        });

    // Set Icon
    try {
      BufferedImage image = ImageIO.read(ResourceLoader.getURL(Template.FAVICON));
      this.setIconImage(image);
    } catch (IOException e) {
      // Nichts tun
    }

    getContentPane().setLayout(new BorderLayout(5, 5));

    navigationPanel = createNavigationPanel();
    navigationPanel.setOpaque(false);
    getContentPane().add(navigationPanel, BorderLayout.NORTH);

    mainPanel = createUniSelectPanel();
    getContentPane().add(mainPanel, BorderLayout.CENTER);

    setPreferredSize(new Dimension(WINDOW_WIDTH, WINDOW_HIGHT));
    getContentPane().setBackground(Color.WHITE);
    setSize(getPreferredSize());
    setResizable(false);

    pack();
    setLocationRelativeTo(null);
    setVisible(true);
    logger.exit();
  }