Re: How to set the line height of a Label?

In Java 8, set the graphic of the label to a TextFlow with line spacing set.
Text text = new Text("This is my\nspaced text.");
TextFlow flow = new TextFlow(text);
flow.setLineSpacing(13); // default font size is 13px, so this effectively makes the text double spaced, e.g. one line of text, one blank line, another line of text, another blank line, etc.
Label label = new Label();
label.setGraphic(flow);
For Java 7, I don't know how you would set line spacing for a label.

In Java 8 you can do it even more simply:
Label label = new Label("This is my\nspaced text");
label.setLineSpacing(13);
The line spacing property can also be set with css:
.label {
-fx-line-spacing: 13;
Of course, none of that actually helps to do this in Java 7. If you're not wrapping the text, you can fairly easily split the text at new lines, and add a label for each line to a VBox, specifying the spacing for the VBox as required.
If you're wrapping text, trying something similar gets ugly rather quickly.

Similar Messages

  • How to set the row height for a list control in flex 4.5 for mobile?

    Hi,
      I have a List in my Adobe Flash Builder 4.5 and flex 4.5 mobile application. I show the image and the label in my list. The list item height gets adjusted based on the image height. I don't want this auto row adjustment. Instead I would like to set the row height manually.
    Is there any property to set the item height in a list?

    setting rowHeight in the List layout works for me.
    <s:List>
    <s:layout>
    <s:VerticalLayout rowHeight="48"/>
    </s:layout>
    </s:List>

  • How to set the row height in a JTable

    Is there a way to set the height of a row (actually all rows) in a JTable?
    I have tried setting the font to be bigger but then the cells are not big enough.

    Use "rowHeight" method of JTable class.
    For more information about JTable class, please read the API documentation at http://java.sun.com/j2se/1.3/docs/api/javax/swing/JTable.html
    /Sreenivasa Kumar Majji.
    Is there a way to set the height of a row (actually
    all rows) in a JTable?
    I have tried setting the font to be bigger but then
    the cells are not big enough.

  • How to set the variable height for TileLayout

    Hi,
    I am using TileLayout in  <s:List> component . TileLayout takes the maximum height of the children and draw the same height for rest of the children in all rows. Instead, I want to have all the rows with various heights if their children have different heights.
    I know there is variable height property in <mx:List> component but which is not there in its spark counterpart. Can you please help me with this issue??
    Thanks,
    Bhoja

    The spark TileLayout class lays out all of its elements in equally sized "cells".  Cells of variable sizes is not currently supported.

  • HELP !! change the line height in JTextArea ??

    can anyone tell me , how to change (set) the line height in JTextArea ???

    Looking at the source code for JTextArea, the rowHeight is taken from the font's FontMetrics and is used to set the preferred size of the ta, as you can see in the following app. Also, only three properties are maintained by the default PlainDocument as shown in the output. Might be worth your while to check out JTextPane.
    import java.awt.*;
    import java.awt.event.*;
    import java.beans.*;
    import java.text.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    public class TARowHeight {
      public static void main(String[] args) {
        final CustomTextArea ta = new CustomTextArea(5,10);
        ta.addPropertyChangeListener(new PropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent e) {
            System.out.println(e.getPropertyName() + " changed to " + e.getNewValue());
        ta.setLineWrap(true);
        ta.setWrapStyleWord(true);
        ta.setFont(new Font("lucida sans regular" , Font.PLAIN, 16));
        JPanel centerPanel = new JPanel();
        centerPanel.add(ta);
        SpinnerNumberModel model = new SpinnerNumberModel(20,8,36,1);
        final JSpinner spinner = new JSpinner(model);
        spinner.addChangeListener(new ChangeListener() {
          public void stateChanged(ChangeEvent e) {
            int height = ((Integer)spinner.getValue()).intValue();
            ta.setRowHeight(height);
            ta.revalidate();
            ta.repaint();
        JPanel southPanel = new JPanel();
        southPanel.add(spinner);
        JFrame f = new JFrame();
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.getContentPane().add(new JScrollPane(centerPanel), "Center");
        f.getContentPane().add(southPanel, "South");
        f.setSize(300,200);
        f.setLocation(400,400);
        f.setVisible(true);
        System.out.println(ta.getRowHeight());
        Dictionary names = ((AbstractDocument)ta.getDocument()).getDocumentProperties();
        Enumeration keys = names.keys();
        Enumeration values = names.elements();
        while(keys.hasMoreElements())
          System.out.println("key: " + keys.nextElement() +
                             " value: " + values.nextElement());
    class CustomTextArea extends JTextArea {
      private int rowHeight;
      public CustomTextArea(int rows, int cols) {
        super(rows, cols);
      protected int getRowHeight() {
            if (rowHeight == 0) {
                FontMetrics metrics = getFontMetrics(getFont());
                rowHeight = metrics.getHeight();
            return rowHeight;
      protected void setRowHeight(int rowHeight) {
        int oldVal = this.rowHeight;
        this.rowHeight = rowHeight;
        firePropertyChange("rowHeight", oldVal, rowHeight);
    }

  • Can the next version please allow for the line height to be zero in a text box? I can only go down to .01?

    I want to create a flipping calendar. I had this brilliant idea of putting each date 01 02 03, etc in one text box, with a hard return in between, and then set the line height to zero. Then set the type to appear one paragraph at a time. It would eliminate 20 animation steps. It worked beautifully except that I can't get the line height to set to zero. It will only go to .01. Bleh!
    So please, Can the next version allow for the line height to be zero in a text box?
    Also, separate timelines would be nice instead of one long string so it would be easier to have more than one animation happening at once.
    Just a thought.
    PS - I also noticed it would be nice to have the option of having the first line in a text box dissappear or dissolve or flip out before the next one comes in, rather than just each building in on top of each other.

    In these forums you are just talking to users, not developers. To provide your feedback, in Keynote go to Keynote Menu>Provide Keynote Feedback and send your request that way.

  • How to set border lines in table and also in template in the smartforms ?

    How to set border lines in table and also in template in the smartforms ?
    As I have to create table with following detals
    total row = 3
    row1 = 3 column
    row2 = 6 column
    row3 = 9 column
    for 2nd and 3rd row data to be fetched using coding.
    so can anybody explain me what should i use
    Table or Template ?
    and I want the border like excel format.
    Can anybody suggest me ?
    Thanks
    naresh

    if the data is multiple i.e. line items choose table.
    if the data is single i.e. fixed choose template.
    Create table
    >  Draw u r no lines
    > choose option select pattern
    > select display framed patterns
    Choose u r required one.
    out lined, or full lined. u can choose option.
    same procedure to be followed for template also.
    with regards,
    Kiran.G

  • Sending image sequence job to compressor in command line : how to set the framerate?

    Hello,
    In Compressor, when you import a image sequence, it's possible to set the framerate and add an audio file before choosing a preset and lauching the encoding task.
    I want to dlo the same thing with command line. I know how to send a compressor job with command line, but no how to add theses settings.
    In the compressor command line help, we've got this :
    Job Info: Used when submitting individual source files. Following parameters are repeated to enter multiple job targets in a batch
              -jobpath <url> -- url to source file.
                                               -- In case of Image Sequence, URL should be a file URL pointing to directory with image sequence.
                                               -- Additional parameters may be specified to set frameRate (e.g. frameRate=29.97) and audio file (e.g. audio=/usr/me/myaudiofile.mov).
    So there are also framerate and audio parameters in command line but i've no idea how to write the command line with theses parameters
    Here is an example of command line for Compressor (by Apple) :
    ./Compressor ‑clusterid tcp://127.0.0.1:51737 ‑batchname myBatch ‑jobpath /Volumes/Source/ShortClips/NTSC24p.mov ‑settingpath /Users/stomper10/Library/Application\ Support/Compressor/PhotoJPEG.setting ‑destinationpath /Users/machinename/Movies/myDestinationFilename.mov.
    Thank you for your help!

    You can see in the command sh running-config command
    show running-config : Displays the current access point operating configuration
    Use the guest-mode SSID configuration mode command to configure the radio interface (for the specified SSID) to support guest mode. Use the no form of the command to disable the guest mode.
    [no] guest-mode .
    Here is the guideline for usage
    The access point can have one guest-mode SSID or none at all. The guest-mode SSID is used in beacon frames and response frames to probe requests that specify the empty or wildcard SSID. If no guest-mode SSID exists, the beacon contains no SSID and probe requests with the wildcard SSID are ignored. Disabling the guest mode makes the networks slightly more secure. Enabling the guest mode helps clients that passively scan (do not transmit) associate with the access point. It also allows clients configured without a SSID to associate.
    Examples
    This example shows how to set the wireless LAN for the specified SSID into guest mode:
    AP(config-if-ssid)# guest-mode
    This example shows how to reset the guest-mode parameter to default values:
    AP(config-if-ssid)# no guest-mode

  • HOW TO SET THE OUR OWN LINE SPACING ?

    hai frenz...
    i jus wanted to know how to set the our own spacing between the records or lines...
    i.e.,
    there shub be no spacing between the records when its getting displayed...
    for e,g.,
    actually my records are in the output screen displaying like this.....
    hyundai   100    200
    maruthi    100   300  
    tata         200    200
    but i want to be displayed like this...
    hyundai   100    200
    maruthi    100   300  
    tata         200    200
    how to do that........ reply me....

    Hi,
    Use SKIP Abap Statement
    SKIP 2.
    SKIP TO LINE 1.
    SET BLANK LINES {ON|OFF}.
    Example
    REPORT demo_skip NO STANDARD PAGE HEADING.
    DATA sum TYPE i.
    TOP-OF-PAGE.
      SKIP.
      ULINE.
    START-OF-SELECTION.
      DO 10 TIMES.
        WRITE / sy-index.
        sum = sum + sy-index.
      ENDDO.
      SKIP TO LINE 1.
      WRITE: 'Numbers with sum' COLOR COL_HEADING,
              sum               COLOR COL_TOTAL.

  • How to set the focus on the new added line in ALV list (OO)

    Dear Friends,
    I have an ALV list based on OO(using alv_grid->set_table_for_first_display), when I click the 'new' button to add a new line, the mouse arrow is always pointing to the first line - not the new created line for user to input!!.
    So how to set the focus (mouse arrow) on the new added line in ALV list for user to input it friendly?
    Thanks a lot!!

    Hello,
    To get the selected line row first we have get all the rows in the internal table.
    When u click on the button when it is creating the new line we have to pass the row number to the call method
    CALL METHOD <ref.var. to CL_GUI_ALV_GRID > ->get_selected_rows
       IMPORTING
          ET_INDEX_ROWS  =   <internal table of type LVC_T_ROW > (obsolete)
          ET_ROW_NO      =   <internal table of type LVC_T_ROID > .
    CALL METHOD<ref.var. to CL_GUI_ALV_GRID>->set_selected_rows
       EXPORTING
          IT_ROW_NO  =  <internal table of type LVC_T_ROID>
       or alternatively
       IT_INDEX_ROWS  =  <internal table of type LVC_T_ROW>
          IS_KEEP_OTHER_SELECTIONS  =  <type CHAR01>.
    http://help.sap.com/saphelp_erp2004/helpdata/EN/22/a3f5ecd2fe11d2b467006094192fe3/content.htm

  • How to set the SCLK & SDO lines low...

    Using a USB-8451 and need to set both the SCLK & SDO lines low as part of a prefix packet that I am sending to a device.  how do I do it in LabView?
    I can set the SCLK low using the 0 (Idle Low) input to the 8451 Config Property node but am not sure how to set the SDO low as needed.  

    steve05ram360 wrote:
    Yes it is SPI.  The device is an MB16024 LED driver from Macroblock.
    Are you actually referring to the http://www.mblock.com.tw/products_mbi6024.html? (Note the "I" instead of the "1") Where does it say it's a SPI device? I don't see it saying SPI anywhere on that page. Do you have the actual datasheet? I was unable to find it on their web site.
      maybe I cannot use the 8451 for this task??  ... 
    You can always use bit-banging mode.

  • Please help me :How to set the width and height for my View page "test.htm"

    Hi,
        I have controller class. When i call the view[test.htm]from this controller class ,i am getting the view with output tableview..it is fine.
    My requirement:
                 the output view window is showing full browser window. I want the view output like showModeldialog. I want to set the width and height for the output view window. How is possible?
                 or
    i want to call the test.view in the window.showModelDialog..
    Please help me .. Urgent requirement.

    Yes you can set the width & Height of the view as follows..
    <div style="width:580px; height:750px; margin-top:15px; overflow:auto;">
    <htmb:form......>
    </htmlb:form>
    </div>
    <i>*Reward each useful answer</i>
    Raja T

  • How to set the caller tune on PRI-Line/CUCM 8.X

    Hi Team,
    If passible to set the caller tune songs or advertising in CUCM 8.x -( in place of ringing).
    How to set the caller tune for incoming calls( advertising), including 4 digit extension. This feature is available or not (cucm 8.0.3) Kindly verify and confirm
    regards,
    Johnson

    Dear Team,
    Now i have configured the Call Queuing, Its working fine, But how to verify to incoming calls or Missed call  are in queuing, how to showing. 
    Connected call are showing, but unable show missed call like who ever in queue.
    Regards,
    Johnson.

  • SRM 4.0- How to set the default values for product type (01) only for SC

    The radio button “Service” should not be visible.
    Also for search help (e.g. search for internal products) where a search should only be possible for product type 01 (goods). The system should not display the product type and internally always search for goods only.
    How to set the default values for product type (01) only for SC
    We needs to use Search help BBPH_PRODUCT which having parameter PRODUCT_TYPE
    Here we can set defalut value 01 but it is not correct one since same search help is using several places.
    We need to limit the search help results only for SC.
    Kindly help out me ASAP.

    The easiest way to set defautl values is to edit the batch class.
    Goto the characteiristic and go to update values.
    In here you probably have something like 0 - 100 as a spec range.
    On the next line enter the default value within this range.  At the end of the line, click in the box in the column labelled "D".  This indicates the defautl value for the characteristic.
    If you need to you can do this in the material classification view as well.
    Just to be clear, these values will only show up in the batch record.  You can not have defautl values in resutls recording screens.
    FF

  • How to protect the lines in smartforms

    hi gurus
    i want to know how to protect the line in smartforms..
    regards
    baskar

    Check this link.
    http://www.saptechies.com/smartforms-protect-lines-in-main-window/
    if you are using tables, there are two options for protection against line break: – You can protect a line type against page break. – You can protect several table lines against page break for output in the main area.
    Protection against page break for line types – Double-click on your table node and choose the Table tab page. – Switch to the detail view by choosing the Details pushbutton. – Set the Protection against page break checkbox in the table for the relevant line type. Table lines that use this line type are output on one page.
    Protection against page break for several table lines – Expand the main area of your table node in the navigation tree. – Insert a file node for the table lines to be protected in the main area. – If you have already created table lines in the main area, you can put the lines that you want to protect again page break under the file using Drag&Drop. Otherwise, create the table lines as subnodes of the file. – Choose the Output Options tab page of the file node and set the Page Protection option. All table lines that are in the file with the Page Protection option set are output on one page
    Regards,
    Maha

Maybe you are looking for

  • List of PO's related to Condition record_tax amount

    Hi MM gurus Scenario ; Import scenario - there is a list of PO's created with Tax condition.But the tax will be applied during the invoice. Before creating the invoice need to the list of PO's and its tax amount. Is there any standard SAP transaction

  • Detemining MAC addresses on WS-C2950G switches

    On my old WS-C3500XL switches (running IOS ver 12.0(5)WC5(fc1), I could input the following IOS command and figure out the MAC address of hosts that are connected to any switch port interface (int fa0/1 in the example below): 3500xl# show mac int fa0

  • ITunes launching error?! xO

    Whenever i double click my itunes, it shows the loading sign then a few seconds later nothing happens. I would really appreciate it if someone could tell me what's going on and how I could fix this problem!! xd Dell dimension 2400 Windows XP

  • Not able to delete any Entity Dimension members

    Hi All, I am trying to delete some Entity Dimension members but its not allowing me to delete. This problem is only for Entity Dimension. I can edit Entity member name or properties successfully but not able to delete or move the position. I also tri

  • PDF Compare - Server Side

    It looks like using the below code one can automate comparing of two PDF documents. I wish to know if Acrobat X Pro can be used for a server based automation and if not which version is advisable. We wish to automate PDF compare on server side to wor