java

How to securely trigger a Swing-Action in a restricted applet?

I simply want to call a swing action from my own popup menu. But since there is a security manager I need a solution to invoke this action without calling it directly. For instance the paste action of a text component will fail, because sun.swing.SwingUtilities2 cannot be loaded if there is any of my classes in the call stack. Is there ...

How to call java objects and functions from CPython?

I have a python program, which runs on the CPython implementation, and inside it I must call a function defined in a java program. How can I do this? It would be nice to be able to use some java objects too. Jython is not an option. I must run the python part in CPython. ...

Is there a posibility to break on every object reference in eclipse debugger ?

Suppose I have a class public classs MyClass { private Set<String> set = new HashSet<String>(); //and many methods here } is there a possibility to make an eclipse debugger stop at every line where set member is used ? ...

Which J2EE Web App Hosting Would You Recommend for Casual Projects?

Can you recommend a Java Web App Hosting company for small/low traffic projects? Somethign that will give me the ability to deploy a number of webapps into a J2EE webapp server (e.g. Tomcat) fronted with a web server (e.g. Apache) and backed by and a database (e.g. MySQL) Please note that while these applications will be non-commercial,...

StackOverflowError when serializing an object in Java

I am writing an application in Java using Swing. I am trying to implement functionality to save and load simulation states for at simulation i am running. The entire simulation is kept as an object, disconnected from Swing. I am trying to serialize my Simulation class with this code: public void saveSimulationState(String simulationFile...

Continuous Integration for Intersystems Cache solutions

I am starting a project from scratch using Intersystems Cache. I would like to setup a Continuous Integration Server for the project. Cache has unit test libraries, so the idea is to import source into a test database, build the source, run unit tests in the cache terminal, based on changes in the version control system (ClearCase). Ap...

How do I (should I?) use Apache POI HWPFDocument?

Hi guys! I'm thinking about including the Apache POI into my application. Main goal is to output RTF document, but DOC would be nice, too. But the documentation is not very detailed about writing a HWPFDocument and everything I found on the web isn't helpful at all. I can read DOC files, that's working without any problem. But I really...

using buttons to call specific records from a table

How do i pull the last records from different tables all with various amounts of records in them? here is some of my code, but it is returning nothing as my last set of records: @HandlesEvent("showFirst") public Resolution showFirst() { setFirstRecord(1); setLastRecord(10); return defaultHandler(); } private int firstRecord...

Best way to encode text data for XML in Java?

Very similar to this question, except for Java. What is the recommended way of encoding strings for an XML output in Java. The strings might contain characters like "&", "<", etc. ...

Allowing a method to lock its parent Object in Java

Is there a way in Java to get a method to lock (mutex) the object which it is in? I know this sounds confusing but basically I wan't an equivelent to this snippet of C# but in Java. lock(this) { // Some code here... } I've been tasked with reimplementing an API written in .Net into Java, and I've been asked to keep the Java versi...

C++ .NET equivalent to java public static void main()?

In java I can simply test classes directly with public static void main() I then just add quick code and under Eclipse "Run" the class. Is there anything similar in C++ .NET ? Right now I have to create an empty project, reference the correct headers then set that project as start up project. ...

Using a jsp fmt tag in another tag

I'd like to be able to include the return value of a fmt tag in another tag: <local:roundedBox boxTitle="<fmt:message key="somekey"/>"> content </roundedBox> I've run into this problem multiple times and it just seems like a stupid limitation of jsp. Is there a simple way around this? ...

Is there a difference between single and double quotes in Java?

Is there a difference between single and double quotes in Java? ...

JAXB XmlID and XmlIDREF annotations (Schema to Java)

I am exposing a web service using CXF. I am using the @XmlID and @XmlIDREF JAXB annotations to maintain referential integrity of my object graph during marshalling/unmarshalling. The WSDL rightly contains elements with the xs:id and xs:idref attributes to represent this. On the server side, everything works really nicely. Instances of ...

What is the best ORB for Java/C++ interoperation using CORBA?

I have a client-server application written in Java using CORBA for the communication. The ORB used is orbd, the one provided by the Java6 platform. I have to replace the Java server implementation with another one written in C++. So the question is, of the free source implementations of CORBA libraries, which one better interoperates wit...

MIDP heap vs VM heap

Some Java mobile devices have distinct heaps for MIDP and VM. What's the distinction between these two heaps, and how can a J2ME app control which is used for a given piece of data? ...

Removing objects from Java Collections

I have a HashMap (although I guess this question applies to other collections) of objects. From what I understand, when the documentation talks about removing mappings, then it is removing the entry from the hashtable, i.e. not necessarily destroying the actual object. If the only remaining reference to the object is in this table, then ...

Access sound card or OS synthesizer device in Java

When I try to list Synthesizer devices in Java (1.6.0), I get only one device, Java Sound Synthesizer. I want to use the Synthesizer in the sound card or use any other installed synthesizer, eg. the Microsoft Synthesizer. How can I go about doing that ? If this capability is not inbuilt, is there any open source project that act as front...

JVM heap sizing in VMware guests

This question is probably better phrased: how does running a Java server on a hypervisor such as VMware ESX affect the Java heap? Access to JVM heap is random from the OS/hypervisor perspective It is difficult to for guest OS or hypervisor to optimize memory that is randomly accessed Given this, can the hypervisor detect unused pages i...

What's a good Java, curses-like, library for terminal applications?

I would like to write a Java terminal application that does screen manipulation. Are there any good libraries out there that allow you to manipulate the screen like curses in the *nix/C world? Minimal features I'm looking for are windowing and user input support. In feature-speak, I'd like to have a region of the terminal where some da...