Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #3524

Re: How to display text m

From "ram" <ram@THRWHITE.remove-dii-this>
Subject Re: How to display text m
Message-ID <JTextArea-20080517153019@ram.dialup.fu-berlin.de> (permalink)
Newsgroups comp.lang.java.gui
References <B_hXj.9$%p3.7@newsfe02.lga>
Date 2011-04-27 15:45 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
"Jeff Higgins" <oohiggins@yahoo.com> writes:
>than the other text components. Because they are so powerful and flexible,
>styled text components typically require more initial programming to set
>up and use.

  A JTextArea also has some more difficult aspects.

  For example, when one wants a line appended at the end to be
  visible (a common case), with a JTextArea in a JScrollpane,
  sometimes one needs to call +scrollRectToVisible2 with the
  offset of the last line, so one needs to call
  +getLineEndOffset(line)2, which sometimes might throw a
  BadLocationException, which also needs to be handled.

  But such boilerplate code does not matter that much when one
  is subclassing to get a custom log text area component from 
  a Swing text component, because it all can be written once 
  and then be hidden behind methods of the custom log component.

>Prefer JTextArea for multi-line unstyled text.

  JTextPane and JEditorPane also allow multi-line unstyled text,
  and when subclassing to get a custom log text window,
  boilerplate code needs only be written once (actually just
  copied from tutorials), so the difficulty to use does not
  matter that much.

  So I wonder, whether from the point of visible properties of
  the product (what one observes when the program with the log
  window is running), there would ever be a reason to prefer
  JTextArea above JTextPane or JEditorPane.

  For example, if JTextPane would be known to be slower than
  JTextArea, this would be such a reason.

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to display text messa "ram" <ram@THRWHITE.remove-dii-this> - 2011-04-27 15:45 +0000
  Re: How to display text m "Jeff Higgins" <jeff.higgins@THRWHITE.remove-dii-this> - 2011-04-27 15:45 +0000
    Re: How to display text m "ram" <ram@THRWHITE.remove-dii-this> - 2011-04-27 15:45 +0000
      Re: How to display text m "Jeff Higgins" <jeff.higgins@THRWHITE.remove-dii-this> - 2011-04-27 15:45 +0000
    Re: How to display text m "ram" <ram@THRWHITE.remove-dii-this> - 2011-04-27 15:45 +0000
      Re: How to display text m "Jeff Higgins" <jeff.higgins@THRWHITE.remove-dii-this> - 2011-04-27 15:45 +0000
        Re: How to display text m "ram" <ram@THRWHITE.remove-dii-this> - 2011-04-27 15:45 +0000
  Re: How to display text m "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:45 +0000

csiph-web