Package javax.swing

Examples of javax.swing.JTextArea


        log.warn("Not supported yet.");
    }

    public JComponent getControl() {
        log.warn("Not supported yet.");
        return new JScrollPane(new JTextArea());
    }
View Full Code Here


    } catch (IntrospectionException ex) {
      System.err.println("PropertySheet: Couldn't introspect");
      return;
    }

    JTextArea jt = new JTextArea();
    m_HelpText = null;
    // Look for a globalInfo method that returns a string
    // describing the target
    for (int i = 0;i < m_Methods.length; i++) {
      String name = m_Methods[i].getDisplayName();
      Method meth = m_Methods[i].getMethod();
      if (name.equals("globalInfo")) {
  if (meth.getReturnType().equals(String.class)) {
    try {
      Object args[] = { };
      String globalInfo = (String)(meth.invoke(m_Target, args));
            String summary = globalInfo;
            int ci = globalInfo.indexOf('.');
            if (ci != -1) {
              summary = globalInfo.substring(0, ci + 1);
            }
      final String className = targ.getClass().getName();
            m_HelpText = new StringBuffer("NAME\n");
            m_HelpText.append(className).append("\n\n");
            m_HelpText.append("SYNOPSIS\n").append(globalInfo).append("\n\n");
            m_HelpBut = new JButton("More");
      m_HelpBut.setToolTipText("More information about "
                                     + className);
     
      m_HelpBut.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent a) {
                openHelpFrame();
                m_HelpBut.setEnabled(false);
              }
            });

      if (m_Target instanceof CapabilitiesHandler) {
        m_CapabilitiesBut = new JButton("Capabilities");
        m_CapabilitiesBut.setToolTipText("The capabilities of "
      + className);
       
        m_CapabilitiesBut.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent a) {
      openCapabilitiesHelpDialog();
      m_CapabilitiesBut.setEnabled(false);
    }
        });
      }
      else {
        m_CapabilitiesBut = null;
      }

      jt.setColumns(30);
      jt.setFont(new Font("SansSerif", Font.PLAIN,12));
      jt.setEditable(false);
      jt.setLineWrap(true);
      jt.setWrapStyleWord(true);
      jt.setText(summary);
            jt.setBackground(getBackground());
      JPanel jp = new JPanel();
      jp.setBorder(BorderFactory.createCompoundBorder(
       BorderFactory.createTitledBorder("About"),
       BorderFactory.createEmptyBorder(5, 5, 5, 5)
     ));
View Full Code Here

  /**
   * opens the help dialog.
   */
  protected void openHelpFrame() {

    JTextArea ta = new JTextArea();
    ta.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    ta.setLineWrap(true);
    ta.setWrapStyleWord(true);
    //ta.setBackground(getBackground());
    ta.setEditable(false);
    ta.setText(m_HelpText.toString());
    ta.setCaretPosition(0);
    JDialog jdtmp;
    if (PropertyDialog.getParentDialog(this) != null)
      jdtmp = new JDialog(PropertyDialog.getParentDialog(this), "Information");
    else
      jdtmp = new JDialog(PropertyDialog.getParentFrame(this), "Information");
View Full Code Here

    protected void initialize() {
      setTitle("Information about Capabilities");

      m_Self = this;
     
      m_CapabilitiesText = new JTextArea();
      m_CapabilitiesText.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
      m_CapabilitiesText.setLineWrap(true);
      m_CapabilitiesText.setWrapStyleWord(true);
      m_CapabilitiesText.setEditable(false);
      updateText();
View Full Code Here

   */
  protected void showGeneratedInstances(String data) {
    final JDialog dialog = new JDialog();
    final JButton saveButton = new JButton("Save");
    final JButton closeButton = new JButton("Close");
    final JTextArea textData = new JTextArea(data);
    final JPanel panel = new JPanel();
    panel.setLayout(new FlowLayout(FlowLayout.RIGHT));
    textData.setEditable(false);
    textData.setFont(
        new Font("Monospaced", Font.PLAIN, textData.getFont().getSize()));

    saveButton.setMnemonic('S');
    saveButton.setToolTipText("Saves the output to a file");
    saveButton.addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent evt){
        JFileChooser filechooser = new JFileChooser();
        int result = filechooser.showSaveDialog(dialog);
        if (result == JFileChooser.APPROVE_OPTION) {
          try {
            BufferedWriter writer = new BufferedWriter(
                                      new FileWriter(
                                        filechooser.getSelectedFile()));
            writer.write(textData.getText());
            writer.flush();
            writer.close();
            JOptionPane.showMessageDialog(
              dialog,
              "Output successfully saved to file '"
View Full Code Here

    mSettingsPanel = new JPanel(new BorderLayout());

    mSettingsPanel.add(UiUtilities.createHelpTextArea(mLocalizer.msg("desc",
        "help-text")), BorderLayout.NORTH);

    mTextInput = new JTextArea(mText);
    JScrollPane scrollPane = new JScrollPane(mTextInput);
    LineNumberHeader header = new LineNumberHeader(mTextInput);
    scrollPane.setRowHeaderView(header);

    mSettingsPanel.add(scrollPane, BorderLayout.CENTER);
View Full Code Here

    // TODO Auto-generated method stub

  }

  private void showInfoTextMessage(String header, String infoText, int width) {
    JTextArea textArea = new JTextArea(infoText);
    textArea.setEditable(false);
    textArea.setLineWrap(true);
    textArea.setWrapStyleWord(true);

    JScrollPane scrollPane = new JScrollPane(textArea);

    scrollPane.setPreferredSize(new Dimension(width,150));
View Full Code Here

    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));
View Full Code Here

  }

  public JPanel getSettingsPanel() {

    JPanel content = new JPanel(new BorderLayout(0, 7));
    JTextArea ta = new JTextArea(mLocalizer.msg("desc",
        "Accept all programs marked by plugin:"));
    ta.setLineWrap(true);
    ta.setWrapStyleWord(true);
    ta.setOpaque(false);
    ta.setEditable(false);
    ta.setFocusable(false);
    content.add(ta, BorderLayout.NORTH);

    PluginProxy[] plugins = PluginProxyManager.getInstance()
        .getActivatedPlugins();
    Arrays.sort(plugins, new PluginProxy.Comparator());
View Full Code Here

  private void setUpResultHistory() {
    java.awt.GraphicsEnvironment ge =
      java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment();
    if(!ge.isHeadless()) {
      if (m_outText == null) {
        m_outText = new JTextArea(20, 80);
        m_history = new ResultHistoryPanel(m_outText);
      }
      m_outText.setEditable(false);
      m_outText.setFont(new Font("Monospaced", Font.PLAIN, 12));
      m_outText.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
View Full Code Here

TOP

Related Classes of javax.swing.JTextArea

Copyright © 2018 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.