Package javax.swing

Examples of javax.swing.JTextArea


    }
   
    private void build() {
        getContentPane().setLayout(Layout.getGBL());

        JTextArea textMessage = ComponentFactory.getTextArea();
        textMessage.setEditable(false);
       
        textMessage.setText(DcResources.getText("msgRestart"));
       
        JScrollPane scrollIn = new JScrollPane(textMessage);
        scrollIn.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
        scrollIn.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
        scrollIn.setPreferredSize(new Dimension(350,50));
        scrollIn.setBorder(null);
       
        JButton buttonYes = ComponentFactory.getButton(DcResources.getText("lblYes"));
        buttonYes.addActionListener(this);
        buttonYes.setActionCommand("restart");

        JButton buttonNo = ComponentFactory.getButton(DcResources.getText("lblNo"));
        buttonNo.addActionListener(this);
        buttonNo.setActionCommand("close");
       
        getContentPane().add(ComponentFactory.getLabel(IconLibrary._icoAbout)
                             Layout.getGBC( 0, 0, 1, 1, 0.0, 0.0
                            ,GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
                             new Insets(5, 5, 5, 5), 0, 0));
        getContentPane().add(scrollIn,      Layout.getGBC( 1, 0, 2, 3, 90.0, 90.0
                            ,GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH,
                             new Insets(5, 5, 5, 5), 0, 0));
       
        JPanel panelActions = new JPanel();
        panelActions.setLayout(new FlowLayout(FlowLayout.RIGHT));
        panelActions.add(buttonNo);
        panelActions.add(buttonYes);
       
        textMessage.setBackground(panelActions.getBackground());
       
        getContentPane().add(panelActions,  Layout.getGBC( 2, 3, 1, 1, 0.0, 0.0
                            ,GridBagConstraints.SOUTHEAST, GridBagConstraints.NONE,
                             new Insets(5, 5, 5, 5), 0, 0));
    }
View Full Code Here


            requestFocus();

            final JPanel pop;
            JPanel pal;
            JTextField tf;
            JTextArea ta;
            pop = PaletteHelper.createVerticalPanel(null);

            if (rt == OMGraphic.RENDERTYPE_LATLON) {
                pal = PaletteHelper.createVerticalPanel(null);
                JComboBox jcb = new JComboBox();
                jcb.addItem("Straight");// indices correspond to
                                        // LineType.java
                jcb.addItem("Rhumb");
                jcb.addItem("Great Circle");
                jcb.setSelectedIndex(type - 1);
                jcb.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        setType((JComboBox) e.getSource());
                    }
                });
                pal.add(jcb);
                pop.add(pal);
                tf = PaletteHelper.createTextEntry("nsegs", "" + nsegs, pop);
                tf.addFocusListener(new FocusAdapter() {
                    public void focusLost(FocusEvent e) {
                        setSegs((JTextField) e.getSource());
                    }
                });
                String entry = "";
                for (int i = 0; i < llpts.length; i += 2) {
                    entry = entry + llpts[i] + " " + llpts[i + 1] + "\n";
                }
                ta = PaletteHelper.createTextArea("llpts", entry, pop, 5, 8);
                ta.addFocusListener(new FocusAdapter() {
                    public void focusLost(FocusEvent e) {
                        setLL((JTextArea) e.getSource());
                    }
                });
            } else {
                if (rt == OMGraphic.RENDERTYPE_OFFSET) {
                    tf = PaletteHelper.createTextEntry("lat",
                            "" + llpts[0],
                            pop);
                    tf.addFocusListener(new FocusAdapter() {
                        public void focusLost(FocusEvent e) {
                            setLLCoordinate((JTextField) e.getSource(), 0);
                        }
                    });
                    tf = PaletteHelper.createTextEntry("lon",
                            "" + llpts[1],
                            pop);
                    tf.addFocusListener(new FocusAdapter() {
                        public void focusLost(FocusEvent e) {
                            setLLCoordinate((JTextField) e.getSource(), 1);
                        }
                    });
                }
                String entry = "";
                for (int i = 0; i < xypts.length; i += 2) {
                    entry = entry + xypts[i] + " " + xypts[i + 1] + "\n";
                }
                ta = PaletteHelper.createTextArea("xypts", entry, pop, 0, 0);
                ta.addFocusListener(new FocusAdapter() {
                    public void focusLost(FocusEvent e) {
                        setXY((JTextArea) e.getSource());
                    }
                });
            }
View Full Code Here

        }

        boolean commit = true;
        if (!session.getWriter().couldEncodeAll()) {
            DefaultFormBuilder builder = new DefaultFormBuilder(new FormLayout("left:pref, 4dlu, fill:pref", ""));
            JTextArea ta = new JTextArea(session.getWriter().getProblemCharacters());
            ta.setEditable(false);
            builder.append(Globals.lang("The chosen encoding '%0' could not encode the following characters: ",
                      session.getEncoding()));
            builder.append(ta);
            builder.append(Globals.lang("What do you want to do?"));
            String tryDiff = Globals.lang("Try different encoding");
View Full Code Here

    show(); // this will block
    return !baos.toString().equals(getText());
  }
 
  protected void createTextArea(){
    ui=new JTextArea(doc);
  }
View Full Code Here

        // Create a window to popup on right click on message column
        // ----------------------------------------------------------
        descWindow = new JWindow(parent);

        descArea = new JTextArea(4, 40);
        descArea.setEditable(false);
        descArea.setLineWrap(true);
        JScrollPane spd = new JScrollPane(descArea,
                JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
View Full Code Here

                 swing_text_area.setForeground(Color.BLACK);
               }
            });
    swt_panel.add(swt_radio_button, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
    swt_radio_button.setName("swt_radio_button");
    swt_text_area = new JTextArea();
    swt_text_area.setBackground(swt_panel.getBackground());
    swt_text_area.setEditable(false);
    swt_text_area.setText("Standard Widget Toolkit - is a native\nplatform independent user interface\nframework\nMore info on http://eclipse.org/swt");
    swt_panel.add(swt_text_area, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    swing_panel = new JPanel();
      GridBagLayout swing_panel_layout = new GridBagLayout();
    swing_panel_layout.columnWidths = new int[] {16, 121, 96, 7};
    swing_panel_layout.rowHeights = new int[] {7};
    swing_panel_layout.columnWeights = new double[] {0.0, 0.0, 0.0, 0.1};
    swing_panel_layout.rowWeights = new double[] {0.1};
    this.add(swing_panel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(20, 0, 20, 10), 0, 0));
    swing_panel.setLayout(swing_panel_layout);
    swing_logo_label = new JLabel();
    swing_logo_label.setIcon(ImgRep.getIcon("wizard/java_logo.jpg"));
    swing_logo_label.setOpaque(true);
    swing_logo_label.setBackground(Color.WHITE);
    swing_panel.add(swing_logo_label, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    swing_logo_label.setName("swing_logo_label");
    swing_radio_button = new JRadioButton("SWING");
    swing_radio_button.addActionListener(new ActionListener() {
               public void actionPerformed(ActionEvent event) {
                 swt_panel.setBackground(new Color(238, 238, 238));
                 swing_panel.setBackground(Color.GRAY);
                
                 swt_radio_button.setBackground(new Color(238, 238, 238));
                 swing_radio_button.setBackground(Color.GRAY);
                
                 swt_text_area.setBackground(new Color(238, 238, 238));
                 swt_text_area.setForeground(Color.BLACK);
                
                 swing_text_area.setBackground(Color.GRAY);
                 swing_text_area.setForeground(Color.WHITE);
               }
              });
    swing_panel.add(swing_radio_button, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
    swing_text_area = new JTextArea();
    swing_text_area.setBackground(swing_panel.getBackground());
    swing_text_area.setEditable(false);
    swing_text_area.setText("Standard Java GUI provided by Sun\nMicrosystems. More info on\nhttp://en.wikipedia.org/wiki/Swing_(Java)");
    swing_panel.add(swing_text_area, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    swing_text_area.setName("swing_text_area");
View Full Code Here

  }
 
  private static int id=0;
 
  private static void addElement(SplitTabPane st, String name, int mode){
    JTextArea ta=new JTextArea(name+id, 5 , 4);
    id++;
    JScrollPane scroller = new JScrollPane(
        JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
        JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    JViewport port = scroller.getViewport();
View Full Code Here

        };
        ButtonGroup bg = new ButtonGroup();
        bg.add(rbRegular);
        bg.add(rbUser);
        lpoints = new JLabel(resources.getString("CouplesOfX,YPoints:"));
        taPoints = new JTextArea();
        taPoints.setText("");
        taPoints.setRows(5);
        JScrollPane jsptaPoints = new JScrollPane(taPoints);
        rbRegular.setSelected(true);
        rbUser.setSelected(false);
View Full Code Here

     myInfoScrollPane = new JScrollPane();
     gridLayout = new GridLayout(1,1);
     serverListTable = new ServerListTable(parent);
     //myInfoTable = new MyInfoTable();
     myInfoTable = new Info();
     serverMessages = new JTextArea();    
     splitPane.setDividerLocation(200);
     splitPane2.setDividerLocation(500);
     this.setLayout(gridLayout);
     splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
     this.add(splitPane);
View Full Code Here

     *
     * @see jsynoptic.builtin.SimpleShape.PropertiesPanel#createContent()
     */
    public JComponent createContent() {
        lpoints = new JLabel(resources.getString("CouplesOfX,YPoints:"));
        taPoints = new JTextArea();
        taPoints.setText("");
        taPoints.setRows(5);
        JScrollPane jscPoints = new JScrollPane(taPoints);
        cbClose = new JCheckBox(resources.getString("CloseLine"), false);
        // Create line panel
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.