javafx-2

Viewing large log files in JavaFX in a ListView

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 05:35:11
问题 I have written a JavaFx App to view log files. The files are opened each in a new tab and I run through the text and add it to the list views. I have created a cellfactory to highlight certain text in the list file and that is all working. The problem is that the log files are between 800-1300Mb. Opening 3-4 at once and the JVM reached its memory limit. Is there another way to do this to only have the text currently being displayed in the list view in memory and as I scroll load more into

Dealing with null values in Cell

二次信任 提交于 2019-12-23 04:53:35
问题 I'm having serious problems getting a JavaFX 2 TableView to deal with null values in my data. So much trouble in fact I've put together a simple demo of the problem which is shown below. Essentially the problem is that some of my data may be null and coercing the null to a value, such as an empty string, is not valid, it must be null. In the real code I'm working on I have a null date value, to keep the example simple I've shown a null string below. Rows 1 and 2 of the table have null values.

JPA createEntityManagerFactory “Unknown Source” error (non-J2EE)

限于喜欢 提交于 2019-12-23 04:25:06
问题 I can't find what's wrong: many people seem to have issues with creating a EntityManagerFactory using the PU name. But I've checked all the suggestions, and none helped so far. I'm trying to build my first JavaFX2 app. It is a small dictionary application, originally built on the Netbeans Application framework (by extending the default "Master-Detail" generated classes). It uses a SQLite db. I'm now porting it over from there to another (JavaFX2-enabled) project. I first set out to rebuild

Place an image on a PDF file using JavaFX

我与影子孤独终老i 提交于 2019-12-23 03:41:41
问题 I've manged to place text into a pdf file using Javafx and PDFbox from Apache. Now I am trying to place an image from taking a screen shot of a scene, to the pdf document. WritableImage snapshot = quotes.getScene().snapshot(null); PDDocument doc = null; PDPage page = null; PDXObjectImage ximg = null; BufferedImage bufferedImg = SwingFXUtils.fromFXImage(snapshot, null); try{ doc = new PDDocument(); page = new PDPage(); doc.addPage(page); PDPageContentStream content = new PDPageContentStream

Place an image on a PDF file using JavaFX

可紊 提交于 2019-12-23 03:41:32
问题 I've manged to place text into a pdf file using Javafx and PDFbox from Apache. Now I am trying to place an image from taking a screen shot of a scene, to the pdf document. WritableImage snapshot = quotes.getScene().snapshot(null); PDDocument doc = null; PDPage page = null; PDXObjectImage ximg = null; BufferedImage bufferedImg = SwingFXUtils.fromFXImage(snapshot, null); try{ doc = new PDDocument(); page = new PDPage(); doc.addPage(page); PDPageContentStream content = new PDPageContentStream

How to handle multiple event types from one class in JavaFX?

懵懂的女人 提交于 2019-12-23 02:36:35
问题 In JavaFX, is it possible to handle multiple event types (e.g. ActionEvent, MouseEvent, etc.) from one class, without anonymous EventHandlers? I tried the following, but that just created a compile-time error. public class GUI extends Application implements EventHandler<ActionEvent>, EventHandler<MouseEvent> 回答1: Yes, but not in the way that you are expecting. You cannot, as far as I know, implement the same interface twice, even with different types. EventHandler<ActionEvent> and

How to solve the overlapping of the controls each other belonging to two different panes

孤街醉人 提交于 2019-12-22 18:56:30
问题 Trying to make a toggle button that hides/shows the right window/pane. Here is a demo example : package demoapp; import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.layout.*; import javafx.scene.text.Text; import javafx.stage.Stage; public class DemoApp extends Application { private static final

JavaFX - Zoom relative to mouse position

白昼怎懂夜的黑 提交于 2019-12-22 18:26:51
问题 I can't get working zoom relative to mouse position in JavaFX. I've read and tried rewrite this and this, but it's not working. Can't scroll viewport using scrollPane.setViewportBounds() . I must use scrollPane.setHvalue() and scrollPane.setVvalue() , but can't get right recalculation to keep the same pixels under the mouse cursor. Current code keeps scrollbars positions: ZoomHandler.java import javafx.event.EventHandler; import javafx.scene.control.ScrollPane; import javafx.scene.input

How to set tab name size in JavaFX

孤人 提交于 2019-12-22 13:54:03
问题 I have this simple tabs example: primaryStage.setTitle("Tabs Test"); Group root = new Group(); Scene scene = new Scene(root, 600, 500, Color.WHITE); TabPane tabPane = new TabPane(); BorderPane mainPane = new BorderPane(); //Create Tabs Tab tabA = new Tab(); tabA.setText("Main Component"); tabA.setClosable(false); // da se mahne opciqta da se zatvarq tab //Add something in Tab StackPane tabA_stack = new StackPane(); tabA_stack.setAlignment(Pos.CENTER); tabA_stack.getChildren().add(accordion);

JavaFX WebView Not Loading HTTPS Page

人盡茶涼 提交于 2019-12-22 12:23:24
问题 I have written a browser using the JavaFX WebView control. Everything is fine until I try to load an encrypted page. I try https://www.gmail.com and I get an "Unknown Error" in the exception property of the load worker. This only happens when I package the application as a stand-alone; when I run the project in NetBeans everything is fine. I am guessing it has to do with SSL certificates, but I tried pretty much everything I could think of, including importing each certificate in the trust