Examples of JPanel


Examples of javax.swing.JPanel

  public JLabel getStatusBarLabel() {
    return mStatusBar.getLabel();
  }

  public void updateToolbar() {
    JPanel contentPane = (JPanel) getContentPane();

    if (mToolBarPanel != null) {
      contentPane.remove(mToolBarPanel);
    }

    mToolBarModel = DefaultToolBarModel.getInstance();
    mToolBar = new ToolBar(mToolBarModel);
    mToolBar.setOpaque(false);

    String location = mToolBar.getToolbarLocation();

    if (Settings.propIsToolbarVisible.getBoolean()) {
      if (mToolBarPanel == null) {
        mToolBarPanel = new JPanel(new BorderLayout()) {
          public void updateUI() {
            super.updateUI();
            setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, getBackground().darker()));
          }
        };
        addContextMenuMouseListener(mToolBarPanel);
        mSearchField = new SearchField();
      } else {
        mToolBarPanel.removeAll();
      }

      if (location.compareTo(BorderLayout.NORTH) == 0) {
        mToolBarPanel.add(MoreButton.wrapToolBar(mToolBar,this), BorderLayout.CENTER);
        if(Settings.propIsSearchFieldVisible.getBoolean()) {
          mToolBarPanel.add(mSearchField, BorderLayout.EAST);
        }
      } else {
        mToolBarPanel.add(MoreButton.wrapToolBar(mToolBar,this), BorderLayout.WEST);
        if(Settings.propIsSearchFieldVisible.getBoolean()) {
          mToolBarPanel.add(mSearchField, BorderLayout.SOUTH);
        }
      }

      contentPane.add(mToolBarPanel, location);
    }

    contentPane.invalidate();
    contentPane.updateUI();
  }
View Full Code Here

Examples of javax.swing.JPanel

   * Creates the settings panel for this tab.
   */
  public JPanel createSettingsPanel() {
    String msg;

    JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.setLayout(new FormLayout("5dlu, fill:150dlu:grow", "pref, 5dlu, pref, 3dlu, pref"));
    mainPanel.setBorder(Borders.DIALOG_BORDER);
   
    CellConstraints cc = new CellConstraints();
   
    mainPanel.add(DefaultComponentFactory.getInstance().createSeparator(mLocalizer.msg("UserDefinedFolders", "User defined folders")), cc.xyw(1,1, 2));
   
    mainPanel.add(UiUtilities.createHelpTextArea(mLocalizer.msg("chooseFolder", "choose folder")), cc.xy(2,3));
   
    msg = mLocalizer.msg("tvdatadir", "TV data folder")+":";
    mCurrentTvDataDir = Settings.propTVDataDirectory.getString();
    mTVDataFolderPanel = new DirectoryChooserPanel(msg, mCurrentTvDataDir, false);
    mainPanel.add(mTVDataFolderPanel, cc.xy(2,5));
   
    return mainPanel;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.