Package javax.swing

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


      final JDialog info = new JDialog(UiUtilities.getLastModalChildOf(this));
      info.setModal(true);
      info.setUndecorated(true);
      info.toFront();

      JPanel main = new JPanel(new FormLayout("5dlu,pref,5dlu","5dlu,pref,5dlu"));
      main.setBorder(BorderFactory.createLineBorder(Color.black));
      main.add(new JLabel(mLocalizer.msg("downloadinfo","A data update is running. TV-Browser will be closed when the update is done.")), new CellConstraints().xy(2,2));

      info.setContentPane(main);
      info.pack();
      info.setLocationRelativeTo(this);
View Full Code Here

   *
   * @param visible
   *          true if Statusbar should be visible
   */
  public void setShowStatusbar(boolean visible) {
    JPanel contentPane = (JPanel) getContentPane();

    Settings.propIsStatusbarVisible.setBoolean(visible);

    if (visible && !contentPane.isAncestorOf(mStatusBar)) {
      jcontentPane.add(mStatusBar, BorderLayout.SOUTH);
    } else if (contentPane.isAncestorOf(mStatusBar)) {
      jcontentPane.remove(mStatusBar);
    }

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

  /**
   * Create the GUI
   */
  private void createDialog() {
    JPanel panel = (JPanel) getContentPane();

    UiUtilities.registerForClosing(this);
   
    panel.setLayout(new FormLayout("default, 3dlu, fill:default:grow",
    "default, 3dlu, default, 3dlu, default, 3dlu, default, 3dlu, default, 3dlu, default, 3dlu, default, 5dlu, default, 3dlu, default, 3dlu:grow, default, 5dlu, default"));

    CellConstraints cc = new CellConstraints();

    panel.setBorder(Borders.DLU4_BORDER);

    // name
    panel.add(new JLabel(mLocalizer.msg("channelName", "Channel Name:")), cc.xy(1, 1));
    mChannelName = new JTextField(mChannel.getName());
    panel.add(mChannelName, cc.xy(3, 1));

    // provider
    panel.add(new JLabel(mLocalizer.msg("provider", "Provided by:")), cc.xy(1, 3));
    panel.add(new JLabel(ChannelUtil.getProviderName(mChannel)), cc.xy(3, 3));

    // logo
    panel.add(new JLabel(mLocalizer.msg("channelLogo", "Channel Logo:")), cc.xy(1, 5));
    if (mChannel.getUserIconFileName() != null) {
      mIconFile = new File(mChannel.getUserIconFileName());
    }
   
    mIconLabel = new JLabel(createUserIcon());
    mChangeIcon = new JButton(mLocalizer.msg("useIcon", "Select channel icon"));
    mChangeIcon.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        changeIcon();
      }
    });

    panel.add(mIconLabel, cc.xy(3, 5));
    panel.add(mChangeIcon, cc.xy(3, 7));

    // URL
    panel.add(new JLabel(mLocalizer.msg("webAddress", "Web Address:")), cc.xy(1, 9));
    mWebPage =new JTextField(mChannel.getWebpage());
    panel.add(mWebPage, cc.xy(3, 9));

    // time correction
    panel.add(new JLabel(mLocalizer.msg("time", "Time zone correction:")), cc.xy(1, 11));
    mCorrectionCB = new JComboBox(new String[] { "-1:00", "-0:45", "-0:30", "-0:15", "0:00", "+0:15", "+0:30", "+0:45", "+1:00" });
    mCorrectionCB.setSelectedIndex(mChannel.getTimeZoneCorrectionMinutes() / 15 + 4);
    panel.add(mCorrectionCB, cc.xy(3, 11));

    JTextArea txt = UiUtilities.createHelpTextArea(mLocalizer.msg("DLSTNote", ""));
    // Hack because of growing JTextArea in FormLayout
    txt.setMinimumSize(new Dimension(150, 20));
    panel.add(txt, cc.xy(3, 13));

    // time limitation
    panel.add(DefaultComponentFactory.getInstance().createLabel(mLocalizer.msg("timeLimits","Time limits:")), cc.xy(1,15));
   
    String timePattern = mLocalizer.msg("timePattern", "hh:mm a");
       
    mStartTimeLimit = new JSpinner(new SpinnerDateModel());
    mStartTimeLimit.setEditor(new JSpinner.DateEditor(mStartTimeLimit, timePattern));
    setTimeDate(mStartTimeLimit, mChannel.getStartTimeLimit());

    mEndTimeLimit = new JSpinner(new SpinnerDateModel());
    mEndTimeLimit.setEditor(new JSpinner.DateEditor(mEndTimeLimit, timePattern));
    setTimeDate(mEndTimeLimit, mChannel.getEndTimeLimit());
       
    ((JSpinner.DateEditor)mStartTimeLimit.getEditor()).getTextField().setHorizontalAlignment(SwingConstants.LEFT);
    ((JSpinner.DateEditor)mEndTimeLimit.getEditor()).getTextField().setHorizontalAlignment(SwingConstants.LEFT);
   
    CaretPositionCorrector.createCorrector(((JSpinner.DateEditor)mStartTimeLimit.getEditor()).getTextField(), new char[] {':'}, -1);
    CaretPositionCorrector.createCorrector(((JSpinner.DateEditor)mEndTimeLimit.getEditor()).getTextField(), new char[] {':'}, -1);
   
    PanelBuilder timeLimitPanel = new PanelBuilder(new FormLayout("default:grow,10dlu,default:grow","default,2dlu,default"));
   
    timeLimitPanel.addLabel(mLocalizer.msg("startTime","Start time:"), cc.xy(1,1));
    timeLimitPanel.addLabel(mLocalizer.msg("endTime","End time:"), cc.xy(3,1));
    timeLimitPanel.add(mStartTimeLimit, cc.xy(1,3));
    timeLimitPanel.add(mEndTimeLimit, cc.xy(3,3));
   
    panel.add(timeLimitPanel.getPanel(), cc.xy(3,15));
   
    JTextArea txt2 = UiUtilities.createHelpTextArea(mLocalizer.msg("DLSTNote", ""));
    // Hack because of growing JTextArea in FormLayout
    txt2.setMinimumSize(new Dimension(150, 20));
    panel.add(txt2, cc.xy(3, 17));
   
    // buttons
    ButtonBarBuilder2 builder = new ButtonBarBuilder2();
    JButton defaultButton = new JButton(Localizer.getLocalization(Localizer.I18N_DEFAULT));
   
    defaultButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        resetToDefaults();
      }

    });
   
    builder.addButton(defaultButton);
    builder.addRelatedGap();
    builder.addGlue();

    mOKBt = new JButton(Localizer.getLocalization(Localizer.I18N_OK));
    mOKBt.addActionListener(this);
   
    getRootPane().setDefaultButton(mOKBt);
   
    mCloseBt = new JButton(Localizer.getLocalization(Localizer.I18N_CANCEL));
    mCloseBt.addActionListener(this);

    builder.addButton(new JButton[] { mOKBt, mCloseBt });

    panel.add(new JSeparator(), cc.xyw(1, 19, 3));
    panel.add(builder.getPanel(), cc.xyw(1, 21, 3));
   
    pack();
    Settings.layoutWindow("channelConfig", this, new Dimension(420,350));
  }
View Full Code Here

    // no settings
  }

  @Override
  public JPanel getSettingsPanel() {
    JPanel p1 = new JPanel();
    p1.add(new JLabel(mLocalizer.msg("desc",
        "Accepts only the first occurrence of several programs with similar titles.")));
    return p1;
  }
View Full Code Here

      mScript = null;
    }
  }

  public JPanel getSettingsPanel() {
    JPanel content = new JPanel(new BorderLayout());

    mScriptEditor = new BeanShellEditor();
    mScriptEditor.setText(mScriptSource);

    JScrollPane scrollPane = new JScrollPane(mScriptEditor);
    scrollPane.setBackground(Color.WHITE);
    LineNumberHeader header = new LineNumberHeader(mScriptEditor);
    scrollPane.setRowHeaderView(header);

    content.add(scrollPane, BorderLayout.CENTER);

    JPanel buttonp = new JPanel(new FlowLayout(FlowLayout.RIGHT));

    JButton test = new JButton(mLocalizer.msg("testScript", "Test Script"));

    test.addActionListener(new ActionListener() {

      public void actionPerformed(ActionEvent arg0) {
        testScript();
      }

    });

    buttonp.add(test);

    content.add(buttonp, BorderLayout.SOUTH);

    return content;
  }
View Full Code Here

      mItemSelected = new JCheckBox();
      mItemSelected.setOpaque(false);
      mSelectionWidth = mItemSelected.getPreferredSize().width;

      mItemLabel = new JLabel();
      mItemPanel = new JPanel(new BorderLayout());
      mItemPanel.add(mItemSelected, BorderLayout.WEST);
      mItemPanel.add(mItemLabel, BorderLayout.CENTER);
    }
View Full Code Here

      pb.add(mConfigurations, cc.xy(2,3));

      FormLayout layout = new FormLayout("default,5dlu,default,5dlu,default","pref");
      layout.setColumnGroups(new int[][] {{1,3,5}});

      JPanel buttonPanel = new JPanel(layout);

      mAdd = new JButton(Localizer.getLocalization(Localizer.I18N_ADD));
      mAdd.setIcon(TVBrowserIcons.newIcon(TVBrowserIcons.SIZE_SMALL));
      mAdd.addActionListener(this);

      mEdit = new JButton(Localizer.getLocalization(Localizer.I18N_EDIT));
      mEdit.setIcon(TVBrowserIcons.edit(TVBrowserIcons.SIZE_SMALL));
      mEdit.setEnabled(false);
      mEdit.addActionListener(this);

      mDelete = new JButton(Localizer.getLocalization(Localizer.I18N_DELETE));
      mDelete.setIcon(TVBrowserIcons.delete(TVBrowserIcons.SIZE_SMALL));
      mDelete.setEnabled(false);
      mDelete.addActionListener(this);

      buttonPanel.add(mAdd, cc.xy(1,1));
      buttonPanel.add(mEdit, cc.xy(3,1));
      buttonPanel.add(mDelete, cc.xy(5,1));

      pb.add(buttonPanel, cc.xy(2,5));
      pb.addLabel(mLocalizer.msg("help","<html>This list of formating can be used by several plugins. So a formating don't have to be entered in every plugin that should use the formating. The selection of the formating can be done in the settings of the plugin.</html>"), cc.xy(2,7));

      mConfigurations.getList().addListSelectionListener(new ListSelectionListener() {
View Full Code Here

   * Erzeugt das Settings-Panel
   *
   * @see tvbrowser.core.filters.FilterComponent#getSettingsPanel()
   */
  public JPanel getSettingsPanel() {
    final JPanel panel = new JPanel();
   
    mMin = Math.min(1000,Math.max(0,mMin));
    mMax = Math.min(1000,Math.max(1,mMax));

    mMinSpinner = new JSpinner(new SpinnerNumberModel(mMin, 0, 1000, 1));
    mMaxSpinner = new JSpinner(new SpinnerNumberModel(mMax, 1, 1000, 1));
    mMinCheck = new JCheckBox(mLocalizer.msg("minimum", "minimum in Minutes")
        + ":", mUseMin);
    mMaxCheck = new JCheckBox(mLocalizer.msg("maximum", "maximum in Minutes")
        + ":", mUseMax);

    if (!mUseMin) {
      mMinSpinner.setEnabled(false);
    }

    if (!mUseMax) {
      mMaxSpinner.setEnabled(false);
    }

    mMinCheck.addActionListener(new ActionListener() {
      public void actionPerformed(final ActionEvent e) {
        mMinSpinner.setEnabled(mMinCheck.isSelected());
      }
    });
    mMaxCheck.addActionListener(new ActionListener() {
      public void actionPerformed(final ActionEvent e) {
        mMaxSpinner.setEnabled(mMaxCheck.isSelected());
      }
    });

    panel.setLayout(new GridBagLayout());

    final GridBagConstraints a = new GridBagConstraints();
    a.gridwidth = GridBagConstraints.REMAINDER;
    a.fill = GridBagConstraints.NONE;

    final GridBagConstraints b = new GridBagConstraints();
    b.fill = GridBagConstraints.NONE;

    mMinSpinner.setEditor(new JSpinner.NumberEditor(mMinSpinner, "###0"));
    mMaxSpinner.setEditor(new JSpinner.NumberEditor(mMaxSpinner, "###0"));

    panel.add(mMinCheck, b);
    panel.add(mMinSpinner, a);

    panel.add(mMaxCheck, b);
    panel.add(mMaxSpinner, a);

    final JPanel centerPanel = new JPanel(new BorderLayout());
    centerPanel.add(panel, BorderLayout.NORTH);
    return centerPanel;
  }
View Full Code Here

      moreToolbar.setRollover(true);
      moreToolbar.setFloatable(false);
      moreToolbar.add(new MoreButton(toolbar,mainFrame));
      addMouseAdapter(moreToolbar);

        JPanel panel = new JPanel(new BorderLayout(0,0));

        panel.add(toolbar, BorderLayout.CENTER);

        if (toolbar.getToolbarLocation().compareTo(BorderLayout.NORTH) == 0) {
          moreToolbar.setBorder(BorderFactory.createEmptyBorder(0,0,0,5));
          panel.add(moreToolbar, BorderLayout.EAST);
        }
        else {
          moreToolbar.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));
          panel.add(moreToolbar, BorderLayout.SOUTH);
        }

        return panel;
    }
View Full Code Here

TOP

Related Classes of javax.swing.JPanel

Copyright © 2015 www.massapicom. 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.