I am creating an android application using Java. I have a boolean variable called “movement”. I want to create an event that triggers when the value of “movement” changes. Any pointers in the right direction would be great. Thank you Answer A variable is not alone, I presume. It reside…
Tag: java
Is there a way to take an argument in a callable method?
I have created a piece of code which takes an IP address (from main method in another class) and then loops through a range of IP addresses pinging each one as it goes. I have a GUI front end on this and it was crashing (hence why I’ve done the multithreading. My problem is I can no longer take the
A fatal error has been detected by the Java Runtime Environment. EXCEPTION_ACCESS_VIOLATION
I have java 1.6, maven 2, activeMQ 5.5 and functional tests with testng. When I launch it in Idea then OK, but when I try to launch them with maven from console then process suspends after trying to send message via activeMQ and after some time crashes with the following error in log: I have no idea what̵…
Extract all text with string positions from a PDF
This may seem an old question, but I didn’t find an exhaustive answer after spending half an hour searching all over SO. I am using PDFBox and I would like to extract all of the text from a PDF file along with the coordinates of each string. I am using their PrintTextLocations example (http://pdfbox.apa…
Adding a listener to a variable in Java/JavaFX which gets called on variable change
I know that there are listeners in JavaFX, and i’m sure Java. But I’m confused as how to implement them. I have a boolean variable that is changed throughout my program. Everytime the boolean is changed, I want a function myFunc() to be ran. Can this be done easily? Answer As simple as this: and w…
How to perform schematron validation using Saxon java library command line tool?
Very basic question- I’ve a xml file and I want to validate it against a schematron file. How do I do it using Saxon command line? As per commandline reference I don’t see any option to specify schematron file. Answer After doing a lot of research, it seems that it isn’t really possible. We …
Hibernate error – QuerySyntaxException: users is not mapped [from users]
I’m trying to get a list of all the users from “users” table and I get the following error: This is the code I wrote to add/get users: Adding users works, but when I use the getUsers function I get these error. This is my hibernate config file: and this is my User class: Any idea why I get t…
How to deep copy a Hibernate entity while using a newly generated entity identifier
I’m using a relational DB using a single column pk with a few nested tables. I need to add a simple archiving to my project. The archiving only happens when the application reaches a particular state, so what I was hoping to do was copy my existing hibernate object into a new instance where the new inst…
Design for defining graphs or flowing structures
I’m trying to create a system for representing and designing graphs in an easy way. That means it should be easy to create some graphical representation from the data structure but it should also be easy to store the structure and do easy calculation on it. Easy calulations in this sence are questions l…
adding JScrollBar to a JPanel with GridBagLayout
My whole purpose of this is to get something looking like this: I want my skills list to scroll similar to freezing the top row of your spreadsheet in excel. Here is the code for my top row. And here is the code for parsing the (commandString – reply of skills from server/DB) As you can see it adds it