setting the default width or height of a ListView using css?

Is it possible to set the default width and height of a node (ListView) using css?
Just in case I tried with:

. My-list {}
-fx-pref-width: 130;
-fx-pref-height: 100;
}

but it doesn't seem to work.

Not that I know of. Search for "prefWidth" in the documentation for CSS does not work. Provision of JavaFX is generally not managed by CSS, but by FXML and/or Java. You can set the prefHeight and the prefWidth as attributes in the FXML file:


or in Java:

ListView listView = new ListView();
listView.setPrefWidth(130);
listView.setPrefHeight(100);

Tags: Java

Similar Questions

  • Set the explicit width and height of the background picture in HBox

    Hello

    I need set the width and the height of the background image in Hbox. Please give me a sample.

    Kind regards

    Roman.

    Hello

    You can use property backgroundSize, but you must assign a percentage value it. As,

    backgroundSize="100%"
    

    Or you can place the HBox and Image control in a Canvas, such as the Image appears as a background for the HBox. Something like that

    
         
         
    
    
  • When you create a PDF from a scanner, is there a way to set the default value for the size of 8.5 x 11 letter custom every time I make a PDF from a scanner?

    When you create a PDF from a scanner, is there a way to set the default value for the size of 8.5 x 11 letter custom every time I make a PDF from a scanner?

    Hi kevin7frg,

    You can go to "file > create > scanner > configure presets PDF»

    The dialog box that appears, you can choose 8.5 X 11 as the default width and height of PDF pages to scan.

    Hope that helps.

    Kind regards

    Ana Maria

  • Image size default width and height units

    I am now using 2015 and when I open the tool to the size of the Image width and height units are default to inches I want to make Pixels. The size is set to Pixels and resolutions has Pixels/inch, but the width and height units always opens on the thumbs. I checked my preferences, units and leaders, units, the rules are Pixels is of Type Points. But the New Document preset resolutions column size and Point/Pica size and see nothing else to settle.

    What is a 'new' to be stuck with the thumbs everytime I open the size of the Image? It's a pain that I almost never work in inches.

    Then, with the size of the Image open, hold down the ALT key. Cancel button will be Reset.  Click on that and the dialog box will go to the default values. See if that fixes it.

  • How to set the default size for SWF published in Catalyst CS5.5

    I create a project of 800 * 600 pixels in Catalyst CS5.5 and published it as .swf.

    But when I open the .swf that is published, the default size is less than 800 * 600. I have to resize by myself.

    So is there any method I can set the default size for published .swf?

    Thank you guys! Best regards.

    Nick

    When you start the new Flash Catalyst project, you have the option to enable resizing

    This setting is enabled by default.

    If you need to change it later, you can go into edit > settings of the artboard.

    Now when you publish your project, the width and height will be there will substitute.

    As to manually file editting the HTML, there are 3 sets of tag that define the width and height of the project (to manage different browsers). You will need to adjust the values of each of these tag sets. You should just have to do if you cannot republish the file.

    Chris

  • How to set the default display settings in Explorer windown

    Most of the time, Explorer windows of windows 7 has been a disappointment.  When I open it, the right pane is too narrow for most of my file names and I would also like to see the details at the same time.  Drag to expand the functionality (double arrow icon thing) is so sensitive that it usually takes me 4 or 5 tent to catch so I can drag more broad (it disappears usually when I try to move it).  I would like to be able to set a default width in the right pane that is wider than what is happening now, or have something that would make it easier to grasp widen function

    If you are referring to the columns in the Details view, try this:

    1 - click any file or folder to select it.
    2. on your keyboard, hold Ctrl key while pressing the + on the numeric keypad (sorry, it won't work with the sign more near the BACKSPACE key).
    This should automatically adjust the details of the columns to contain the content they contain.
  • How to set the default value of magnification up Page?

    I prefer the option of the Page matches the option to adjust the default width. How can I configure default Page Fit?

    Hi walter2015,

    You can set as a default application in the Page display preferences (in the Zoom pop-up menu).

    Please let us know if that's what you're looking for.

    Best,

    Sara

  • How to configure the size of the symbol % (width and height)

    How to configure the size of the symbol % (width and height)

    shoud you have your symbol in % and also your image in % file, when you have changed both of the theme to % then your image will change as expected.

    and if you want to make your image immutable able and set the position that you need to change your % step also

    I made some photos to show you...

  • How to set the default zoom according to the screen in Linux level?

    Starting from the same account, I can use different types of screens: low and high DPI. I would like to have the font size (and more generally, the zoom level) right of each screen.

    To set the default zoom level, you can set the layout.css.devPixelsPerPx, but we can't define it it fixed-value, which is not OK, because I would like that the value depends on the environment (as for the font size in the menu which is always OK, because it depends on the resource Xft.dpi X 11).

    Note: I have several profiles, while it is not even possible to write a wrapper that could modify the prefs.js file, because I don't know in advance which file would I need to change.

    What can I do?

    One possibility would be to use the mozilla.cfg file in the Firefox program folder.
    This file can contain JavaScript that runs with full chrome privileges and it it not difficult game of the pref layout.css.devPixelsPerPx to a correct value for the screen currently attached.
    You will need to know how to calculate the dimensions of the screen.

  • How to set the default browser after update 35.0

    I've just updated to version 35.0 today. Now, every time I restart my browser that asks me to make Firefox the default browser. I've always said yes and check the box to remember. It does not work. Research help and did what was told to go into Control Panel, then programs and by setting the default value for it. That no longer works. I've never had this problem before. I'm at a loss to know what to do. Any suggestions would be greatly appreciated. Thank you.

    You can check for problems with preferences.

    Delete possible user.js and files numbered prefs-# .js and rename (or delete) the file prefs.js to reset all the prefs by default, including the prefs set via user.js and pref which is no longer supported in the current version of Firefox.

    You can use this button to go to the Firefox profile folder currently in use:

  • Setting the default size of the popup window

    I need a way to set the default size of the popup window on a specific area or all areas (whichever is easier). There is a particular site that pulls up a PDF in a pop-up window, and always default to a small window, but I need full screen. Apart from the obvious 'simply click on the button full screen every time ", can someone offer me some suggestions? If it were me, I'd just hit the button fullscreen, but I'm trying to set it up for some end-users rather capricious. The device in question (if important) is a Tablet from Dell XPS 18, and the version of Firefox is 24.0, just installed about twenty minutes ago. Forums for research, the only thing I found remotely close to what I'm looking for is to force the popup to allow resizing; This isn't what I need; the pop-up window already allows resizing. I need a way to automatically open it full screen. Thanks in advance for your help.

    Where the tab setting you are interested in I mentioned, the method to define who is in this previous post: https://support.mozilla.org/en-US/questions/968159#answer-469644

  • How can I set the default download locations

    How can I set the default download locations?

    You can watch here:

    • Tools > Options > general: downloads
  • cannot set the default home page. home page goes to firefox. the default value in the internet settings and on firefox options help tab

    I went to Cont.Panel and set the default home page and then click on the button Firefox then options and under general set default homepage from Firefox to open but Firefox always opens to the Firefox start page. What can I do else?

    If you choose to restore the default home page then, yes home page on the Mozilla Firefox start page, see for info: How to set the home page

    See also: window - general Panel - Options boot

    Thank you

  • How you set the default on HP3520 to black & white, not color?

    Try to set the default on Mac and Windows 7 b & w

    Your user manual States "for grayscale printing, your printer must have a black cartridge installed." If a tricolor cartridge is installed, remove it so that only the black print cartridge remains in the cradle of the print cartridge. Don't forget to store the print cartridge properly three colors".»

    This is a direct excerpt from your user manual, has no page numbers. If allowing you to view the information. Click on the link, leave the manual loading and then type Ctrl and F, which will bring up a search at the top of the page bar. Type "change default settings" and it will be one of the two hits. Scroll down, check the instructions to default settings and the foregoing quotation will be on the next page under the title "Print in grayscale", I hope this helps.

  • Cannot set the default mail Client

    All,

    I have Office for Mac 2016 installed on my Mac Mini. When I go in the Mail from Mac client to set the default value for Outlook he selects fine, but then when I exit the application and go back inside, he returned back to Mac Mail?

    Assistance to get this resolved would be greatly appreciated!

    I'm under El Capitan 10.11.2 - the latest updates everything up ;-)

    Although the problem is not the same, please follow the instructions in this article to support to reset the launch Services database. Instead of typing the shell command in the article, I suggest that you copy and paste the web page in the Terminal window. Make sure you only select the entire line. One way to do that is triple - click anywhere in the line.

    If you do not already have a current backup, back up all data before proceeding. You should perhaps log out or restart to see a change.

Maybe you are looking for

  • problema com Windows Installer.

    TODO Fez as uso meu pc appears Alana com uma mensagem do Windows Installer dizendo than esta instalando uma, mas had nao estou instalando nada. Cancel e Alana appears several times. JA procurei algo maintains that possa esta dando problema e nada. te

  • Switched roadrunner to you-verse phone service now I can't send a fax. indicating error 351.

    I have an officejet pro 8500 a909n, I used to have phone of roadrunner service, no problem of fax.  Just switch to U-Verse phone and now I can not send fax.  I contacted the support of U-verse, and they said I had to contact my fax machine manufactur

  • Only some inaccessible files on network

    I'm having a problem with access to my files on my network. The problem is not consistent in all files, or even all of the files in certain folders. It all seems like a collection of random files across to the refusal to be open by another PC by PC.

  • Office jet J3680 ask Print - Get "send a Fax" icon

    On the J3680 all-in-one all of a sudden when I hit print, HP screen "Send a FAX" with all requested info fax. I can't get the printer to print any page.  Help!

  • Lightroom develop overview shows negative/RGB

    Whenever I have raise any image to the point the poster in the form of negative/RGB preview image.  It came directly download the software from the start.  Whenever I have add filters, etc. and export, the image turns out ok but the preview never cha