In Java SE it is possible set the cause of an exception using initCause to avoid losing information about the error when catching and rethrowing an exception Is it possible to do the same in Java ME?
I am attempting to convert Java code to Jython and am using the apache Log and LogFactory imports. I am attempting to emulate Foo.class in Jython The chunk of code is as follows:
in Java
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class MyClass {
private static final Log log = LogFactory.getLog(MyClass.class);
public MyClass(Document dom)
{ //code
}
How can I emulate this same behavior of MyClass.class in Jython/Python?
I've read a time ago about generate xml from Java using annotations, but I'm not finding a simple example now.
If I want to make a xml file like:
<x:element uid="asdf">value</x:element>
from my java class:
public class Element {
private String uid = "asdf";
}
Which annotations I should use to perform that? (I have a xml-schema, if this helps the generation)
I'm interested in finding a concatenative language interpreter in Java. Ideally, it should satisfy the following conditions:
It has an interpreter, not (only) a bytecode compiler for JVM.
The language itself has decent documentation, not only a few examples and a "I'll document the rest someday" notice.
The project is not completely abandoned.
In short, I'm looking for a reasonably "alive" concatenative language that can be embedded into Java easily.
I have Assigned a Project on "Remote Computer Monitoring "...(To access Other PC like VNC)
and i decided to do this in Java(Because of Platform Independency..)...
and my java classes are goin on and we are at Threading..
so tell me where to start the project ???...
What Should i Learn More...??
and is there any prebuild interfaces for this???...
PS: i have to Access the Remote Machine Graphically Like TeamViewer and Do some filetransfer Stuff....
I am making a distributed java app for which I need both parts of the app to run on one standard time. Since system times can be different I was thinking if java API contains some class to download time from a standard online source?
Is it possible to get the system proxy configuration in Java?
In the Java Control Panel, you can set a proxy configuration. How can I access to that proxy configuration in order to open URL connections behind a proxy?
Hi,
I'm dealing with a HTTP sockets project, I have to send 2 HTTP GET requests from my java code like this :
Request 1 : call page X
Page X is setting a cookie.
Request 2 : call to page Y
as you see to access the content of page Y i cookie must be present...
how to accept a cookie from java code please ?
There are plenty of resources available to a Java developer for getting a jump-start into Ruby/Rails development. The reverse doesn't appear to be true.
What resources would you suggest for getting up-to-date on the current state of java technologies? How about learning how to approach DRY (don't repeat yourself) without the use of metaprogramming? Or how to approach various scenarios where a ruby developer is used to passing in a function (proc/lambda/block) as an argument (callbacks, etc)?
We have to delete some directories and their contents using Java running on Windows.
I was worried about running into the directory files being locked.
We could just invoke Unlocker to do the delete. Or is there a more Java centric way to handle this situation?
Is it possible to use a font not on the user's machine for text displayed in a java applet.
Like linking to a ttf font file in the same location as the java applet almost in an @fontface fashion.
Is there a way to resize a control, a JTextfield for example, at runtime in java? I want my textfield to have the resize cursors (just like when you point your cursor on the corner of a window) and will be able to resize on runtime. Ive read on the internet that vb6 and C# have those capabilities, is there anything for java? A sample code or a link to a good tutorial will be very much appreciated. Thank you.
I just read this statement in a java book saying Objects in java reside on a heap.
Is a heap used because it is the best way to store data and retrieve data fast ?
I only have an idea about data structures being a beginner. I mean why not stack or something else ?
Hi,
I want to exclude a particular method of a class from java compilation.
For eg:
class Test {
public void printdouble(){}
public void printint(){}
}
Depending upon some properties, I want to exclude printdouble method during compilation.
NOTE: I'm using ant script for java compilation
Thanks in Advance
Soman
What's the simplest way to create and write to a file in Java?
I know this is a very basic question, but the web is full of different answers for different versions of Java and it would be nice to have an answer here on StackOverflow.
I'm looking for a good way to convert Office (mostly Microsoft) documents to PDF in Java. I've been looking at using the OpenOffice SDK but from the samples I've looked at it looks like this requires having OpenOffice running in server mode to do the work.
Does anyone know of a good way to do this? Good meaning the less external requirements, the better. A 100% Java API would be best, but I don't expect that actually exists.
Hi All
I have a modal popup as (lightbox etc.). If i want to add java applet into the modal popup via javascript i encounter a problem that is Java Applet don't display propperly sometimes dont' everytime. I tried to solve it setTimeout methot but it didn't solve :( Do you have a suggestion this issue? Thanks.
I need a java graph library for visualization that I can incorporate in my own application. I found that jgraph is excellent for visualization but require explicit positioning of the nodes. Is there any open source java graph library that support automatic layout. Any suggestion will be really helpful for me.
What is the best way to update a Java or GWT program from MySQL. For example, a MySQL database which holds Weather information... updating whenever the weather changes a degree. How would I update a Java / GWT field with each update. Would I use a thread to query every few seconds??
I need to write version-independent java code, because of some bugs in JDK 1.5 which was fixed in JDK 1.6 now i use the following condition:
if (System.getProperty("java.version").startsWith("1.5.")) {
...
} else{
...
}
Is there another possibility to check this? Will it work for JVM from IBM?
I'm trying to convert an old Delphi program I wrote into Java to compile and run on my Android phone. I'm running the Android 2.1 operating system but am using version 1.6 of the SDK.
I have a routine in Delphi where I set the colour of pixels on a canvas individually along the lines of:
image1.canvas.pixels[x, y] := GetMyTColor(x, y);
Is there a Java equivalent to the property on the Canvas:
property Pixels[X, Y: Integer]: TColor
Currently, I have an Java Standalone Swing Application.
Now, when user clicks on the button in the Swing Application, I would like to launch another Java Application (Say : calculator.jar)
May I know what is the portable way to do so? So that it will work in multiple OS?
I would like to know if there is a way to execute the "java.exe" as a background process (silent mode execution)
Ex: java -cp . MyClass arg1
I want to run the above statement as a background process , without opening command window
SEVERE: IOException while loading persisted sessions: java.io.WriteAbortedException: writi
ng aborted; java.io.NotSerializableException:
That means this object cannot be persisted on hard disk.
Does it imply that it's not safe to keep in Session objects that do not implement "Serializable"?
I haven't heard that there are limitations on saving non-serializable objects in Session object.
It simply means that Tomcat will always keep them in memory, right?