is there a way to change the size of a checkbox in JavaFx 8? The default size is pretty big and I found no way to change it, not with css nor by using the API of the checkbox control itself.
If you want to change the box's size of the CheckBox,you can use:
.check-box > .box {
-fx-padding: 10px;
}
and you also want to change the check mark,you can use:
.check-box > .box > .mark {
-fx-padding: 10px;
}
with the above css you can get a preview
All the javafx's built-in css selectors are in com/sun/javafx/scene/control/skin/caspian/caspian.css of jfxrt.jar
Hey you could use the padding to achieve that.
Here is an example with radiobuttons.
Javafx 2.0 : How to change the size of the radio-buttons circle with CSS?
Should be the same in JavaFX 8 since its done with css
The CheckBox class provides several methods to set the size. .setPrefSize() takes two doubles that set the preferred width and height.
CheckBox box = new CheckBox();
box.setPrefSize(prefWidth, prefHeight);
Related
Is it possible to change the width of a row? I have some rows with JSON data. It would be best to display them in a <pre> tag so that the user can view it naturally, but this seems to be impossible.
So now I'm wondering is it possible to remove the default overflow-x: hidden? And to just let the user scroll to the end of a row? Instead of the text just having 3 dots at the end, because there's a max-width.
In the data-grid css api they show the necessary classes which could be overridden, and at the end they say:
You can override the style of the component thanks to one of these customization points
...
So you could add the following style rule to override the default one :
.MuiDataGrid-root .MuiDataGrid-cell {
text-overflow: initial;
overflow-x: auto;
}
I am using component based architecture and want to show bootstrap modal which gets adjusted to image height and width.
Most of the forums suggested to use height and width in percent but this will not going to help as image size can vary.
Has anyone achieved this?
There's a simple solution for this. first of all you will need to override the modal's width property (height is auto adjustable and shouldn't be a problem), the modal window uses the .modal-dialog class, so use !importent to override width
.modal-dialog {
width: fit-content !important;
}
content-box will adjust the width according to what the element contains.
here's a demo
In Angular js ui rid, how can I remove vertical and horizontal scrollbars ?
And also for each column heading I am getting a little carrot icon by default, which shows sort ascend, sort descent, Hide column. I want to remove this also from my column headings.
Instead .table-striped which comes by default for ui grid, I want to use .table-bordered. Is there any place to set these parameters to ui grid?
enableHorizontalScrollbar : 0,
enableVerticalScrollbar : 0,
enableSorting : false,
enableColumnMenus : false;
Good answer from #Asqan answering the first part of your question. For the second part:
Instead .table-striped which comes by default for ui grid, I want to use .table-bordered. Is there any place to set these parameters to ui grid?
I'm thinking you mean you want the look in this plunker I created.
You can solve these css issues in one of two general ways.
1) Customize the ui-grid css
2) Leave the original ui-grid css then override it in your own css file
I've shows the first option to solve your "stripped" issue and the second option to implement your desired border. I have done both for example only so you can see both options - I recommend choosing and using consistently one method or the other.
The ui-grid sets the ".table-striped" look to which you are referring in the css. You can override this either in you own css file or using the customizer tool and setting the #rowcoloreven and #rowcolorodd fields to the hex code for white #ffffff. This will update the ui-grid css to contain the below:
.ui-grid-row:nth-child(odd) .ui-grid-cell {
background-color: #ffffff;
}
.ui-grid-row:nth-child(even) .ui-grid-cell {
background-color: #ffffff;
}
For ".table-bordered" see specifically in the style.css file these added lines
.ui-grid-cell {
border-style: solid;
border-bottom: 1px #ff0000;
}
my requirement is to have colours in combo box instead of textual value as "RED", "GREEN" in dropdown. am trying to achieve this using EXTJS 4.2. Could any one please help me how to configure the combobox.
is there any way to add colour images as values to combobox.
You should use listConfig config to change the behaviour of combobox picker. (For more information: http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.form.field.ComboBox-cfg-listConfig)
Perhaps you give the combobox element a css class (e.g. 'foo'), or style tag, and then set the background-color with CSS
.foo{
background-color: red
}
It can be done by setting 'background-color: color; background-image: none;'
Take look at this expamle
If I set a sufficiently long label for any kind of form element, or the title of a FieldSet, it just grows horizontally forever if I set labelAlign to right. How can I force these to wrap to the next line instead of creating horizontal scrollbars?
You will need to override the default CSS which forbids wrapping (white-space: nowrap). This should do the job:
.x-form-fieldset-title,
.x-form-label {
white-space: normal;
}
Example:
I think using the labelWidth property for a field will give you the desired result.