java

How to determine the version of oc4j being used?

I have an oc4j installation bereft of any release notes or version documentation. In the absence of such documents, how do I know for sure, which version of oc4j I am using? ...

How to get common Subclasses of 2 Interfaces in Java with Eclipse?

Actually I try to find a subclass of InputStream which is also Serializable. I think that doesn't exist. Since both Interfaces have many sublclasses it is hard to find one that is a subclass of both. Until now I haven't found anything to help my search in Eclipse. Anyone ideas? Edit: I understand now that serializing a Stream isn't rea...

How can I integrate Java with .Net?

I have one SDK that is available in Java and another SDK that is available for .Net and would like to write a single application that interfaces with both of them. I imagine I will need to use a cross platform communication framework that can support named pipes (or other in memory communication), what is the best choice? After some mo...

Web Services in Java

What do you usually use to connect to a Web Service when you are developing a Java project? There are different API-s that can do the job. From different books and tutorials I have read about: JAX-WS, JAXB, JAXM, JAXR, JAX-RPC, Axis ans so on. I'm interested in what exactly are you using and how much? Take this as a survey if you wish ...

Why does my application still run after closing main window ??

If I make a JFrame like this public static void main(String[] args) { new JFrame().setVisible(true); } then after closing the window the appication doesn't stop (I need to kill it). What is the proper way of showing application's main windows ? I'd also like to know a reason of a proposed solution. Thanks in advance. ...

How to do a check before allowing editing of a given row in a JTable

The problem is quite basic. I have a JTable showing cached data from a database. If a user clicks in a cell for editing, I want to attempt a lock on that row in the database. If the lock does not succeed, I want to prevent editing. But I can't seem to find any clean way to accomplish this. Am I missing something? ...

how to convert tis-620 string to utf-8 string in java

how to convert tis-620 string to utf-8 string in java ...

Display chinese characters in AJAX and also in excel

I am currently developing a Java Struts application and i been wondering how is it possible to display chinese characters in AJAX and also when generating excel file by servlet response. Anyone can share any pointers? ...

Java File Cursor

Hi, Is there some library for using some sort of cursor over a file? I have to read big files, but can't afford to read them all at once into memory. I'm aware of java.nio, but I want to use a higher level API. A little backgrond: I have a tool written in GWT that analyzes submitted xml documents and then pretty prints the xml, among o...

Best Java Messaging Service Books

Hi all. I'm looking to get up to speed on JMS for my job. Is there a JMS book that is a must have, or are some better than others? Or will any do? ...

2 instances of the same table inside jsp

Currently there are 2 pages in a jsp file: one of them displays the data and the second one is used for pagination. The task is to include exactly the same paginator table above the data table. Sorry, couldn't resist to draw it :) |-----------------------------------------| | Page 2 of 200 < > | |------------------...

Use AJAX instead of TagLib?

I was thinking about the idea of using Ajax instead of TagLib. The most elegant way would be: Using Java Annotation. The idea is, designers or anybody can make the HTML without any taglib ,just using the "standard" HTML tags with id or name, and call the Javascript. That way any WYSIWYG can be used, developer don't have to care about HT...

How can I send output to an external/second display in Java?

I would like to be able to emulate the functionality of the "Presenter Tools" in MS Office. This requires the program to be able to detect and use an external/secondary monitor/projector. Could somebody please point me in the right direction for achieving this. I would like to use Java 1.5 Thankyou. ...

Is there a Newline constant defined in Java like Environment.Newline in C#?

In C# there is the static property Environment.Newline that changed depending on the running platform. Is there anything similar in Java? ...

What do you need to do Unit testing in Java with Eclipse?

I've recently been lifted out of the .Net world into the Java world and I miss my unit tests. Using Visual Studio I used NUnit and TestDriven.net to run my unit tests. What is a comparable system for Java Using Eclipse? I'm looking specifically for the plugins that will get me going, or a guide on how to do it. I'm aware that JUnit i...

Retain relative mouse position while resizing a JPanel in a JScrollPane

I'm resizing a JPanel inside of a JScrollPane, and I want to make sure that the point on the JPanel where my mouse is currently located retains its position with respect to the JScrollPane after the resize (like Google maps does when you zoom in/out). I find the mouse position on the JPanel, which lets me deal with the viewport being at...

How can a client do a server side RMI bind without throwing an AccessException?

I have a client-server setup. The client must be able to bind certain objects to the RMIRegistry. Here is the server side code: if (System.getSecurityManager() == null) System.setSecurityManager(new RMISecurityManager()); System.setProperty("java.rmi.server.hostname", "192.168.0.99"); registry = LocateRegistry.createRegistry(Regist...

How do I turn a String into a Stream in java?

I need to transform a string into (finally) an InputStreamReader. Any ideas? ...

Polymorphism in JAX-RPC web services

I have a JAX-RPC (Java) web service that needs to return a complex polymorphic value. To be more specific, the class structure is something like this: abstract class Child { } class Question extends Child { private String name; // other fields, getters, and setters } class Section extends Child { private String label; ...

Stopping a Thread in Java?

I'm in the process of writing a piece of code that connects to a server spawns a bunch of threads using that connection and does a bunch of "stuff". There are certain instances where the connection fails and I need to stop everything and start from scratch with a new object. I wanted to clean up after the object but calling thread.stop...