java

Does .NET (Mono) support cross-platform file operations and cross-platform audio metadata handling (through libraries)?

For my next project, the two leading frontrunners are .NET and Java. The project is to take a directory (something like My Music in Windows) that contains directories and music files (MP3s initially, but eventually expanded to other music formats). For each file, it would allow you to play the file and view/edit its metadata, filename, a...

Request admin privileges for Java app on Windows Vista

When I try to create a new task in the task scheduler via the Java ProcessBuilder class I get an access denied error an Windows Vista. On XP it works just fine. When I use the "Run as adminstrator" option it runs on Vista as well.. However this is a additional step requeried an the users might not know about this. When the user just do...

Java XSLT Transformation Failing due to xsl:include

I have a Java maven project which includes XSLT transformations. I load the stylesheet as follows: TransformerFactory tFactory = TransformerFactory.newInstance(); DocumentBuilderFactory dFactory = DocumentBuilderFactory .newInstance(); dFactory.setNamespaceAware(true); DocumentBuilder dBuilder = dFactory.newDocumentBuilder(); Cl...

Java Network Events

Hello, I am creating a java mobile application and I want to be aware as to when the device obtain an IP address to then be able to send messages to a backend system. Do any API exists? I guess if an API existed it would have to use system dependant calls thru JNI? Thank you, Julien. ...

How does the Sun JVM map Java threads to Windows threads?

My application uses loads of Java threads. I am looking for a reliable understanding how the JVM (version 5 and 6) maps the Java threads to underlying Windows threads. I know there is a document for mapping to Solaris threads, but not Windows. Why doesn't Sun publish this information? I want to know if there's a 1:1 mapping, or if it v...

Java: Out with the Old, In with the New ...

Java is nearing version 7. It occurs to me that there there must be plenty of textbooks and training manuals kicking around that teach methods based on older versions of Java; where the methods taught, would have far better solutions now. What are some boilerplate code situations, especially ones that you see people implement through fo...

Can every float be expressed exactly as a double?

Can every possible value of a float variable can be represented exactly in a double variable? In other words, for all possible values X will the following be successful: float f1 = X; double d = f1; float f2 = (float)d; if(f1 == f2) System.out.println("Success!"); else System.out.println("Failure!"); My suspicion is that there i...

Scanning Java annotations at runtime

What is the best way of searching the whole classpath for an annotated class? I'm doing a library and I want to allow the users to annotate their classes, so when the Web application starts I need to scann the whole classpath for certain annotation. Do you know a library or a Java facility to do this? Edit: I'm thinking about somethin...

Why is tomcat looking for JSF classes?

I am trying to get my development environment up and running, and I am having trouble with Tomcat trying to load JSF classes for some reason. My application does not use JSF; in fact, I haven't even deployed my application to tomcat yet. I am getting a number of stack traces in the startup logs and I cannot load the default tomcat home...

Any way to "reboot" the JVM?

Is there any way to reboot the JVM? As in don't actually exit, but close and reload all classes, and run main from the top? ...

How do you calculate a percentage based on two variables with different evaluation groups in Jasper Reports?

First, a sample of what I am trying to accomplish (Evaluation time - Auto): Group 1                 Amt      %   - Group 2 item       4      33.3%     - Group 3 item     1      25.0%     - Group 3 item     3      75.0%   - Group 2 item       8      66.7%     - Group 3 item     5      62.5%     - Group 3 item     3      37.5% Total      ...

Strengths and weaknesses of XmlBlaster

Are/were you using XmlBlaster? What do you think about it? What are its weaknesses and strengths? ...

JFileChooser embedded in a JPanel

EDIT: I've posted a clarification as an answer, see below for more details. I am writing a java program that needs a file open dialog. The file open dialog isn't difficult, I'm hoping to use a JFileChooser. My problem is that I would like to have a dual pane JFrame (consisting of 2 JPanels). The left panel would have a JList, and the...

Swing components : vertical text question

If I have a button like the one in this image : http://www.freeimagehosting.net/image.php?4cd775814c.png how could I make the text display itself vertically ? As in j B u t t o n 1 I would like to know how to do the same thing for JLabel . I'm sure there has to be a better way than to create as many labels as there are characters ...

JSF getValue() v.s. getSubmittedValue()

Hey all, I've been developing a few JSF applications lately and am disturbed with the inconsistency in the web component APIs. I've noticed that there is extremely unpredictable behavior when calling .getValue() or .getSubmittedValue() on a JSF component object in server side code. Sometimes when I call .getValue() on a drop down list...

How to add an xml element in Java 1.4

I am trying to add a "title" element but am getting a NO_MODIFICATION_ALLOWED_ERR error... private static void saveDoc(String f) throws Exception { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(f); ...

what are the limitations of jython's PyObject.__tojava__ method?

Jython's PyObject provides a method to cast a python object to java. There are some old articles on Jython Monthly describing the use of __tojava__ to create a jython object factory Besides the need for an interface, are there any other limitations to using Jython to create "java" objects. ...

Where to find a quick review of Java and/or C++ ?

I have a short preliminary interview with Microsoft in less than 2 hours. I've been told that they might ask questions in Java and/or C++. Where can I find a quick overview of both languages? I don't need to full tutorial, just something that goes over the language-specific features and a refresher of the semantics. I also only have 1.5 ...

Override getContextPath in an HttpServletRequest (for URL rewriting)

I have a web-app that I would like to extend to support multiple languages with new URLs. For example, www.example.com/home.do stays English, but www.example.com/es/home.do is Spanish. My first thought was to create a Filter which rewrites incoming urls like /es/home.do to /home.do (and sets the Locale in the Request); this works fine....

Does any one use OSGi's OBR?

I am just wondering if any one is using the OSGi Bundle Repository and what for? ...