Why this for loop is infinite?

I have such for loop and when step is (0;1) it becomes infinite. If step is [1;..) it works well. public interface FindMinI { double function(double x); static double findMinOfFuncOnInterval(int begin, int end, double step, FindMinI func) { dou...
more »

2017-11-11 18:11 (3) Answers

Jpanel Move items freely at design time

I am very new to Java Swing programming and I have a small problem. When I design a user interface using Jframe and JPanels, JPanel does not allow to drag and drop an item in a place I desire (At design time ). Lets say I add a button to JPanel, the...
more »

2017-11-11 17:11 (1) Answers

SceneBuilder Apply Gluon Theme CSS

I am trying to apply a theme to my jfxml window. In the GUI of Scene Builder, it shows correctly as follows: But when I compile and run, it shows the button and text area like this: I've been searching the web for 3 hours now, and came up with n...
more »

2017-11-11 16:11 (1) Answers

Java: Child Node values are null

My xml (created by calling a Powershell command through Java): <?xml version="1.0" encoding="UTF-8"?> -<Objects> -<Object> <Property Name="DisplayName">Adobe AIR</Property> <Property Name="Display...
more »

2017-11-11 16:11 (1) Answers

What is the reason to use OpenJDK?

I somehow understand the differences between Oracle JDK and Open JDK. But I can't find reasons to use Open JDK, because Oracle JDK already has everything one would need and sometimes faster than Open JDK. In what cases should someone use Open JDK? I...
more »

2017-11-11 10:11 (2) Answers

Resolving relative paths when using ph-schematron

I'm using ph-schematron, a Java library that validates XML documents via ISO Schematron: This library provides 2 ways of XML document validation: Validation via XSLT Validation via Pure Schematron I would love to use the second type, but my Sche...
more »

2017-11-10 16:11 (2) Answers

Eclipse: Programmatically manipulate class

I just came across the issue that I had 10 (or so) Java classes for all of which I wanted to: Add a formal parameter "String newparam" to their constructor Add this as an actual parameter to the super() call to the super class constructor (thus, th...
more »

2017-11-10 15:11 (2) Answers

Use clipping to round corners of ViewGroup

I have a RelativeLayout that needs to have rounded upper left and upper right corners. I can do this with a drawable background defined in XML with corners topLeftRadius and topRightRadius. But... This RelativeLayout also need to have a background th...
more »

2017-11-10 14:11 (1) Answers

How to inject module declaration into JAR?

Suppose I have some library lib.jar for which I do not have the source code (or it is written in some non-Java language which is unaware of modules yet). lib.jar does not have module-info.class and I do not want to use it as an automatic module, so I...
more »

2017-11-10 12:11 (2) Answers

Java stops at thread's try-catch

I'm trying to write a code that will return my raspberry's IP when it's on the same network as my computer. The idea is for it to make a broadcast like Samba (Broadcast resolution is the closest to the original NetBIOS mechanism. Basically, a client ...
more »

2017-11-10 06:11 (1) Answers

Inner class for each member of enum?

Not sure if what I want is possible but I am trying to create an enum in which each member has its own inner class. These inner classes will all have the same name Context but will be implemented individually. Ideally I would like them to be usable ...
more »

2017-11-09 20:11 (4) Answers