javafx-8

Where can I find the JDK 8/JavaFX 8 source code? [closed]

爱⌒轻易说出口 提交于 2019-12-17 19:57:36
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I would like to override the Implementation of FXMLLoader and recompile the JDK 8. Where can I find the source code of the JDK8 / JavaFX 8 ? 回答1: The source for JavaFX 8 is available at: http://hg.openjdk.java.net/openjfx/8/master/rt JavaFX 8 is almost completely open source today. Instructions for building

Get the weeknumber from a given date in Java FX

强颜欢笑 提交于 2019-12-17 19:49:41
问题 I have a javafx.scene.control.DatePicker. I want to extract the (Locale) week number from the selected date. Until now i haven't found a solution and i prefer not to write my own algorithm. I use Java8 and hope it is possible in the new java time library. 回答1: The Java-8-solution can take into account the local definition of a week using the value of a date-picker: LocalDate date = datePicker.getValue(); // input from your date picker Locale locale = Locale.US; int weekOfYear = date.get

java.lang.IllegalArgumentException: Invalid URL or resource not found

依然范特西╮ 提交于 2019-12-17 19:39:27
问题 I tested this code: public static void main(String[] args) { Application.launch(args); } @Override public void start(Stage primaryStage) { // Image Image image = new Image("za.png"); ImageView imageView = new ImageView(); imageView.setImage(image); // Text Text t = new Text(); t.setText("Do you want to quit?"); // Buttons Button btnYes = new Button("Yes"); Button btnNo = new Button("No"); btnYes.setStyle("-fx-background-color:\n" + " #090a0c,\n" + " linear-gradient(#38424b 0%, #1f2429 20%,

JavaFX indeterminate progress bar while doing a process

这一生的挚爱 提交于 2019-12-17 19:37:02
问题 I am trying to insert to my database's one table but this process takes some minutes. I would like to have a indeterminate progress bar while my application is trying to insert. In order to have progress bar, I want to use JavaFX but I don't know how to implement it that it just has be shown until the end of inserting in to the database process. 回答1: JavaFX Tasks are probably the way to go. They provide a way to execute long-running tasks in the background without freezing the user interface.

How i can use jfreeChart with Javafx2

和自甴很熟 提交于 2019-12-17 19:32:31
问题 For a JavaFX2 Application I have to show different types of Charts.I am using jfreeChart for Charts creation and code given below: public static JFreeChart generatePieChart() { DefaultPieDataset dataSet = new DefaultPieDataset(); dataSet.setValue("China", 25); dataSet.setValue("India", 25); dataSet.setValue("United States", 50); JFreeChart chart = ChartFactory.createPieChart( "World Population by countries", dataSet, true, true, false); return chart; } This returns me a chart object. How can

How to make canvas Resizable in javaFX?

删除回忆录丶 提交于 2019-12-17 18:56:15
问题 In javaFX to resize a canvas there is no such method to do that, the only solution is to extends from Canvas. class ResizableCanvas extends Canvas { public ResizableCanvas() { // Redraw canvas when size changes. widthProperty().addListener(evt -> draw()); heightProperty().addListener(evt -> draw()); } private void draw() { double width = getWidth(); double height = getHeight(); GraphicsContext gc = getGraphicsContext2D(); gc.clearRect(0, 0, width, height); } @Override public boolean

JavaFx animation poor performance, consumes all my CPU

爱⌒轻易说出口 提交于 2019-12-17 17:41:44
问题 I have written the following demonstration program. Four HBox(s) containing one Text node each, are added to the root (Group). The first and last are animated with a timeline to swap their positions. All the HBox(s) have the same css style. The result is a very low 'frames per second' amimation. I have an dual core E7400 2.8Ghz Cpu. The one core was used 100%. I expected the computations to be done in GPU instead. After removing most of the css (especially the shadow effect) the animation

JavaFx scene lookup returning null

末鹿安然 提交于 2019-12-17 17:11:00
问题 Button btn = new Button("ohot"); btn.setId("testId"); itemSection.getChildren().add(btn); Node nds = itemSection.lookup("‪#‎testId‬"); What is wrong with above code?? I am getting nds=null it should be btn 回答1: Lookups in conjunction with applyCSS Lookups are based on CSS. So CSS needs to be applied to the scene for you to be able to lookup items in the scene. See the applyCSS documentation for more information. To get accurate results from your lookup, you might also want to invoke layout,

Is there a JavaFX 8 changelog?

北城以北 提交于 2019-12-17 16:59:30
问题 Now that Java 8 has been released, is there a (reasonably comprehensive) changelog around for JavaFX 8, and if so where is it? The only thing I've been able to find is here where FX is a subcategory, and it's clearly not a full list (I'm already aware of a few things that have changed or been fixed that aren't on there.) 回答1: I find the Java 8 what's new page you linked a pretty good summary of new features in JavaFX 8. For more detail on the JavaFX changes for Java 8, see the JavaFX issue

How to draw image rotated on JavaFX Canvas?

耗尽温柔 提交于 2019-12-17 16:59:30
问题 I want to draw image on canvas rotated. with drawImage(image, 0, 0) I can draw image but how can I rotate that image for example 45 degrees and draw it and then draw other image with -50 degrees rotation after previous image on the same canvas? graphicContext2D does not work for me because it rotate all canvas content. So how can I do that? 回答1: Here is a sample, following similar principles to Katona's answer, only difference is that it rotates images about arbitrary pivot points by applying