Пример #1
0
  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();
    }
  }
Пример #2
0
  public ConnectionForm() {
    setContentPane(contentPane);
    setModal(true);
    getRootPane().setDefaultButton(buttonOK);

    JMenuBar menuBar = new JMenuBar();
    menuBar.setVisible(true);

    JMenu menu = new JMenu("Menu");
    menu.setVisible(true);

    JMenuItem statementItem = new JMenuItem("SQL Insert");
    statementItem.setVisible(true);
    statementItem.addActionListener(new SQLImportActionListener());
    statementItem.setEnabled(false);

    JMenuItem importItem = new JMenuItem("Files Import");
    importItem.setEnabled(false);
    importItem.setVisible(true);

    menu.add(statementItem);
    menu.add(importItem);
    menuBar.add(menu);
    setJMenuBar(menuBar);

    buttonOK.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            JFileChooser fileChooser = new JFileChooser();
            fileChooser.setCurrentDirectory(new File(System.getProperty("user.home")));
            int result = fileChooser.showOpenDialog(getParent());
          }
        });

    dbField.addMouseListener(new DBFileMouseListener(getParent()));
    filesField.addMouseListener(new SQLFilesMouseListener(getParent()));

    // call onCancel() when cross is clicked
    setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            onCancel();
          }
        });

    // call onCancel() on ESCAPE
    contentPane.registerKeyboardAction(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            onCancel();
          }
        },
        KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
        JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
  }
Пример #3
0
  /**
   * Luo käyttöliittymälle ylhäällä näkyvän valikon, jonka kautta voidaan ainakin ladata, tallettaa
   * ja lopettaa peli.
   *
   * @return
   */
  public JMenuBar menubar() {
    // menubar
    JMenuBar menuBar = new JMenuBar();
    JMenu menu = new JMenu("File");
    menuBar.add(menu);

    lisaaMenuItemOptions(menu);
    lisaaMenuItemTallenna(menu);
    lisaaMenuItemLataa(menu);
    lisaaMenuItemLopeta(menu);

    menuBar.setVisible(true);

    return menuBar;
  }
Пример #4
0
 public void showMenuBar() {
   if (!menuBar.isVisible()) {
     menuBar.setVisible(true);
     popupMenu.remove(showMenuBarItem);
   }
 }
Пример #5
0
 public void removeMenuBar() {
   if (menuBar.isVisible()) {
     menuBar.setVisible(false);
     popupMenu.add(showMenuBarItem);
   }
 }
Пример #6
0
 public LMenuBar() {
   comp = new JMenuBar();
   comp.setVisible(true);
 }