public MainScreen() { Eve.setLayout( new MigLayout( "wrap 2", "[0:0, grow 50, fill][0:0, grow 50, fill]", "[pref!][grow, fill]")); quick.addActionListener( (ActionEvent e) -> { DraftScreen draft = new DraftScreen(null, this); draft.Switch(); }); viewAll.addActionListener( (ActionEvent e) -> { called = new BrowseScreen(this); called.Switch(); }); manageTeams.addActionListener( (ActionEvent e) -> { called = new ManageScreen("team", this); called.Switch(); }); managePlayers.addActionListener( (ActionEvent e) -> { called = new ManageScreen("player", this); called.Switch(); }); teams.setBorder(BorderFactory.createLineBorder(Color.black)); players.setBorder(BorderFactory.createLineBorder(Color.black)); teamScroll.setBorder(BorderFactory.createEmptyBorder()); teamScroll.getVerticalScrollBar().setUnitIncrement(16); teamScroll.setHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_NEVER); playerScroll.setBorder(BorderFactory.createEmptyBorder()); playerScroll.getVerticalScrollBar().setUnitIncrement(16); playerScroll.setHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_NEVER); this.drawScreen(); Adam.setMinimumSize(windowSize); Adam.setLocationRelativeTo(null); Adam.setVisible(true); }
@Override void refresh() { Adam.revalidate(); Adam.setMinimumSize(windowSize); Adam.setSize(windowSize); Adam.repaint(); }
@Override void Switch() { Adam.remove(caller.Eve); Adam.add(Eve); Adam.revalidate(); Adam.setMinimumSize(windowSize); Adam.repaint(); }
@Override void Return() { Adam.remove(called.Eve); Adam.add(Eve); Adam.revalidate(); Adam.setMinimumSize(windowSize); Adam.repaint(); }