Skip to content
Advertisement

JavaFX “Location is required.” even though it is in the same package

I am trying to get my JavaFX program to run but am having some difficulty. I keep getting an error of ‘java.lang.NullPointerException: Location is required.’ The fxml file is in the same package as Application class. Here is my very simple code: And here is a copy of my main.fxml file: The controller class does exist and is in the

Copy image from JavaFX application and paste it using Windows

I am working on a JavaFX application. I want to copy image from application using context menu and paste it using Windows feature of paste. For example, like shown below in images. And want to paste at location from using of Windows features menu. Answer Use the Clipboard and ClipboardContent, e.g. as: For the “Paste” operation of Windows context menus

Collect successive pairs from a stream

Given a stream such as { 0, 1, 2, 3, 4 }, how can I most elegantly transform it into given form: { new Pair(0, 1), new Pair(1, 2), new Pair(2, 3), new Pair(3, 4) } (assuming, of course, I’ve defined class Pair)? Edit: This isn’t strictly about ints or primitive streams. The answer should be general for a stream

Resolve a dependency on package sun.misc with Tycho

I try to convert a Buckminster-based build to Tycho (0.19.0). In our (mirrored) target platform we have the bundle com.lmax.disruptor from http://lmax-exchange.github.io/disruptor/ which imports the package “sun.misc” When I try to build our own bundle (that depends on com.lmax.disruptor) I get: [ERROR] Missing requirement: com.lmax.disruptor 3.2.0 requires ‘package sun.misc 0.0.0’ but it could not be found I checked many Tycho

Android: OutOfMemory error and the backstack

the following sheet represents the working flow in the application this question is about. I ran into problems with OutOfMemory Errors, mostly because users were able to switch from activity B to activity D multiple times (They are showing different content for every attempt), without the previous activity being destroyed. This led into a very large backstack resulting in an

How to add multiple JComponents to a JPanel?

I’m trying to add multiple components to a JPanel, but only the most recently added component is displaying. It seems like the problem is that the layout can only handle 1 component at a time, but I’m at a loss as to how to actually fix it. I’ve tried adding the components to a separate panel and then adding that

Unable to load jdbc driver eclipse

I get the following error while trying to load MySQL Driver: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java….

Creating a Java Enum in Scala

My workplace has been experimenting in moving from Java to Scala for some tasks, and it works well for what we’re doing. However, some preexisting logging methods expect a java.lang.Enum. The logging method is defined in the (Java) base class, and the subclasses can define their own enums, which the logger will track across all instances in multiple threads/machines. It

Advertisement