Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2011
    Location
    Parma Italy
    Posts
    88
    Rep Power
    0

    Default How to change line appearance?

    Hi all,

    I would like to dynamically change line plot appearance from solid to dashed or dotted.

    The only solution found is this one:

    using this method

    Java FX Code:
    line.setStyle("-fx-stroke-dash-array: 2 12 12 2;");
    I must use a refresh such as

    Java FX Code:
    pane.getChildren().remove(line);
    pane.getChildren().add(line);
    where pane is a BorderPane.

    otherwise line do not turn to dashed from solid.(Windows XP).

    Is there a different way other than this one?

    What's more, in Linux there is no need to use remove and add, it works correctly.

    Thank you all

    Susie

  2. #2
    Join Date
    Mar 2011
    Location
    Parma Italy
    Posts
    88
    Rep Power
    0

    Default Re: How to change line appearance?

    I have found a solution for this issue by using

    Java FX Code:
    line.getStrokeDashArray().addAll(25d, 20d, 5d, 20d);
    Is there a way to use these values in a variable so to use as parameters?

    In example:

    public static final DASH_LINE = ......

    Regards

    Susie

  3. #3
    Join Date
    Mar 2011
    Location
    Parma Italy
    Posts
    88
    Rep Power
    0

    Default Re: How to change line appearance?

    Yes...

    public static final Double[]DASHED_VALUE = {12d, 2d, 2d, 12d};

    Susie

Similar Threads

  1. Netbeans GUI appearance
    By scrappy in forum New To Java
    Replies: 0
    Last Post: 08-13-2011, 01:40 PM
  2. Change appearance of lines in a JTextArea
    By blackbird in forum AWT / Swing
    Replies: 11
    Last Post: 07-11-2011, 05:58 PM
  3. Line change in String is not working
    By greenhorn in forum New To Java
    Replies: 8
    Last Post: 05-30-2011, 11:17 PM
  4. How to change the appearance of swing components?
    By XmisterIS in forum New To Java
    Replies: 4
    Last Post: 08-25-2010, 10:28 AM
  5. how to change the appearance of jbuttons
    By katie in forum AWT / Swing
    Replies: 1
    Last Post: 08-06-2007, 10:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •