Hi,
How do I detect when user closes(navigates away) or refreshes web page with JavaFX applet in it. I want to do some clean up in my code on those events.
Java Applet had some callback methods to do that, but how would I do it in JavaFX running in browser?
Thanks,
...
I want to get the Eclipse platform source code and build it myself. Where could I get it?
...
In the comments to my answer about reading an entire file into memory using scala.io.Source, I asserted that the reason there is no read-whole-file-into-String method in Java is that it is not (of course) scalable with regards to how big the file is and how much heap you have.
However, I guess everyone has some method like:
String con...
In a NetBeans Mobility Project I have attached a zip file to the Resources folder,
this zip file contains around 10 .class files.
In my mobility application I am actually using 4 classes from the zip file, however when I compile and build my project the destination jar file seems to contain all the 10 .class files from the zip file.
I...
Is it possible to evaluate a string of python code (or Perl) from Java when developing Android applications?
I am try to do something like evaluating a text-input script:
e.g.
String script = text1.getText().toString();
String result = PythonRuntime.evaluate(script);
text2.setText(result);
...
I'm getting this exception
java.sql.SQLException: Unknown column 'auyu' in 'where clause'
My Query and method in my database facade class.
db.save("delete from users where name = auyu");
public static void save(String sql) throws Exception {
new DBFacade().connect();
synchronized (c) {
c.createStatement()...
I'm trying out the Eclipse Java 'Export Runnable JAR file". It creates a single JAR with all files in it, which is great. But one issue, in my project I have two directories and a few external libraries, like the following layout
src
resources
mypic.jpg
JRE System Library
Referenced Libraries
a bunch of external libraries
...
LiveConnect is a Mozilla technology that bridges Java and JavaScript. Amazingly, they've started maintaining it again for recent versions of Firefox. In Firefox I can write e.g.
var d = new java.util.Date();
or use the Packages. namespace if it's not a java.something
var d = new Packages.java.util.Date();
or I could go crazy and ca...
I want to store a byte array wrapped in a String object. Here's the scenario
The user enters a password.
The bytes of that password are obtained using the getBytes() String method.
They bytes are encrypted using java's crypo package.
Those bytes are then converted into a String using the constructor new String(bytes[])
That String is ...
Hi All,
I understand that the rule of thumb in OOD is to minimize access to all members of a given object as best as can be reasonably accomplished.
C# and Java both seem to implement the same set of access modifiers; however, something which has bewildered me for some time now is why Java classes seem to be mostly declared as public w...
Hi everyone,
I'm working on a project that requires me to do simple geometrical transformations (translation, reflection over x and y axis) on some figures drawn on a Java applet. The previous guy working on the applet was drawing the figures from arrays representing the caretesian points for the vertices of each figure. I decided to...
Currently my jsp 2.0 tags that need spring beans use this code:
ac = WebApplicationContextUtils.getWebApplicationContext( servletContext);
ac.getBeansOfType(MyRequestedClass.class);
The I just get the first matching bean.
This code works fine, but has the undesired drawback that I spend about half my page rendering time looking up sp...
I'm writing a library that will be used to Hibernate many types of EJBs via JPA. When loading an EJB from JPA, the library needs the datatype of the field(s) annotated with @Id. The @Id may be annotated on a superclass of the EJB. Is there a method in Hibernate or JPA that can get the datatype of @Id?
I'm tempted to use reflection, b...
Hi,
I am developing a Swing/Java app but having difficulties passing data from the initiliaser threads to one of the GUIs.
The GUI is initialised by invoking an 'initComponents()' method on the event dispatch thread in its run() method:
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
C...
At work I've been tasked with turning a bunch of HTML files into a simple JSP project. It's really all static, no serverside logic to program. I should mention I'm completely new to Java. JSP files seem to make it easy to work with common includes and variables, much like PHP, but I'd like to know a simple way to get something like templ...
Hello,
can anyone tell me how I can convert a .java file into .class file with an executable bytecode.
Thanks
...
I was wondering how I might take a CronTrigger and add an extra one-off firing such that I can iterate over the firing times as I might with the getFileTimeAfter(Date) method
Say if I had a CronTrigger expressed by: "0 0 12 * * ?"
How might I add one additional firing as might be expressed by a SimpleTrigger with no repeat?
...
Suppose I have an expression in Java such as:
String s = "abc" + methodReturningAString() + "ghi" +
anotherMethodReturningAString() + "omn" + "blablabla";
What's the behaviour of the Java's default JDK compiler? Does it just makes the five concatenations or there is a smart performance trick done?
...
I'm using hibernate to persist an entity to my database. For the moment it's a derby DB, but I will be moving it over to an oracle DB soon.
in my classname.hbm.xml I have the id defined as such:
<id name="id" type="long">
<column name="ID"/>
<generator class="increment"/>
</id>
How do I set the starting value for the id? ...
Everytime my app loads I get the following error in the console:
Warning: class ch.randelshofer.quaqua.osx.Application couldn't load library "quaqua64". java.lang.UnsatisfiedLinkError: no quaqua64 in java.library.path
I thought this would be resolved by adding libquaqua64.jnlib to the resource directory that contian my libquaqua.jnli...