javafx-2

How to adjust letter-spacing in JavaFX

好久不见. 提交于 2019-12-22 06:03:02
问题 When using JavaFX2, how can i adjust the letter-spacing between characters of a Text object? Examples either in code or css are welcome. 回答1: I wonder if this might point you in the right direction. I found the information here ... This article talks specifically about letter spacing... package addingfontinstyle; import javafx.scene.effect.DropShadow; import javafx.scene.effect.GaussianBlur; import javafx.scene.effect.light.DistantLight; import javafx.scene.effect.light.SpotLight; import

Datepicker in JavaFX 8

放肆的年华 提交于 2019-12-22 05:54:58
问题 Is there any implementation of Date Picker and Time Picker into the default JavaFX 8 package that I can use without using third party solutions? 回答1: DatePicker Yes, Java 8 has a DatePicker: import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.DatePicker; import javafx.stage.Stage; import java.time.LocalDate; public class PickerDemo extends Application { @Override public void start(Stage stage) { final DatePicker datePicker = new DatePicker(LocalDate

JavaFX 2.x: Translate mouse click coordinate into XYChart axis value

↘锁芯ラ 提交于 2019-12-22 05:23:38
问题 In JavaFX 2.x, I am using an XYChart and I want to display the (X,Y) axis coordinate values of the chart as the mouse move across the chart. I setup an event handler on the chart to handle setOnMouseMoved events. However, I am not sure how to convert the MouseEvent's getX() value into the chart's coordinate value? 回答1: Use axis.getValueForDisplay(displayPosition) to determine the location of the mouse in axis value coordinates: xAxis.getValueForDisplay(mouseEvent.getX()), yAxis

How to rotate the LinearGradient in a given Shape?

落花浮王杯 提交于 2019-12-22 05:13:53
问题 I try to find the way to rotate the LinearGradient object nested into e.g. Rectangle object, say: Rectangle rect = new Rectangle(0, 0, 200, 200); LinearGradient lg = new LinearGradient(0, 0, 100, 0, false, CycleMethod.REPEAT, new Stop[] { new Stop(0, Color.BLACK); new Stop(0.5, Color.WHITE); new Stop(1, Color.BLACK); }); rect.setFill(lg); Now, I try to rotate this lg object, for example for 45 degrees to the left, but without rotating the whole rect . Is there any way to achieve that? 回答1:

How to get current screen details in javafx?

╄→гoц情女王★ 提交于 2019-12-22 04:40:34
问题 I have multiple monitor connected with my PC. From javaFX I can get primary screen. But I need to know about the screen details of the screen the stage currently is. How can I get that? 回答1: Try to use getScreensForRectangle with the x, y, width and height of your window. 来源: https://stackoverflow.com/questions/20176340/how-to-get-current-screen-details-in-javafx

JavaFX 2.0 Table with multiline table header

↘锁芯ラ 提交于 2019-12-22 04:20:15
问题 Is it possible to make javaFX 2.0 table with multiline header? All the examples, which i have found on the web, have tables, where columnt header width = its text size, without wraping. The exaple of what i have, and what i need is shown on a screen: 回答1: I came up with the following function: private void makeHeaderWrappable(TableColumn col) { Label label = new Label(col.getText()); label.setStyle("-fx-padding: 8px;"); label.setWrapText(true); label.setAlignment(Pos.CENTER); label

How to style JavaFX 2 Fullscreen message?

僤鯓⒐⒋嵵緔 提交于 2019-12-22 03:39:23
问题 Going to Fullscreen mode in JavaFX causes a giant message telling the user that he can leave this mode pressing ESC . Not only this takes the "desktopish" feeling off my application, it also looks ugly. I guess this message is not ment to be suppressed, so my hope is that i can at least brand it. So, how can i style it? 回答1: There is a requests to Allow trusted apps to disable the fullscreen overlay warning and disable the "Exit on ESC" behavior and Touch Screen only - Press ESC to exit full

How to merge cells in JavaFX Scene builder?

蓝咒 提交于 2019-12-22 02:30:31
问题 I have a gridpane looks like a KeyBoard, and I need to merge some cells to put a "Space" button.. But I cant find any option in the settings of the gridpane which would solve my problem.. Does anyone have an idea how I could achieve it? 回答1: Setup your Grid with items in it Create a GridPane. Place nodes in the grid. Select a node in the grid. It is very, very important that a node in the grid be selected at this stage . . . After that either: A. Use the Menu Items Choose Modify | GridPane

javafx adding button to grid pane

青春壹個敷衍的年華 提交于 2019-12-22 00:29:22
问题 I am adding button to grid pane dynamically but after giving them function they all show same function and i don't knows why? import java.awt.Panel; import java.net.URL; import java.util.ResourceBundle; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.Button; import javafx.scene.layout.GridPane; public class TestController implements Initializable { @FXML Panel mpanel; @FXML GridPane

Limit width size of Bar chart

泪湿孤枕 提交于 2019-12-22 00:28:26
问题 I created simple example of Bar Chart but I notices that size of the bar fits the chart. How I can limit the size? Foe example I would like to limit the width size. 回答1: As we already discussed here, to set a maximum width on every bar, we have to change either barGap or categoryGap accordingly, every time the scene or the chart are resized. The only difference from the refered question, is we have to resize the chart the first time is displayed. Based on the same code, let's create the