public static void main(String[] args) { try { // myFrame.add(newSubPanel); JTabbedPane tabbedPane = new JTabbedPane(); isSmall = true; // tabbedPane.add(new JButton("asd")); JMenuBar menuBar = new JMenuBar(); // menuBar.add(tabbedPane); menuBar.setBackground(Color.white); menuBar.setVisible(true); menuBar.add(new ResolutionButton()); menuBar.add(new NextPanelbutton(false)); menuBar.add(new NextPanelbutton(true)); // menuBar.setPreferredSize(new Dimension(1024, 20)); UpploaderView u = new UpploaderView(); tabbedPane.addTab("Channel", u); tabbedPane.addTab("Videos", newSubPanel); // menuBar.add(tabbedPane); // tabbedPane.setTabComponentAt(0,menuBar); // myFrame.add(u); // myFrame.add(tabbedPane); // myFrame.setLayout(new FlowLayout()); // Toolkit toolkit = Toolkit.getDefaultToolkit(); // System.out.println(toolkit.getScreenSize().width+"x"+toolkit.getScreenSize().height); myFrame.setSize(1024, 600); myFrame.setJMenuBar(menuBar); myFrame.addWindowListener(new WindowClose()); myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); myFrame.setVisible(true); Dimension panelDim = myFrame.getRootPane().getSize(); // myFrame.add(newSubPanel); for (int i = 0; i < 3; i++) { if (i == 0) { newSubs = new DoublePanelStack(new NewSubVideoPanel(panelDim)); myFrame.add(newSubs.getCurrentPanel()); myFrame.validate(); myFrame.repaint(); } if (StatCol.newsubsStartIndex < StatCol.MAXNEWSUBVIDEOS) newSubs.add(new NewSubVideoPanel(panelDim)); } // u.init(); // sub2 = new NewSubVideoPanel(newSubPanel.init(),panelDim); myFrame.validate(); // myFrame.pack(); } catch (AuthenticationException e) { e.printStackTrace(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (ServiceException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }
public static void prevPanel() { if (currentStack.hasPrev()) { myFrame.remove(currentStack.getCurrentPanel()); myFrame.add(currentStack.getPrev()); currentStack.getCurrentPanel().setVisible(true); myFrame.validate(); myFrame.repaint(); } }