Center text in a text component with line wrapping

I need to display dynamic text in a text component. I need line wrapping (on work boundaries) and also need horizontal and vertical center alignment.
How do I do this? I saw a previous post on aligning text in a JTextArea that said to use a JTextPane but I don't see in JTextPane how to do word wrapping.
Thanks,
John

//  File:          SystemInfoWindow.java.java
//  Classes:     SystemInfoWindow
//  Package:     utilities.msglib
//  Purpose:     Implement the SystemInfoWindow class.
//     Author:          JJB 
//     Revision History:
//     Date            By   Rel#  Description of change
//     =============  ===  ====  ===============================================
//     Jul 3, 2006   JJB  1.00  Original version
//  Public Types / Classes          Type Description
//  ========================     =============================================
//     SystemInfoWindow
package utilities.msglib;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTextPane;
import javax.swing.SwingUtilities;
* TODO Enter description
class SystemInfoWindow extends JDialog {
      * @param args
     public static void main(String[] args) {
          SwingUtilities.invokeLater(new Runnable() {
               public void run() {
                    Test thisClass = new Test();
                    thisClass.setVisible(true);
                    SystemInfoWindow window = new SystemInfoWindow(thisClass);
                    window.setMessage("System shutdown in progress ... lot sof atatarte athis tis a sa logoint of tesxt it keeps going and going and going thsoreoiat afsjkjslakjs fshafhdskrjlkjsdfj");
                    window.setVisible(true);
     //     ------------------------  Inner Classes ---------------------
     static class Test extends JFrame {
          private JPanel jContentPane = null;
           * This is the default constructor
          public Test() {
               super();
               initialize();
           * This method initializes this
           * @return void
          private void initialize() {
               this.setSize(300, 200);
               this.setContentPane(getJContentPane());
               this.setTitle("JFrame");
           * This method initializes jContentPane
           * @return javax.swing.JPanel
          private JPanel getJContentPane() {
               if (jContentPane == null) {
                    jContentPane = new JPanel();
                    jContentPane.setLayout(new BorderLayout());
               return jContentPane;
     //     ------------------------  Static Fields ---------------------
     private static final long serialVersionUID = -8602533190114692294L;
     //     ------------------------  Static Methods --------------------
     //     ------------------------  Public Fields ---------------------
     //     ------------------------  Non-Public Fields -----------------
     private JPanel jContentPane = null;
     private JTextPane textField = null;
     public SystemInfoWindow(JFrame frame) {
          super(frame);
          initialize();
          //setUndecorated(true);
          setLocationRelativeTo(frame);
          pack();
     //     ------------------------  Interface Implementations ---------
     //     ------------------------  Public Methods --------------------
     public void setMessage(String text){
          textField.setText(text);
          adjustSize();
     //     ------------------------  Non-Public Methods ----------------
     private void adjustSize(){
          Dimension oldSize = textField.getPreferredSize();
          textField.setPreferredSize(new Dimension(
                    oldSize.width, oldSize.height + 30));
          pack();
     //     ------------------------  Generated Code --------------------
      * This method initializes this
      * @return void
     private void initialize() {
          this.setSize(300, 200);
          this.setModal(true);
          this.setContentPane(getJContentPane());
          this.addWindowListener(new java.awt.event.WindowAdapter() {
               public void windowOpened(java.awt.event.WindowEvent e) {
                    //setLocationRelativeTo(MsgLibGlobals.parent);
                    pack();
      * This method initializes jContentPane
      * @return javax.swing.JPanel
     private JPanel getJContentPane() {
          if (jContentPane == null) {
               jContentPane = new JPanel();
               jContentPane.setLayout(new BorderLayout());
               jContentPane.setMaximumSize(new java.awt.Dimension(50,2147483647));
               jContentPane.add(getTextField(), java.awt.BorderLayout.CENTER);
          return jContentPane;
      * This method initializes textField     
      * @return javax.swing.JTextPane     
     private JTextPane getTextField() {
          if (textField == null) {
               textField = new JTextPane();
               textField.setEditable(false);
               textField.setMaximumSize(new java.awt.Dimension(20,2147483647));
          return textField;
}Message was edited by:
BaltimoreJohn

Similar Messages

  • Custom text component with different start and end points for each line

    I'm trying to create a custom component extending textArea in which each individual line in the textArea would have different start and end points.  For example, the start/end points for line 1 might be 20 pixels in the front and 35 pixels at the end but start/end points for line 2 might be 25 pixels in front and 20 pixels at the end, etc.  These boundary values would be passed in.  The width of the entire textArea component would be a fixed size.  The result would be something like this:
         Jack and Jill
              ran up the hill
      to fetch a pail of water
    depending on the boundary values of each individual line of course.  The custom component would take a string and render it in the text component with the appropriate individual line start and end points.  I'm trying to do this by adding the text component to the display with the passed in string and then adding in spaces in the beginning of each line and adding a "/n" at the end of the line wherever appropriate based on the start and end values for that line.
    Just wondering if I'm on the right track and if anyone has any advice on this.

    > Applying the marker places the same icon on all lines of the graph and I need a different one for each
    What do you have selected when you assign the marker? It
    shouldn't apply to all the markers on the whole graph unless you have all the existing markers selected when you apply the new one.
    Assigning marker designs is exactly analogous to assigning bar graph designs.
    If you have a single marker selected when you assign the new design, it will apply to only that graph data point.
    If you use the group select tool (or option-click with the direct select tool) to reclick on an already-selected marker until all the markers for the same line are selected, and then assign a design, the new design will apply only to the selected line. (You can extend the graph by adding more rows, and the new data points will inherit the marker for the line they are on.)
    The thread linked to below demonstrates in more detail how the marker designs are scaled:
    http://www.adobeforums.com/cgi-bin/webx/.3bc10970/0

  • How to create a text Component With Certain Properties

    I need to create a text component with the following properties:
    Has Capability to be italic, right/left aligned, have different background / foreground colors, and most importantly, the ability to have a fixed width and a height that is set by the amount of text in it (ie line wrapping expands the field vertically).
    It should be a simple exercise, but I cannot seem to figure out how to do it.

    Here is the correct syntax :
    private static JEditorPane constructPane(String text, int normWidth, int normHeight, boolean rightAlign, boolean italic,boolean isWhite) {
              JEditorPane pane = new JEditorPane();
              pane.setEditable(false);
              pane.setContentType("text/html");
              pane.setText(
                   "<html><head></head><body>"
                   + (italic?"<i>":"")
                   + "<table><COLGROUP><COL width=\""+normWidth+"\"><THREAD><tr><td valign=\"top\" align="+(rightAlign?"\"right\"":"\"left\"")+">"
                   + text+"</td></tr></table>"
                   + (italic?"</i>":"")
                   + "</body></html>");
              pane.setSize(normWidth,normHeight);
              if(isWhite)
                   pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(1,0,1,0,Color.WHITE),BorderFactory.createEmptyBorder(0,1,0,1)));
                   pane.setForeground(Color.WHITE);
              else {
                   pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(1,0,1,0,Color.BLACK),BorderFactory.createEmptyBorder(0,1,0,1)));
                   pane.setForeground(Color.BLACK);
              return pane;
         }

  • Text element with line item content and include text

    Hi All,
    How to write in smartform in single text element with line item content and include text.I am using this text element in table . Pls help me out. i am writing the include command in text element ,but this command is not enough for single line of text editor.
    thanks ,
    Rakesh singh

    I have been pulling my hair out for a few days trying to find
    this solution. This fixed my problems as well.
    I was getting ready to scrap the Report Builder altogether
    and move to SQL Server Reporting Services over this issue.
    I'm running 7.0.2 also, that version alone fixed many small
    issues like creating borders and such.
    Thanks

  • Email with text attachment with line width 1250

    Dear all,
                 I want to send the email with text attachment whose line width in text file is 1250. Kindly let me know how to send email attachment with more than 255 line width.
    Regards,
    Manoj
    Moderator Message: Frequently Asked Question. Please search for available information before posting.
    Edited by: kishan P on Apr 29, 2011 2:48 PM

    Hi,
    What ever text you are sending in the email, create a standard text for it using tcode SO10. In the program use the FM READ_TEXT to get the data into internal table which will be of length 132 char. If you want line widht of 255 chars convert using FM SX_TABLE_LINE_WIDTH_CHANGE as below,
    CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
        EXPORTING
          line_width_dst              = '255'
        TABLES
          content_in                  =  it_data
          content_out                 = it_mess_att
        EXCEPTIONS
          err_line_width_src_too_long = 1
          err_line_width_dst_too_long = 2
          err_conv_failed             = 3
          OTHERS                      = 4.
    Use FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send email.
    Hope this will help you.
    regards,
    Tulasi.

  • Output text component new line

    HI Team,
    I am picking up a value from resouce bundle for output text component.
    I wish to display data in output text component to display data after a new line.
    Suppose the message is coming as How are you.Welcome
    Now it should come as
    How are you
    Welcome
    Any help how is this achievable.
    I am working on Jdev 11.1.1.6
    Regards,
    Ajay

    Hi Team,
    The issue is resolved now.
    I have changed the escape property of output text component. to false so as to avoid the <br /> being HTML-escaped. and at the value level have used like
    <af:outputText value="#{XX.YOUR_REQUEST_HAS_BEEN_SUBMITTE}&lt;br />&lt;br />#{XX.YOUR_REQUEST_HAS_BEEN_SUBMITTE1}"
                                         id="ot10" escape="false"/>
    Where XX.YOUR_REQUEST_HAS_BEEN_SUBMITTE=Value1 and YOUR_REQUEST_HAS_BEEN_SUBMITTE1=Value2 in my resource bundle file.
    Output is coming as
    Value1
    Value2
    Does any one know how can i mark it as correct , can't see it after the forums upgrade to new one.
    Message was edited by: Ajay

  • Problems uploading a text file with line feed characters from Windows

    Hi,
    I am using the FM GUI_UPLOAD to load a text file in which at the end of each line there is a line feed character. When I upload the file, the FM interprets the entire file as ONE record; it does not recognize the line feed character at the end of each file line. I am using the parameter in the FM "HAS_FIELD_SEPARATOR" and it does not do anything to remidiate this issue.
    The funny thing is that  WS_upload works like a charm and it separates every line in the text file according to the line feed character at the end of each file line.
    Why a FM that is obsolete would work better and with  less effort than the new one? We are on 4.6c and will go to ECC6.0 May 2009.
    Can anybody recommenced a way to process this type of file using GUI_upload?
    The file to process is downloaded from a bank Website into a Windows PC. Sending the file to Unix first is not an option.
    Thanks,
    Pierre Martinez
    Edited by: Pierre Martinez on Aug 15, 2008 1:09 AM

    Hi,
    I have done that and Notepad does NOT interpret the line feed character. The file looks all messed up. Notepad does NOT split the data into records. The Hex character at the end of each file line is 0A.
    The user will download the file into a Windows desktop from the bank's website and from there an ABAP  program needs to read it and parse it. But the ABAP  program can not even catch the entire file with gui_upload. WS_upload can catch it with no issues.
    I tried catching the file into an internal table of data type string using GUI_upload, but it only catches two bytes of the file and nothing else.
    I will try catching the file in some other type of data type for the internal table in gui_upload.
    Once I catch it, I can split the file by the line feed character. I need to catch it  first, but "my glove" is not big enough. Defining the internal table for the gui_upload as character is a guessing game since I really do not know how big the text file is since GUI_upload will put it in a one record.
    Thanks.

  • Please help with choosing the right text component

    Hello,
    In my applet, I need a single-line text component with the following capabilities:
    1: Support for bold font (entire text,not just part of it)
    2: Support for underlined text (entire text,not just part of it)
    3: Support for blinking text
    4: Ability to put caret anywhere within the text field with mouse
    5: Support for field validation
    6: Ability to handle various key events and modify the text and/or move around caret position accordingly.
    Now, I know there are at least 4 different text components: JTextField, JTextArea, JEditorPane, JTextPane. Which one of these is most suitable for the above features? Is it possible to use JTextField to support all of the above?

    Here is a link to the Java Swing tutorial which discusses the text components.
    http://java.sun.com/docs/books/tutorial/uiswing/components/text.html
    I think you need to use a JEditorPane or a JTextPane (although I'm not sure any of the components support blinking text). A demo program shows some of the capabilities of these components:
    http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html

  • Photoshop: Making a text box with color or border.

    How do you fill a text box in Photoshop?
    Answer: You CAN’T.
    Solution:  You CAN do anything you want in Photoshop -we know it’s GREAT - but the steps are not always so easy.  See below for solutions to making it seem that the text box is filled with color, bordered, semi-tansparent etc.
    In Photoshop, a text box is mostly about the text inside and less about the box that surrounds it.  In other words, the box is always transparent and all effects apply to the font shapes typed inside by the user.  Photoshop (CS4) can produce incredible, professional, amazing text images. No Doubt About It!
    A Photoshop text box can display one of two types of bounding boxes: 
    Its OBJECT bounding box is there for moving the whole text layer, rotating it, duplicating it and distorting.  Clicking once on the text layer pallet and selecting the move tool (v) will produce this bounding box.  The direct selection tool (a) won’t recognize it.  Note:  If you try to resize the box as an object, it also distorts/stretches the text inside.  This can make cool effects but usually you want the text to stay the way the font was designed.  See: Layers>Type>Warp Text.
    The TEXT bounding box is there for highlighting, re-typing and selecting the margins of the actual text/paragraph etc.  Selecting the text tool and clicking over existing text will produce this bounding box.
    Some features are accessible in either mode.
    The Photoshop text tool has two types of cursors:
    The NEW text box cursor looks like a text insertion cursor (often seen in word processing) WITH a dotted box around it.
    To produce the new text box cursor just select the text tool and move over to a new work area.
    The EDIT text cursor looks very much like the ordinary cursor people are familiar with (no dotted box). 
    To produce the edit text tool, hover the text tool over EXISTING text and the cursor changes to the simple insertion shape (without the dotted box).  A click now will put you into text editing mode, not new text box mode.  This drove me batty for a while because I was used to clicking anywhere inside an existing text box and the blinking cursor would pop in automatically - usually at the end of the last letter.  This doesn’t happen in Photoshop; if that NEW text box tool is active, it will try to place a new box anywhere you click sometimes overlapping another.
    When in this mode (edit existing text) you can carefully hover the arrow to the edges of the text box and resize the bounding box without altering the shape of the text itself.  This is how you make the text box larger or smaller to fit/accommodate your needs.  You can also highlight text, insert between words/letters.  Highlighted text is available for changing its font, color, size, cutting/pasting etc. 
    To get OUT of the EDIT text mode, click the check box on the tool column above or type enter (not return) or type cmd-return (MAC), ctrl-return (WIN).  If you want to cancel any changes to an existing text box click the ex-circle on the tool column or press the esc key (top left of keyboard-escape key)
    OK, THE MAIN POINT:
    To make an effect that looks like a text box that is filled, bordered, semi-transparent etc., you will have to create an object shape (box) and place it just behind (under) the text box.  Linking the two allows you to move them around easily.  The drawback is that, when you need a larger box, you’ll have to alter the size of both boxes and possibly re-center them to each other (I know it’s sort of dumb to have so many steps just to get a shaded text box or bordered one.)
    Begin by selecting the Rectangle shape tool and draw a shape on the screen of any size.  In the layers pallet a layer is created with two items (layer thumbnail and vector mask) Double click the one on the left the layer thumbnail).  Change its color to a light one such as baby blue or yellow.
    Now select the text tool and click once over that shape.  A text box is created exactly the same size of the rectangle (any shape will work too).
    Type some text into that box and change the font type, size and color to something you might use regularly.  Check to see that the text color is black (can be changed later).  The text automatically wraps around when you reach the edge of this box and fits well (inside margins can be altered by pixel later).
    Now link the two boxes to one another.  Shift-click each layer in the layers pallet to select both and choose the link button at the bottom of the window for layers or go to Layers>Link Layers.  Now when you move one it will move the other too!
    Using the paragraph tools you can center text, indent first line, and add space between paragraphs.  Except the first paragraph seems too close to the top of the colored rectangle; doesn’t it?  Photoshop won’t add extra leading (horizontal space) between the text box and the top of the first paragraph.
    There are two ways to fix this:
    1.     Select the text tool and click inside the existing text then hover the pointer just above the little box/tab in the top center of that rectangle and bring it down just a bit.
    2.     Or you could unlink the two layers (to unlink just click link again while one of the two layers is selected in pallet) and move the colored rectangle up just a bit.
    In the first instance it was not necessary to unlink the boxes.  This is the advantage because altering the colored rectangle without unlinking will distort your text as will altering the text box if you are not in object text mode (see intro.)
    Ok, some advantages:
    Now that you have this set up you can use the background box (colored rectangle) to make other effects.  Select it as a separate layer but you won’t have to unlink it.  To make the box semi-transparent change either the layer OPACITY or the layer FILL (found in the layer pallet).
    To create a border box:
    1.     Select the colored rectangle box and under Layers>Styles>Blending Options (or just double click in an open area of the layer pallet for that shape.)
    2.     Select Stroke, change:  Fill Type color, Color black, Size 4, Position inside, Blend Mode normal, Opacity 100%. Click OK/Apply
    3.     Back in the layer pallet, change the Fill to 0% and you will just have a border with attached text box.  You may have to alter the inside text box again depending on the thickness of that border especially if you made the Position to be inside to keep the sharpness of the rectangle.
    4.     Yes this will work with other shapes and even custom shapes.  Remember to draw the shape first and immediately place a new text box over it BEFORE any other alteration is done.  This ensures that Photoshop creates a text box exactly the same size/dimension of your chosen shape.  It even makes margins fit irregular shapes like triangles.
    5.     Try it!

    Toxic Cumquat wrote:
    How do you fill a text box in Photoshop?
    Answer: You CAN’T.
    Solution:  You CAN do anything you want in Photoshop -we know it’s GREAT - but the steps are not always so easy.  See below for solutions to making it seem that the text box is filled with color, bordered, semi-tansparent etc.
    In Photoshop, a text box is mostly about the text inside and less about the box that surrounds it.  In other words, the box is always transparent and all effects apply to the font shapes typed inside by the user.  Photoshop (CS4) can produce incredible, professional, amazing text images. No Doubt About It!
    A Photoshop text box can display one of two types of bounding boxes: 
    Its OBJECT bounding box is there for moving the whole text layer, rotating it, duplicating it and distorting.  Clicking once on the text layer pallet and selecting the move tool (v) will produce this bounding box.  The direct selection tool (a) won’t recognize it.  Note:  If you try to resize the box as an object, it also distorts/stretches the text inside.  This can make cool effects but usually you want the text to stay the way the font was designed.  See: Layers>Type>Warp Text.
    The TEXT bounding box is there for highlighting, re-typing and selecting the margins of the actual text/paragraph etc.  Selecting the text tool and clicking over existing text will produce this bounding box.
    Some features are accessible in either mode.
    The Photoshop text tool has two types of cursors:
    The NEW text box cursor looks like a text insertion cursor (often seen in word processing) WITH a dotted box around it.
    To produce the new text box cursor just select the text tool and move over to a new work area.
    The EDIT text cursor looks very much like the ordinary cursor people are familiar with (no dotted box). 
    To produce the edit text tool, hover the text tool over EXISTING text and the cursor changes to the simple insertion shape (without the dotted box).  A click now will put you into text editing mode, not new text box mode.  This drove me batty for a while because I was used to clicking anywhere inside an existing text box and the blinking cursor would pop in automatically - usually at the end of the last letter.  This doesn’t happen in Photoshop; if that NEW text box tool is active, it will try to place a new box anywhere you click sometimes overlapping another.
    When in this mode (edit existing text) you can carefully hover the arrow to the edges of the text box and resize the bounding box without altering the shape of the text itself.  This is how you make the text box larger or smaller to fit/accommodate your needs.  You can also highlight text, insert between words/letters.  Highlighted text is available for changing its font, color, size, cutting/pasting etc. 
    To get OUT of the EDIT text mode, click the check box on the tool column above or type enter (not return) or type cmd-return (MAC), ctrl-return (WIN).  If you want to cancel any changes to an existing text box click the ex-circle on the tool column or press the esc key (top left of keyboard-escape key)
    OK, THE MAIN POINT:
    To make an effect that looks like a text box that is filled, bordered, semi-transparent etc., you will have to create an object shape (box) and place it just behind (under) the text box.  Linking the two allows you to move them around easily.  The drawback is that, when you need a larger box, you’ll have to alter the size of both boxes and possibly re-center them to each other (I know it’s sort of dumb to have so many steps just to get a shaded text box or bordered one.)
    Begin by selecting the Rectangle shape tool and draw a shape on the screen of any size.  In the layers pallet a layer is created with two items (layer thumbnail and vector mask) Double click the one on the left the layer thumbnail).  Change its color to a light one such as baby blue or yellow.
    Now select the text tool and click once over that shape.  A text box is created exactly the same size of the rectangle (any shape will work too).
    Type some text into that box and change the font type, size and color to something you might use regularly.  Check to see that the text color is black (can be changed later).  The text automatically wraps around when you reach the edge of this box and fits well (inside margins can be altered by pixel later).
    Now link the two boxes to one another.  Shift-click each layer in the layers pallet to select both and choose the link button at the bottom of the window for layers or go to Layers>Link Layers.  Now when you move one it will move the other too!
    Using the paragraph tools you can center text, indent first line, and add space between paragraphs.  Except the first paragraph seems too close to the top of the colored rectangle; doesn’t it?  Photoshop won’t add extra leading (horizontal space) between the text box and the top of the first paragraph.
    There are two ways to fix this:
    1.     Select the text tool and click inside the existing text then hover the pointer just above the little box/tab in the top center of that rectangle and bring it down just a bit.
    2.     Or you could unlink the two layers (to unlink just click link again while one of the two layers is selected in pallet) and move the colored rectangle up just a bit.
    In the first instance it was not necessary to unlink the boxes.  This is the advantage because altering the colored rectangle without unlinking will distort your text as will altering the text box if you are not in object text mode (see intro.)
    Ok, some advantages:
    Now that you have this set up you can use the background box (colored rectangle) to make other effects.  Select it as a separate layer but you won’t have to unlink it.  To make the box semi-transparent change either the layer OPACITY or the layer FILL (found in the layer pallet).
    To create a border box:
    1.     Select the colored rectangle box and under Layers>Styles>Blending Options (or just double click in an open area of the layer pallet for that shape.)
    2.     Select Stroke, change:  Fill Type color, Color black, Size 4, Position inside, Blend Mode normal, Opacity 100%. Click OK/Apply
    3.     Back in the layer pallet, change the Fill to 0% and you will just have a border with attached text box.  You may have to alter the inside text box again depending on the thickness of that border especially if you made the Position to be inside to keep the sharpness of the rectangle.
    4.     Yes this will work with other shapes and even custom shapes.  Remember to draw the shape first and immediately place a new text box over it BEFORE any other alteration is done.  This ensures that Photoshop creates a text box exactly the same size/dimension of your chosen shape.  It even makes margins fit irregular shapes like triangles.
    5.     Try it! Or try using Indesign!
    There. I fixed that for you.

  • Formatting HTML Text in Text component

    Hi all,
    I'm trying to render some Html text in a text component, I'm
    getting the HTML from within an xml document as such:
    <xml><htext><p><b>Testing HTML
    Text</b></p><p>Here's another
    line.</p></htext></xml>
    If I put that into a Text component with the htmlText=htext
    property, the line spacing is as expected, but it seems to add in a
    blank space character for every character of the html code. (E.g.
    "<b>Testing" adds 3 extra spaces before the word "Testing").
    Renders like (using - as space character):
    Testing HTML Text
    -Here's another line.
    If I use the condeseWhite=true property on the Text
    component, it fixes the extra space characters issue, but then
    stuffs the line spacing up, so <p> becomes rendered like a
    <br>.
    Renders like:
    Testing HTML Text
    Here's another line.
    Any thoughts, or help is much appreciated, thanks in advance.
    Oz
    P.S I was trying to avoid the obvious "br" tag which will
    make it work and render correctly....
    <p><b>Testing HTML Text</b></p>
    <br/><p>Here's another line.</p>

    no. use css.

  • Retrieve RowSet and Display in Output Text Component

    To retrieve a row object, took more effort than I expected with this tool. I wanted to populate a simple output text component with a db object pulled from a row, and I binded it to the rowset column. It worked great, but it kept retrieving the first row, since in the JSP it was calling this:
    #{questionsetup.questionRowSet.currentRow['question']}
    To get it to increment rows per output text component I did this:
    questionRowSet.setDataSourceName("java:comp/env/jdbc/SelfService");
            questionRowSet.setCommand("SELECT ALL dbo.Question.quesId, dbo.Question.question, dbo.Question.lastChangeDate  FROM dbo.Question");
            questionRowSet.execute();
            questionRowSet.next();
            outputText3.setValue(questionRowSet.getString("question"));
            questionRowSet.next();
            outputText4.setValue(questionRowSet.getString("question"));
            questionRowSet.next();
            outputText5.setValue(questionRowSet.getString("question"));Is there another way to do this automatically? The Studio Creator way? Or is this correct? The Studio Creator help file explains how to bind a simple component, and using the binding, but it even says it will retrieve the data in the first row. Incremenet rows or specifying a specific one would really help!
    Thank you very much!

    Maybe take control of the Select statement myself...
    So I decided to get the MIN value of my ID
    like this
    "select MIN(T21id) AS ttt from persons"
    now this is valid in SQLyog
    BUT Creator says
    Description: An unhandled exception ...
    Exception Details: javax.faces.el.PropertyNotFoundException
    Invalid column name: BaseRemuneration
    nb why is this "unhandled" since it is inside a try block?
    why does it mention BaseRemuneration which is a completely different but valid column??
    So Sun Creator will accept an unknown subset of valid SQL commands, and give bizarre irrelevant exception error messages on the set of valid SQL statements that it doesnt like.
    The documents appear to state that MIN is not handled by the IDE but can be entered manually.
    In fact it can NOT be enmtered manually.
    So is there an accurate list of valid SQL that is accepted?

  • Disable wrapping of words in static text component inside gridpanel

    Hi
    I'm using static text components inside gridpanel. Now I noticed that in several cases the text, if consisting of several words, is broken into several lines both in the designer and at runtime.
    Question: is there a way to tell a static text component to never wrap the text into several lines?
    thanks, Peter

    Hi Peter,
    Check if the width of the gridpanel has been set. In case the width property has a fixed value then the static text component would wrap the text content to fit the width of the gridpanel.
    For example, below are the steps I followed:
    1. Drag and drop a gridpanel
    2. Drag and drop a staticText onto the gridpanel
    3. In the text property of the staticText enter the following sentence "This is a static text in a gridpanel which has only one column"
    4. It can be seen that the entire sentence is in one line
    5. Now select the gridpanel and click on the ... button next to style property to open up the style dialog
    6. Click on Position
    7. Under size, set the width to 100 px
    8. Click on OK
    9. As can been the sentence is now displayed over 5 lines
    Hope this helps
    Cheers
    Girish

  • Acrobat XI, Edit Text ... can you turn off line wrapping?

    Just upgraded from Acrobat X Pro to XI Pro ... any way to toggle line-wrapping on & off in edit text mode?
    I appreciate that XI has much livelier text editing, but sometimes I don't want the text to be that lively.
    Making a simple tweak in text often changes line wrapping on totally other lines in a paragraph, even if the line with the change doesn't wrap differently. Nothing about the font or character spacing appears to change, just the paragraph right border.
    Often the original line wrapping can be restored by adjusting the paragraph object's right border back to where it was, but sometimes that introduces even more line wrapping differences. Any way to make this more stable?

    That's Text Chat window open > View menu > Messages sub set.
    7:23 PM Monday; October 29, 2007

  • Applescript batch convert DOC to TXT with line breaks

    Hey guys, I recently got stuck at work having to convert over 1,000 DOC files to TXT files with line breaks.
    I've found online several different Applescripts that work great at converting DOC files to TXT files but I can't find one that will do the TXT files with line breaks.
    If anyone has a script that can do this I would be crazy grateful.
    Converting these one by one with Word is taking forever to do.
    Thanks for any help you can give me.

    Excuse me for a moment for speaking harshly to you.  You are causing yourself utterly unnecessary headaches by not being clear with us and not stopping to think, and it's high time you learned that that is an incorrect way to approach anything on a computer.  Consider:
    you don't know what you're doing (in the sense that you don't know what 'text with line breaks' means)
    you don't know (or at least haven't explained) why this needs to be done
    (therefore) you don't know if this needs to be done at all
    (and yet) you are doing it anyway, in a mindlessly repetitive fashion, driving yourself batty and irritating me
    At least for the time being, humans are the ones who think and computers the ones who grunt away mindlessly; try to reverse those roles and everything gets done badly and slowly. Stop, look, think, plan ahead - that's what your brain is good at if you give it a chance.
    Now, as far as I can tell from poking around the web, 'text only with line breaks' means that the document  is saved as a plain-text file, but with a carriage return linefeed combination (CR/LF) as a paragraph delimiter (this is a Windows format - unix uses a single linefeed, Macs might use a single carriage return or a single linefeed). I don't know why anyone would want that format - most software will convert that seamlessly (or at least can be told to convert that).  Are you trying to feed this into some dinosaur of a database?  At any rate, if that's what you want, this script should do it. caution, this script overwrites the original files; I suggest you make a copy of one or two files in a separate folder, and run the script on them first to check that the output works for whatever reason you're doing this:
    set baseFolder to choose folder with prompt "Choose a folder of files to process"
    tell application "Finder"
              set fileList to (every file of baseFolder whose name extension is "txt") as alias list
    end tell
    repeat with thisFile in fileList
              set itsText to read thisFile
              if (offset of (return & linefeed) in itsText) = 0 then
      -- file is not already formatted with CR/LF, so convert
                        set itsChunks to tid(itsText, {return, linefeed})
                        set itsNewText to tid(itsChunks, return & linefeed)
                        set fp to open for access thisFile with write permission
                        set eof of fp to 0
      write itsNewText to fp as text
      close access fp
              end if
    end repeat
    on tid(input, delim)
      -- handler for text items conversions
              set {oldTID, my text item delimiters} to {my text item delimiters, delim}
              if class of input is list then
                        set output to input as text
              else
                        set output to text items of input
              end if
              set my text item delimiters to oldTID
              return output
    end tid

  • Issues with Thai wrapping

    I have been trying out TLF with various spark and FTE components, but unfortunately have been having issues with line-wrapping in Thai. It doesn't seem to break in between words.
    For example, I have tried a spark TextArea/RichText/RichEditableText and set locale for the components to 'th_TH'.
    Four Questions:
    1) Should Thai be working correctly?
    2) Does setting locale matter at all?
    3) Do FTE & TLF components have the same bidi/international capabilities? Or is TLF more robust? (For example, should thai/arabic/etc work the same in both a FTE/TLF component?)
    4) When highlighting Thai/Arabic/Hebrew in certain components, the characters shift all around with the cursor. Is this a bug?
    Thanks a lot

    Hi bogmead,
    There is a attribute to control line wrapping in TLF. The attribute should be set on flashx.textLayout.element.TextFlow(<s:TextFlow> in Flex) or some of its child elements, rather than flex components.
    <xs:attribute name="breakOpportunity" type="xs:enumeratedString" default=" auto"/>
    Controls where a line can validly break.
    Valid values include:
    • auto Line breaking opportunities are based on standard Unicode character properties, such as breaking between words and on hyphens.
    • any Indicates that the line may end at any character. This value is typically used when Roman text is embedded in Asian text and it is desirable for breaks to happen in the middle of words.
    • none No characters in the range are treated as line break opportunities.
    • all All characters in the range are treated as mandatory line break opportunities, thereby creating one character per line. This value is useful for creating effects like text on a path.
    A range is a continuous group of characters that have none applied. Therefore, selecting “one of” and applying none, results in a range of characters starting with “o” and ending with “f” that have none applied and will not get any line breaks inside the range.

Maybe you are looking for