public FriendsListView() { super(); this.setTitle(friendsListViewMessages.getString("friends")); this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); this.setSize(400, 800); this.setLayout(new BorderLayout()); JSplitPane splitter = new JSplitPane(); splitter.setResizeWeight(0.5); JPanel topPanel = new JPanel(new BorderLayout()); topPanel.add(new LocalizedJLabel(friendsListViewMessages, "online"), BorderLayout.NORTH); this.onlineList = new JList<RosterEntry>(); this.onlineList.setCellRenderer(new FriendListItemRenderer()); topPanel.add(new JScrollPane(this.onlineList), BorderLayout.CENTER); JPanel bottomPanel = new JPanel(new BorderLayout()); bottomPanel.add(new LocalizedJLabel(friendsListViewMessages, "offline"), BorderLayout.NORTH); this.offlineList = new JList<RosterEntry>(); this.offlineList.setCellRenderer(new FriendListItemRenderer()); bottomPanel.add(new JScrollPane(this.offlineList), BorderLayout.CENTER); splitter.setTopComponent(topPanel); splitter.setBottomComponent(bottomPanel); this.add(splitter, BorderLayout.CENTER); JPanel presencePanel = new JPanel(new GridLayout(2, 1)); presenceComboBox = new JComboBox<Status>(); presenceComboBox.setModel(new StatusComboBoxModel()); presenceComboBox.setRenderer(new StatusComboBoxRenderer()); presencePanel.add(presenceComboBox); presenceStatusField = new JTextField(); presencePanel.add(presenceStatusField); this.add(presencePanel, BorderLayout.SOUTH); this.setVisible(true); }
public ProfileView() { super(); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setLayout(new BorderLayout()); setTitle("Profile"); JPanel topPanel = new JPanel(new BorderLayout()); summonerNameLabel = new LocalizedJLabel(); summonerNameLabel.setFont(FontUtils.emSize(summonerNameLabel.getFont(), 2.0)); topPanel.add(summonerNameLabel, BorderLayout.WEST); JPanel searchPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); searchField = new JTextField(15); searchPanel.add(searchField); searchButton = new LocalizedJButton(profileViewMessages, "search"); searchPanel.add(searchButton); topPanel.add(searchPanel, BorderLayout.EAST); add(topPanel, BorderLayout.NORTH); JTabbedPane tabPane = new JTabbedPane(); JPanel recentGamesTabPanel = new JPanel(new BorderLayout()); JPanel westPanel = new JPanel(new BorderLayout()); JPanel recentMatchesPanel = new JPanel(new BorderLayout()); recentMatchesList = new JList<RecentGame>(); recentMatchesList.setCellRenderer(new RecentGameListItemRenderer()); DefaultListModel<RecentGame> temp = new DefaultListModel<RecentGame>(); recentMatchesList.setModel(temp); gamesNumber = new LocalizedJLabel(); westPanel.add(gamesNumber, BorderLayout.NORTH); westPanel.add(new JScrollPane(recentMatchesList), BorderLayout.CENTER); recentMatchesPanel.add(westPanel, BorderLayout.WEST); gameInfo = new JPanel(new BorderLayout()); JPanel topGamePanel = new JPanel(new BorderLayout()); JPanel championAndName = new JPanel(new FlowLayout()); currentGameChampion = new ChampionBox(); championAndName.add(currentGameChampion); currentGameChampionName = new LocalizedJLabel(); championAndName.add(currentGameChampionName); topGamePanel.add(championAndName, BorderLayout.NORTH); itemsPanel = new JPanel(new FlowLayout()); item1Label = new ItemImageLabel(); itemsPanel.add(item1Label); item2Label = new ItemImageLabel(); itemsPanel.add(item2Label); item3Label = new ItemImageLabel(); itemsPanel.add(item3Label); item4Label = new ItemImageLabel(); itemsPanel.add(item4Label); item5Label = new ItemImageLabel(); itemsPanel.add(item5Label); item6Label = new ItemImageLabel(); itemsPanel.add(item6Label); topGamePanel.add(itemsPanel, BorderLayout.CENTER); gameInfo.add(topGamePanel, BorderLayout.NORTH); statsPanel = new JPanel(new GridLayout(0, 2)); gameInfo.add(new VerticalJScrollPane(statsPanel), BorderLayout.CENTER); recentMatchesPanel.add(gameInfo, BorderLayout.CENTER); recentGamesTabPanel.add(recentMatchesPanel); tabPane.addTab(profileViewMessages.getString("recent games"), recentGamesTabPanel); leaguesTabPane = new JTabbedPane(); tabPane.addTab(profileViewMessages.getString("leagues"), leaguesTabPane); JPanel runesPanel = new JPanel(new BorderLayout()); runesTable = new JTable(); runesPanel.add(new VerticalJScrollPane(runesTable), BorderLayout.WEST); runePagesTabPane = new JTabbedPane(); runesPanel.add(runePagesTabPane, BorderLayout.CENTER); tabPane.add(profileViewMessages.getString("runes"), runesPanel); add(tabPane, BorderLayout.CENTER); setSize(600, 500); setVisible(true); }
public void setAmountObject(Object[] messageArguments) { gamesNumber.setText(profileViewMessages.getComplexString("games_amount", messageArguments)); }