I specified a font in a style .css file:
-fx-background-color: #1e1c1e;
-fx-font-family: "Segoe UI", Helvetica, Arial, sans-serif;
but IDEA underlines the second line:
"mismatched property value null".
Then I tried to set a font in the following way:
inputField.setFont(Font.font("Segoe UI"));
All the same. Font won't change. I'd like to ask your help because I'm stucked with this issue.
Related
I've attempted adding a custom font to my program using CSS and i can't get it to work, is anyone able to help?
This is what i've got at the moment:
#font-face
{
font-family: walterturncoat;
src: url("../resources/fonts/walterturncoat.ttf");
}
.label
{
-fx-font-family: "Walter Turncoat";
-fx-text-fill: #ffffff;
-fx-font-size: 20pt;
-fx-effect: dropshadow(gaussian, #000000, 10, 0, 2, 2);
}
The url works as i used a similar path for an image (just /images/ instead of /fonts/) and i was able to get the font to work outside of CSS in the bulk of the program but i intend to be using it a lot so having it in CSS would be ideal.
I want to style the font of the CalendarTimeTextField Popup control using a CSS File.
The following entry doesn't work for me:
.CalendarTimeTextFieldSkin_popup {
-fx-text-fill: white;
-fx-font-style: italic;
}
Setting the font-type works, changing text color doesn't.
Thanks for supporting me
GGK
The text is rendered with a Text node (https://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html#text) so use -fx-fill and/or -fx-stroke.
I am using a tableview and would like to edit the font inside of it, however since tableview cannot implement a custom font with it's "setStyle" I am forced to rely on CSS
CSS code:
#font-face {
font-family: '8BIT WONDER';
src: url('8BITWONDERNominal.ttf');
font-weight: normal;
font-style: normal;
}
//Style of entire tableView
.table-view{
-fx-font-family: "8BIT WONDER" ;
-fx-text-alignment: center;
}
//Style of each column in the tableView
.table-view .table-column{
-fx-font-size: 15px;
}
//Style of each table cell
.table-view .table-cell{
-fx-font-size: 12px;
-fx-alignment: center;
}
Java line calling the CSS:
leaderScene.getStylesheets().add("leaderboard.css");
The CSS is parsing and is loading, the fonts and styles perfectly display on the table however the terminal still gives this error reguardless
WARNING: CSS Error parsing
file:/D:/Overhaul%20with%20Leaderboard/Overhaul/leaderboard.css: Unexpected
TOKEN [:] at [4,15]
Mar 29, 2018 10:21:45 AM com.sun.javafx.css.StyleManager
loadStylesheetUnPrivileged
INFO: Could not load #font-face font
[file:/D:/Overhaul%20with%20Leaderboard/Overhaul/8BITWONDERNominal.ttf]
Mar 29, 2018 10:33:21 AM com.sun.javafx.css.StyleManager
loadStylesheetUnPrivileged
If there isn't a fix, is there a way to allow the terminal to ignore this error since the css is being loaded and functions correctly?
I'm trying to manipulate the font in Agenda from jfxtras (javafx).
I have a css file linked to it.
I figured out how to make it black and bold as well.
.AgendaText {
-fx-text-fill: BLACK;
-fx-font-weight: bold;
}
But I don't know how to change the font to say, Arial.
Thanks,
Browser will try to take first font, second font and if it wont be able to find it it will serve a sans serif system font
.AgendaText {
font-family: arial, helvetica, sans-serif
}
I have lots of tool-tips in my SmartGWT application and now I want to change the width of each tool-tip without setting width of each individual tool-tip that is most tedious task.
I can set the width of tool-tip in SmartGWT using Canvas#setHoverWidth() but my concern is to apply this setting globally applicable for whole application.
Is there any way in SmartGWT to specify the tool-tip width globally applicable for whole application using CSS or JAVA code?
For sample code have a look at Hovers Tooltips Sample (Smart GWT).
Thanks in advance.
Finally I got the style name that is applied on all the tool-tips.
SmartGWT have a concept of Skinning that is the process of modifying Smart GWT's default look and feel to match the desired look and feel for your application.
A "skin" consists of:
a single CSS stylesheet containing all CSS styles used by Smart GWT components (skin_styles.css)
a single JavaScript file that sets component defaults (load_skin.js)
a directory tree of images organized by component
I found the style canvasHover in skin_styles.css that is used for hovering on Canvas.
I just added min-width: 135px; that changed the width of all the tool-tips globally in the application. By default it's 100px.
/* hover canvas */
.canvasHover,.gridHover,.formHover {
background-color: #fdfdd3;
border: 1px solid gray;
color: black;
font-family: Arial, Verdana, sans-serif;
font-size: 11px;
padding: 5px;
min-width: 135px;
}
Thanks a lot for your attention.
I have no idea about SmartGWT works, but for this kind of dirty things if those elements are attached to the DOM, I'd use GQuery.
Something like:
GQuery.$("#yourTooltipId or .yourTooltipClass", RootPanel.get()).each(new Function() { public void f(Element e){
GQuery.$(e).width(30);
}});
Instead of RootPanel.get(), you can use other scope if for any reason you have all the tool-tips under the same view.