Package java.awt

Examples of java.awt.TextArea$TextScrollable


            panel.add("North", inputPanel);
         }

         {  // TextArea to show query results
            queryOutput = new TextArea();
            queryOutput.setEditable(false);

            panel.add("South", queryOutput);
         }

         gbc.gridx=offset; gbc.gridy=1; gbc.gridwidth=3; gbc.gridheight=1;
         add(panel, gbc);
      }


      // Checkboxes for log levels
      gbc.gridx=0; gbc.gridy=2; gbc.gridwidth=1; gbc.gridheight=1;
      add(new Label("Choose Logging Level: "), gbc);
      gbc.gridx=1; gbc.gridwidth=3; gbc.gridheight=1;
      add(createLogLevelBoxes(), gbc);


      // Clear logging output - Button
      clearLogButton = new Button("Clear Log Window");
      class ClearListener implements ActionListener {
         public void actionPerformed(ActionEvent e) {
            logOutput.setText("");
         }
      }
      clearLogButton.addActionListener(new ClearListener());
      gbc.gridx=4; gbc.gridy=2; gbc.gridwidth=1; gbc.gridheight=1;
      gbc.weightx = gbc.weighty = 0.0;
      add(clearLogButton, gbc);


      // Dump internal state - Button
      dumpButton = new Button("Dump State");
      class DumpListener implements ActionListener {
         public void actionPerformed(ActionEvent e) {
            // logOutput.setText("");  // clear log window
            try {
               log.info("Dump start");
               I_Authenticate auth = xmlBlasterMain.getAuthenticate();
               StringBuffer buf = new StringBuffer(auth.toXml());
               buf.append(xmlBlasterMain.getXmlBlaster().toXml());
               LogRecord record = new LogRecord(Level.INFO, buf.toString());
               log(record);
               log.info("Dump end");
            }
            catch(XmlBlasterException ee) {
               log.severe("Sorry, dump failed: " + ee.getMessage());
            }
         }
      }
      dumpButton.addActionListener(new DumpListener());
      gbc.gridx=5; gbc.gridy=2; gbc.gridwidth=1; gbc.gridheight=1;
      gbc.weightx = gbc.weighty = 0.0;
      add(dumpButton, gbc);


      // TextArea for log outputs
      gbc.gridx=0; gbc.gridy=3; gbc.gridwidth=6; gbc.gridheight=6;
      gbc.weightx = gbc.weighty = 1.0;
      logOutput = new TextArea("", 30, 100); // set rows here (width 100 is ignored)
      logOutput.setEditable(false);
      add(logOutput, gbc);

      pack();
View Full Code Here


      this.applet = this;
      System.out.println("HelloWorld3: Applet.init() called");
      try {
         setBackground(Color.white);
         setForeground(Color.black);
         this.textArea = new TextArea("", 12, 60);
         this.textArea.setBackground(Color.white);
         this.textArea.setForeground(Color.black);
         add(this.textArea);
         repaint();
      }
View Full Code Here

      add(this.connectButton);
      this.sendButton = new Button("Send");
      this.sendButton.setActionCommand("send");
      this.sendButton.addActionListener(this);
      add(this.sendButton);
      this.requestArea = new TextArea("", 9, 62);
      this.requestArea.setBackground(Color.white);
      this.requestArea.setForeground(Color.black);
      // add an example request
      this.requestArea.setText("<xmlBlaster>\n" +
                               "  <get>\n" +
                               "    <key queryType='XPATH'>\n" +
                               "      /xmlBlaster/key\n" +
                               "    </key>\n" +
                               "  </get>\n" +
                               "</xmlBlaster>\n" +
                               "<!-- See http://www.xmlblaster.org/xmlBlaster/doc/requirements/client.script.html -->");
      add(this.requestArea);
      this.textArea = new TextArea("", 24, 80);
      this.textArea.setBackground(Color.white);
      this.textArea.setForeground(Color.black);
      add(this.textArea);
      repaint();
   }
View Full Code Here

      this.runAsApplet = true;
      print("Applet.init() called");
      try {
         setBackground(Color.white);
         setForeground(Color.black);
         this.textArea = new TextArea("", 12, 60);
         this.textArea.setBackground(Color.white);
         this.textArea.setForeground(Color.black);
         add(this.textArea);
         repaint();
View Full Code Here

   */
  public final static void showText(java.net.URL url) {
    try {
      Reader st        = new InputStreamReader(url.openStream());
      int ch;
      TextArea mp      = new TextArea();
      ch = st.read();
      while (ch != -1) {
        char[] cbuf  = new char[1];
        cbuf[0] = (char) ch;
        mp.append(new String(cbuf));
        ch = st.read();
      }
      final Frame top  = new Frame("Show URL");
      top.addWindowListener(
        new WindowAdapter() {
View Full Code Here

   *  Called when a url is improperly accessed. Pops up a window the hard way.
   *
   * @param  url  url which we do not have authorization for.
   */
  public void urlAccessViolation(String url) {
    TextArea mp      = new TextArea("Bad URL\n" +
        "There was a security exception accessing the url\n" + url +
        "\nremember, applets can only load urls from the same server");
    final Frame top  = new Frame("Bad URL");
    top.addWindowListener(
      new WindowAdapter() {
View Full Code Here

   */
  public void showText(java.net.URL url) {
    try {
      Reader st        = new InputStreamReader(url.openStream());
      int ch;
      TextArea mp      = new TextArea();
      ch = st.read();
      while (ch != -1) {
        char[] cbuf  = new char[1];
        cbuf[0] = (char) ch;
        mp.append(new String(cbuf));
        ch = st.read();
      }
      final Frame top  = new Frame("Show URL");
      top.addWindowListener(
        new WindowAdapter() {
View Full Code Here

            try {
                deleteMethod = StringBuffer.class.getMethod("delete", new Class[] { int.class, int.class }); //$NON-NLS-1$
            } catch (Throwable t) {
            }
            textArea = new TextArea();
            textArea.setEditable(false);
            textArea.setBackground(Color.white);
            textArea.setForeground(Color.black);
            Panel panel = new Panel(new BorderLayout());
            panel.setBackground(Color.gray);
View Full Code Here

        pCommand.setLayout(new BorderLayout());
        pResult.setLayout(new BorderLayout());

        Font fFont = new Font("Dialog", Font.PLAIN, 12);

        txtCommand = new TextArea(5, 40);

        txtCommand.addKeyListener(this);

        txtResult = new TextArea(20, 40);

        txtCommand.setFont(fFont);
        txtResult.setFont(new Font("Courier", Font.PLAIN, 12));

        butExecute = new Button("Execute");
View Full Code Here

  static boolean  _useProxies    = false;

  private static void showFile(String file)
  {
    // Create a TextArea to display the contents of the file in
    TextArea textarea = new TextArea("", 24, 80);
    textarea.setEditable(false);
    final JFrame frame = new JFrame();
    frame.setSize(530, 450);
    frame.setLocation(100, 100);
    frame.getContentPane().add(textarea);
    frame.setVisible(true);

    frame.addWindowListener(new WindowAdapter()
    {
      public void windowClosing(WindowEvent evt)
      {
        frame.dispose();
      }
    });
    textarea.setText(getFile(file));

  }
View Full Code Here

TOP

Related Classes of java.awt.TextArea$TextScrollable

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.