Is it possible to find the Width of a control before he's displayed ?

Hi all,
I have a simple question : Is there any way to compute the size of a control (Label in my case..) before showing it in the scene ?
Thanks before,
Jonathan

Here is another workaround:
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.DepthTest;
import javafx.scene.Group;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.stage.Stage;
import javafx.scene.layout.*;
import javafx.geometry.Pos;
import javafx.geometry.VPos;
import javafx.scene.effect.BlendMode;
public class NodeLength extends Application {
    public static void main(String[] args) {
        Application.launch(args);
    public double getNodeWith(Node n) {
        Stage st = new Stage();
        Group g = new Group();
        g.getChildren().add(n);
        Scene scenex = new Scene(g);
        st.setScene(scenex);
        st.show();
        st.hide();
        return n.getBoundsInLocal().getWidth();
    @Override
    public void start(Stage primaryStage) {
        primaryStage.setTitle("Hello World");
        Group root = new Group();
        Scene scene = new Scene(root, 300, 250);
        TextField username = new TextField();
        username.setPromptText("Username");
        double d = getNodeWith(username);
        System.out.println("d = " + d);
        root.getChildren().add(username);
        primaryStage.setScene(scene);
        primaryStage.show();
}

Similar Messages

  • Using column value is it possible to find the table name in the database?

    Hi all,
    using column value is it possible to find the table name in the database?
    guys i need the table value
    Note:
    oracle-9i
    for example:
    i don't know NIC(column value) in which table in the database.
    Thank you,
    with regards,
    JP.
    Edited by: Guest on Feb 27, 2012 5:42 AM

    Hi,
    As far as I understand what you are asking for I would suggest 4 data dictionaries that will help you to know the table name from the column names
    1. USER_TAB_COLS
    2. ALL_TAB_COLS
    3. DBA_TAB_COLS
    4. COLS
    These can give you detail information about the columns and respective tables at user, schema, dba level. Further information on the table can be found by querying ALL_OBJECTS table giving table_name as Object_name, or you can join the data dictionaries too.
    To know about various data dictionaries avalible in Oracle please query select * from cat;
    Let us know if you need further assistance.
    Twinkle

  • Is it possible to find the Equipment for given PP work center?

    Hello PM Masters,
    Is it possible to find the Equipment for given PP work center?
    Please tell me which table will lend me the EQUNR when I have the PP work center (ARBPL).
    Thank you.

    Yes,
    Provided you maintain this value in Equipment master Location tab like this.
    And then query by this field in IH08
    Jogeswara Rao K

  • Is it possible to find the  table based on the Date ?

    Dear Team ,
    Is it possible to find the table based on the Date ?
    I have created an table ,But forgot the Table Name .
    Is it possible to find the Tables created on particular Date .
    Regards ,
    Augustine

    as date is record the time also below query will work.
    select * from user_objects
    where
    object_type = 'TABLE' and
    to_date(created,'DD-MON-YYYY') =to_date('<your date value in DD-MON-YYYY format>','DD-MON-YYYY');
    Edited by: shaileshM on Feb 24, 2010 9:39 PM

  • Is it possible to find the serial of the last connected device (iPod Nano) in itunes?

    Is it possible to find the serial of the last connected device (iPod Nano) in itunes? Was stolen, trying to get info on my device.

    iTunes will only show the serial number for iOS devices backed up using iTunes (and the iPod nano is not an iOS device). For alternative ways to find the serial number, see:
    On your iPod packaging
    If you still have the original packaging for your iPod, you can find your serial number on the barcode label that's affixed to the packaging.
    On your iPod invoice or receipt
    Some retailers may include the serial number of your iPod on the receipt.
    Online at My Support Profile
    If you used your Apple ID to register or purchase your iPod, you may find the serial number listed in My Support Profile (available in the United States and Canada). Log in with your Apple ID and find your iPod in the My Products box on the main page:
    From iPod: How to find the serial number.

  • Is it possible to find the time a website was visited in safari history?

    Is it possible to find the time a website was visited in safari history?

    See:
    http://www.justanswer.com/computer-programming/7c5qf-iphone-settings-safari-adva nced-website-data.html

  • Is it possible to find the transaction code via table name ??

    Hi
    Can any body please let me know is it possible to find the transaction code via table name ??
    Thanks in advance
    Sesh
    Edited by: seshu_sapfico on Dec 8, 2009 12:21 PM

    Please, specify your requirement... A table could be modified by various programs which are called by numerous transactions.

  • Is it possible to find the i pad version (2, 3 4) from serial number

    Is it possible to find the i pad version (2, 3 4) from serial number ?

    Not sure what this has with ARD but try:
    http://www.chipmunk.nl/klantenservice/applemodel.html
    Regards,
    Shawn

  • Hi, my Iphone was stolen 2 days ago, I have the voxer installed on it, is it possible to find the location of my phone?

    Hi, my Iphone was stolen 2 days ago, I have the voxer installed on it, is it possible to find the location of my phone?

    What is the "Voxer"?
    If you set up the find my iphone feature on the iphone itself and it is on and it has not been restored, then you may be able to locate using icloud.com.
    Otherwise, it cannot be tracked.

  • Finding the width of a JPEG loaded into a movie clip

    I will be loading a page of bio information. Next to the
    person's photo (photos will vary in width) I want to put a column
    of buttons about 20 pixels to the right of the photo. So after I
    load the photo into an empty movie clip, I'm trying to get the
    width of the photo in order to figure out the x position of the
    buttons next to it. Here is what I have:
    myImage = "images/" + _level0.images[link];
    loadMovie(myImage,image_mc);
    // JPEG loads okay into image_mc //
    trace("image_mc._x = " + image_mc._x);
    // I get "Image_mc._x = 393" as expected //
    trace("myImage._width = " + myImage._width);
    // I get "image_mc._width = undefined" //
    trace("image_mc._width = " + image_mc._width);
    // I get "image_mc._width = 0" //
    How do I find the width of the loaded JPEG?

    you are probably trying to get the width before the image has
    loaded completely.. use the MovieClipLoader class to load the image
    into the empty movie clip, then use the onLoadInit event to get the
    movie clips's width(which is the images width);
    var mcLoader:MovieClipLoader = new MovieClipLoader();
    var myListener:Object = new Object();
    myListener.onLoadInit = function(target:MovieClip):Void{
    trace(image_mc._width);
    mcLoader.addListener(myListener);
    mcLoader.loadClip(myImage, image_mc);

  • Is there any vi or possibility to find the hole dates in an directory and to list the data-pfads as a string?

    is there any vi or possibility to find the hole dates in an directory and to list the data-pfads as a string?
    like in windows a search-funtion?
    I have found one VI, it list the data in the directory self (the pfad from the data as string) but not the data in an under-directory. it also has the funktion to list me the under-directory but it do not list the complite data in every directory
    can somebody help me pleace
    THX

    Hallo Chef,
    unter LV8.21 befindet sich die beschriebene Funktion in der File-Palette:
    Dummerweise gibt es die Funktion in LV8 noch nicht... (Deshalb ist es immer eine gute Idee zu sagen, mit welcher LV-Verson man arbeitet!)
    Du kannst aber unter vi.lib/utility/RecursiveDirList.llb nachschauen, wie es gemacht wird
    Message Edited by GerdW on 08-17-2007 11:17 AM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    AdvFileFunc.png ‏10 KB

  • Is it possible to find the serial number of a device with which I signed into my Apple ID, but which was not registered?

    I bought an iPad2 about 2 years ago. It was stolen around 5 months ago, but since I had never registered it with apple, I gave it up for lost. Now I find it is possible to track based on serial number. Is it possible to find the serial number of my iPad without having registered it, since it has been signed into my Apple ID?

    Hi PinkNoiseChick,
    If you have ever sync'd with iTunes, follow Randers4 recommendation in this link:
    https://discussions.apple.com/thread/5832788
    Cheers,
    GB

  • Is it possible to find the mac adress of my stolen macbook pro?

    Is it possible to find the mac adress of my stolen macbook pro? I've mad ea research an found out that the Mac Adress is really important to trace the device. But it's too late to check that on my laptop.. What should i do?

    I understand that. But about your only shot without the box is to supply Apple with the serial number and ask them for the MAC info. My thought was if you can supply the serial number it's more proof that you're the owner. There's really no other way to get it without their help.

  • Is it possible to find the day of buying the ipad by the serialnumber

    My son has a Ipad3 and it making bad sounds sometimes. So is it possible to find the day of buying by the serialnumber

    The serial number will tell you when the iPad was manufactured, but not the day you bought it.
    Look on your receipt or credit/bank card statment for that.

  • I have lost my iphone 5 is it possible to find the imei number of that phone.

    i have lost my iphone 5 is it possible to find the imei number of that phone.

    I just want to repeat what was said up thre thread: make sure you report this phone as lost or stolen to your carrier; this will prevent anyone from wiping it out and registering it as their own phone with service.
    With ios 7 and beyond ,it's not possible to wipe it out and have it set up as a new phone number unless you know the iCLoud ID and password. THat's great, but for iOS 6 you should report it stolen or lost so that it's worthless if someone stole it or found it.
    Your IMEI number is on the box or with the carrier you bought it from. IT won't help you find your phone but you can list it as   lost or stolen.

Maybe you are looking for

  • HT201317 The photo stream flower icon is not showing up on my icloud account?! Why?

    The photo stream flower icon is not showing up on my icloud account.  The only icons are Mail, contacts, calendar and iwrok.  What can I do??

  • PRI + PVDM modems - set IP destination based on DNIS

    I have the following setup: 2811 router PVDM2-12DM modem module on motherboard NM-1CE1T1-PRI PRI card The PRI has a range of numbers assigned to it, but I need to be able to direct dial-in traffic to specific backend IP addresses, based on the number

  • Screen Flicker on one side

    Hi, I use an HP  Mini 210-1099.TU. It has served me very well so far but since a few days the right side of the screen doesnt stop fickering. I have tried system restore to an earlier date and taken all steps as advised by 'Windows Help' regarding br

  • Po text

    Hi, give me some tips on how to upload po haeder text(ekko-f01) and item text (ekpo-f01) together with purchase order upload. Rgds, Madhu

  • JTree leaf selection

    hi guys, I am developing a jTree for a networking product,which will show all the network elements present in the network.The tree also shows the device status like Up,Down etc.I have provided a button to refresh the jtree to update the status of the