How to create a muli line text area using JavaFx

Hi all,
Since the preview SDK does not contain TextArea any more, I am wondering how to create a muli line text area using JavaFX. The behaviour of this text area/field should be somehow similar to JTextArea in Swing or StyledTextWidget in SWT.
Does JavaFX have any support for this? What would be a sensible approach to create such a widget?
Thanks for your suggestions,
br michael

This is a pretty old thread (I know I came across this while searching for something similar recently), but I figured I'd throw this out there in case other people might find this useful. As I write this, JavaFX's latest version is 1.3... which may have added the needed functionality since the last post.
You can now create a multi-line text area using a TextBox and by specifying the nubmer of lines and setting the "multiline" value to true. It may not offer all of the same functionality as JTextArea, but it did the job for what I needed... newlines by pressing enter, scrollbar if text surpasses height, etc.
Here's a simple example:
Group {
   content: [
      TextBox {
         text: "This is a multi-line textbox"
         lines: 10  // <-- this may/may not be necessary depending on your situation. Default is 5.
         multiline: true
}Edited by: loeschg on Jul 29, 2010 2:59 PM

Similar Messages

  • How to create a "Command Line"/"Text Validation"

    I want to create a command line like the picture. I'm using "Input Text" method for text. Variable name is "myText", Instance Name is "line".
    How can I use "if" in input text like this:
    Command name is: exit, if user wrote "exit" command, exit the flash app.

    This is a pretty old thread (I know I came across this while searching for something similar recently), but I figured I'd throw this out there in case other people might find this useful. As I write this, JavaFX's latest version is 1.3... which may have added the needed functionality since the last post.
    You can now create a multi-line text area using a TextBox and by specifying the nubmer of lines and setting the "multiline" value to true. It may not offer all of the same functionality as JTextArea, but it did the job for what I needed... newlines by pressing enter, scrollbar if text surpasses height, etc.
    Here's a simple example:
    Group {
       content: [
          TextBox {
             text: "This is a multi-line textbox"
             lines: 10  // <-- this may/may not be necessary depending on your situation. Default is 5.
             multiline: true
    }Edited by: loeschg on Jul 29, 2010 2:59 PM

  • Create a Multiple-Line JButton Without Using HTML format

    I used html format for multiple-line JButton and it took a long time to load that button up (about 5 seconds more). Does anyone know how to create a multiple-line JButton without using html?
    Any suggestion or sample code will be appreciated.
    javamesser

    Hello,
    You could try using the following:
    -give your button some layout (e.g.: BoxLayout.Y_AXIS, or BorderLayout).
    -create the wrapped text in separate JLabels (one line in each label)
    -add your labels to the button
    Advantage:
    this solution does not affect the laf classes
    Disadvantage:
    focus rectangle is not calculated accurately
    Regards,
    G

  • How to create Support function for internal Class use

    I have created a class to find the MoonRise and Set time. There is a java code available and I am translating it to Obj-C.
    My problem is that for the calculation there are many support functions which is internally used. When I try to duplicate this as follows
    -(double) frac:(double)x {
    // returns the fractional part of x as used in minimoon and minisun
    double a;
    a = x - floor(x);
    if (a < 0) a += 1;
    return a;
    -(void)minimoon:(double)t {
    // takes t and returns the geocentric ra and dec in an array mooneq
    // claimed good to 5' (angle) in ra and 1' in dec
    // tallies with another approximate method and with ICE for a couple of dates
    double L0, L, LS, F, D, H, S, N, DL, CB, L_moon, B_moon, V, W, X, Y, Z, RHO;
    //var mooneq = new Array;
    L0 = frac(0.606433 + 1336.855225 * t); // mean longitude of moon
    At this point it gives an error implicit declaration of function frac,
    My question is how to create such helper functions which are used internally, actually there are many such functions where functionA call B which calls C.
    Thanks
    Raj

    Here's yet another approach (creating a private category):
    @interface MYClass (Private)
    - (double)frac:(double)x;
    @end
    @implementation MYClass
    - (void)minimoon:(double)t {
    // takes t and returns the geocentric ra and dec in an array mooneq
    // claimed good to 5' (angle) in ra and 1' in dec
    // tallies with another approximate method and with ICE for a couple of dates
    double L0, L, LS, F, D, H, S, N, DL, CB, L_moon, B_moon, V, W, X, Y, Z, RHO;
    //var mooneq = new Array;
    L0 = [self frac:(0.606433 + 1336.855225 * t)]; // mean longitude of moon
    - (double)frac:(double)x
    // returns the fractional part of x as used in minimoon and minisun
    double a;
    a = x - floor(x);
    if (a < 0) a += 1;
    return a;
    @end
    <div class="jive-quote">rajkhand wrote:
    I liked the first method as I don't have to change much of the java code.
    I like it too. I use that very regularly (though I often use C++/Objective C++), since there is typically a lot of implementation in any class that does not need to be an ObjC instance method. This approach helps to reduce the object's interface to its essentials while keeping maintenance low.
    I'll put all the helper functions above the implementation.
    Is there a good book/web site where I can get such insight? I know C and Delphi/pascal
    Well, Objective-C is a superset of C. If you're porting Java, you'll find protocols (ObjC) similar to interfaces (Java).
    *Getting Started*
    Apple's version of ObjC is different from others. For the language, Apple's docs are the standard (IMO):
    Language:
    http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/ObjC.pdf
    If you are comfortable with C, this guide will help learning Objective-C quickly, though it has not been updated for (Apple's) Objective-C 2.0:
    http://www.amazon.com/Objective-C-Pocket-Reference-Andrew-Duncan/dp/0596004230/r ef=sr14?ie=UTF8&s=books&qid=1245404236&sr=8-4
    There are a few books on the ObjC2 language, but I have not read them (I just read Apple's docs for this).
    OOP/Design:
    http://developer.apple.com/documentation/Cocoa/Conceptual/OOPObjC/OOPObjC.pdf
    Research
    Good site for archives of tips, tricks, and even some hacks:
    http://www.cocoadev.com/
    Apple's lists (Cocoa, Xcode, ObjC, and specific technologies):
    http://lists.apple.com/mailman/listinfo
    This one sees the most traffic for Cocoa, and ObjC topics :
    http://lists.apple.com/mailman/listinfo/cocoa-dev
    Online archive for aforementioned Xcode and Cocoa list submissions:
    http://www.cocoabuilder.com/
    There are a lot of good sites/blogs out there as well.
    Questions
    Apple's lists (linked above) will typically yield good answers in a short time, you can also try here.
    Thanks a million
    Raj
    You're Welcome,
    J

  • HELP! PDF objects - How to create a program line object?

    Hi Experts,
    I would like to know how to create a Program lines object (icon cog wheels). I need to create additional coding inside the context tab but when I try to right click on a folder --> create -->graphic,address,text,alternative...single record... No
    program lines can be created.
    Hope someone could help me.
    Thanks,
    Jeff

    There are two ways of doing it, depending on what you want to accomplish. Both require that you edit the file ~/.bashrc (I assume you use bash)
    1) If the application places all the executable files in a given directory (let's say /opt/Application/bin/), you can access all those executables directly by simply telling your shell where to look (in the same way the shell automatically looks for executable files in eg. /usr/bin). In ~/.bashrc, you would have to add a line that looks like this:
    PATH="$PATH:/opt/Application/bin"
    2) If you just want to make a traditional "shortcut" that executes a given command, this can be done with alias. Add this command to your ~/.bashrc:
    alias shortcut="some command"
    In this case, typing shortcut into a terminal will be interpreted just like if you had typed some command instead.
    In order to try out these changes, either restart your terminal or run this command:
    source ~/.bashrc
    [EDIT]
    I was obviously beaten to it
    Last edited by Peanut (2009-05-26 23:12:47)

  • How to create a new line in label in Xcode

    How to create a new line in label. for example I have two buttons & one label. when i press first button, l want to change the label text to "Hello World". then when I press the second button, on the same label I need to display"Good Bye" on the next line in xcode 5?
    I want to display the lablel like below:
    Hello World
    Good Bye

    I am using Xcode to develop an app for iOS.
    I tried using multi-line label & belwo is my code.
    - (IBAction)change:(UIButton *)sender {
        self.Screen.text = @"\nHello World";
    - (IBAction)newChange:(UIButton *)sender {
          self.Screen.text = @"\nGood bye";
    everytime when i pressed the button, it replacing the whold lable text instead of adding the second line.

  • How to create queries on multiproviders& what are steps to be taken.

    Hi all,
    How to create queries on multiproviders& what are steps has to be take care.
    Thanks,
    cheta.

    Hi,
    Following scenario for  sample for slow moving items for multiproviders.
    Slow Moving Item Scenario
    You want to define a query that displays all products that have been purchased only
    infrequently or not at all. In other words, the query is also display characteristic values for
    which no transaction data or only low values exist for the selected period.
    Procedure
    In the Administrator Workbench;
    1. Create a MultiProvider consisting of a revenue InfoCube, containing the InfoObject
    Material (0MATERIAL), and the InfoObject 0MATERIAL. The InfoObject must be set as
    an InfoProvider in InfoObject maintenance. In other words, you need to have assigned
    the InfoObject to an InfoArea. (also refer to Tab Page: Master Data/texts [Ext.]).
    In the BEx Analyzer:
    2. Select your MultiProvider in the Query Designer.
    3. Define a query that contains the InfoObject 1ROWCOUNT in the columns.
    The InfoObject 1ROWCOUNT is contained in all “flat” InfoProviders, that is, in all
    InfoObjects and ODS objects. It counts the number of records in the InfoProvider.
    In this scenario, you can see from the row number display whether or nor values
    from the InfoProvider InfoObject are really displayed.
    4. Save the query and execute it. All values are now displayed, including those for materials
    that were not purchased.
    If you filter by time (0CALYEAR, for example), values from the InfoProvider
    InfoObjects are not displayed since 0CALYEAR is not an attribute of
    0MATERIAL. You can see this from the absence of values in the 1ROWCOUNT
    column in the query. If you want to restrict by time, you need to proceed as
    follows:
    Constant Selection for the InfoObject
    You need to set the constant selection for the 1ROWCOUNT key figure in order to be able to
    set a filter by time in this query.
    1. In the Query Designer, via the context menu for 1ROWCOUNT, choose Edit.
    2. On the left hand half of the screen, under the data package dimension, select the
    characteristic InfoProvider (0INFOPROV) and drag it into the right-hand screen area.
    3. From the context menu for the InfoProvider, choose Restrict, and restrict across the
    InfoProvider InfoObject.
    4. Also from the context menu for the InfoProvider, choose the function Constant Selection.
    5. Save the query and execute it. You can now also set a filter for a time characteristic, the
    materials display remains as it was.
    Displaying Slow Moving Items
    If you want to display a list of slow moving items, excluding products that are selling well, you
    need to proceed as follows:
    1. In the Query Designer, via the context menu for 1ROWCOUNT, choose Edit.
    2. Via the context menu for InfoProvider, choose the function Display Empty Values. Also
    select Constant Selection.
    3. Save the query and execute it. The result is that the system displays the materials for
    which there was no revenue.
    Displaying Products with Small Revenues
    If you want to display a list of products that have not been sold or have only been selling
    badly, you need to proceed as follows:
    1. Set constant selection as described above, but do not select the display empty values
    function.
    2. In the Query Designer, define a condition for the 0MATERIAL InfoObject. Specify a value
    that is to be the upper limit for a bad sale.
    3. Save the query and execute it. The result is that the system displays all materials that
    have not been sold or have been selling badly.
    Thanks,
    Sankar M

  • How do I create columns in my text when using pages?

    How do I create columns in my text when using pages?

    Presuming you are using Pages 5.2.2:
    select the text > choose the number of columns in the Format > Layout sidebar
    Peter

  • How to create a stroked line that randomize each stroke color?

    Hi all, I am strating out designing in illustrator and I need help on how to created a stroked line, -----------, with each stroke (  -  )  a different colour, like, each stroke having a different randomized color which differs from the next one.
    Also, I need help on how to mask out parts of a template given to me by my school so i dont infringe that boundary when I add my lines to it. All helps appreciated, thank you.

    Ok thank you for your responses, Monika, I followed your instruction but it isnt working, is there any steps that I might have done wrongly? Here are some screenshots that depicts my problem:
    Here it is after I outline the stroke,
    And here it is when I apply the script:
    However, after I clicked okay, nothing changed and the strokes are still in their original color(yellow) as seen in the first picture. Did I do any steps wrong that result in this outcome? Also I've tried to put 99 instead of 99s and still, it didnt work.

  • How to create a multiple-line TextBox in a jfx script?

    How to create a multiple-line TextBox in a jfx script?
    Or
    How to use the Swing component JTextArea in a jfx script?
    Please post a brief code segment.
    Thanks,
    Asghar

    This supports two way binding between JavaFX and Java and also cut and paste.
    Enjoy.
      * MyTextArea.fx
      * Created on Dec 14, 2008, 7:23:49 AM
    package twifxer.components;
    import java.awt.event.KeyEvent;
    import java.awt.event.KeyListener;
    import java.awt.Font;
    import javafx.ext.swing.SwingComponent;
    import javax.swing.JComponent;
    import javax.swing.JTextArea;
    import java.awt.Color;
      * @author Steven Herod
    public class TweetTextComponent extends SwingComponent{
         var myComponent: JTextArea;
         public var length: Integer;
         public var readText:String;
         public var text: String on replace{
             myComponent.setText(text);
         public var toolTipText: String on replace{
             myComponent.setToolTipText(toolTipText);
         public override function createJComponent():JComponent{
             translateX = 15;
             translateY = 5;
             var f:Font = new Font("sanserif",Font.PLAIN, 11);
             myComponent = new JTextArea(4, 33);
             myComponent.setOpaque(false);
             myComponent.setFont(f);
             myComponent.setWrapStyleWord(true);
             myComponent.setLineWrap(true);
             myComponent.addKeyListener( KeyListener{
                 public override function
                 keyPressed(keyEvent:KeyEvent) {
                     if (keyEvent.VK_PASTE == keyEvent.getKeyCode())
                         myComponent.paste();
                 public override function
                 keyReleased( keyEvent:KeyEvent) {
                     var pos = myComponent.getCaretPosition();
                     text = myComponent.getText();
                     myComponent.setCaretPosition(pos);
                 public override function
                 keyTyped(keyEvent:KeyEvent) {
                     length = myComponent.getDocument().getLength();
             return myComponent;
    }

  • How to create a multi-line table/column comment

    Can someone tell me how to create a multi-line table or column comment?
    Apparently, the concatenate operator (||) does not work with the COMMENT statement.
    I've searched the Oracle manuals and couldn't find an answer.
    COMMENT ON TABLE sometbl IS 'i would like to break up this comment into several lines in order to improve readability'; Effectively, this is what I'd like to do (but it doesn't work):
    COMMENT ON TABLE sometbl IS
      'i would like to break up ' || CHAR(10) ||
      'this comment into several lines ' || CHAR(10) ||
      'in order to improve readability' || CHAR(10); Oracle version is 10.2.0.4

    Why not just
    SQL> create table t (a int)
    Createtable successfully completed.
    SQL> comment on table t is 'i would like to break up 
    this comment into several lines 
    in order to improve readability'
    Commenton successfully completed.
    SQL> select * from user_tab_comments where table_name = 'T'
    TABLE_NAME           TABLE_TYPE  COMMENTS                               
    T                    TABLE       i would like to break up               
                                     this comment into several lines        
                                     in order to improve readability        
    1 row selected.?

  • How to Create Test Sequence Document in HTML using command line

    How to Create Test Sequence Document  in HTML using command line
    I have lot of sequences and I want to create Test Sequence Documentation in HTML format using Command Line automatically, is there a way to automate this task using .bat file or using   C#  .Net

    If you aren't able to figure out how to call a C++ DLL in .net then there may be another option.  Unfortunately I don't know how to do this off the top of my head and I don't have an example.
    The other option would be to change docgen.seq a little bit to the dialog doesn't display and you just hardcode the options.  Then you can use a command line to call testexec.exe: http://zone.ni.com/reference/en-XX/help/370052K-01/tsfundamentals/infotopics/startup_opt/
    Hope this helps,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • How to create curve fitted line chart?

    Line chart is formed with straight lines, but how to create curve fitted line chart?

    Jasper wrote a blog on curve fitting charts

  • How to create pdf files with text field data

    how to create pdf files with text field data

    That looks like it should work, but it doesn't.
    I opened the PDF I had created from Word in Acrobat (X Pro). Went to File > Properties. Selected "Change Settings". I then enabled "Restrict editing...", set a password, set "Printing Allowed" to "none", "Changes Allowed" to "none", and ensured that "Enable copying of text..." was disabled.
    I saved the PDF file, closed Acrobat, opened the PDF in Reader, and I was still able to select text and graphical objects.
    I reopened the PDF in Acrobat, and the document summart still shows everything as allowed. When I click on "show details" (from File > Properties) it shows the correct settings.
    Any ideas?

  • How to create a custom shape text field?

    I have a diamond shape movieClip and I need add a text Field in the same shape format.
    Now how to create a diamond shape text field?
    Please help me!
    Thanks,
    Jafy

    there's no easy way to do that in flash.  that's an advanced task.

Maybe you are looking for

  • Server 2012 R2 RDS Personal Collection -reuse VM names after a partial job failure

    I am currently testing RDS on server 2012 R2, and as part of the test I have built and rebuilt multiple collections of VMs. I have noticed that when creating a new JOB to build a personal collection, sometimes I get VM build failures on one host. The

  • Error message when trying to install 10.8.2

    Just bought the new MacBook Pro, and cannot install iPhoto until OS X is updated to 10.8.2.  When trying to install the update, I get this message:  "OS X Update can't be installed on this disk. This volume does not meet requirements for this update"

  • Preloader: Only works on first publish?

    Ok. I have a simple animation composed of two SVG's. The SVG's are quite simple (random dots simulating a starfield). This oam file will ultimately be added to a Muse project. I can successfully publish the animation. I can add the animation to the M

  • Adobe App Manager freeze before being installed (on my OSx)

    Hi, I have a problem installing Adobe Application Manager. I clicked on it on the website. It downloads to my computer I click on it to launch installation. And it freeze. Here is an sample of the process : Sampling process 623 for 3 seconds with 1 m

  • How can i get lightroom to support new camera raw files

    I am getting a new camera camera. An Olympus 510. It will be coming out soon. Will Lightroom be able to convert the raw files to dng when Adobe camera raw supports this new raw file? Or will I have to wait for a new version of Lightroom (which we all