java

Get Active Tab in SWT TabFolder

I apologize if this question is too basic, but I just can't figure out how to do this. I have a SWT TableFolder with two tabs, and I need to determine which of those two tabs are currently active, as it effects the behavior of another part of the program. Is this possible? Thank you in advance. ...

Generating a list of supported devices by WURFL capabilities

...

Java exit code meaning

I got the below message when the JVM exited. JVM process exited with a code of 10 What is the meaning of exit code 10? ...

java library for IBAN/BIC validation

Does anyone know of a reliable java library that can be used for International Bank Account Number (IBAN) and Bank Identifier Code (BIC) validation? ...

What could be a reason of a big lag between exit from RESTeasy controller and enter into MainFilter

I have EJB RESTEasy controller with CMT. One critical method which creates some entities in DB works fine and quickly on single invocation. But when i try to invoke it simultaneously by 10 users it works very slowly. I've tracked time in logs and the most expanded place vs. single invocation is lag between exit from RESTeasy controll...

How to define realms for using by Google App Engine?

I've a security constraint on my app: <security-constraint> <display-name>users</display-name> <web-resource-collection> <web-resource-name>all</web-resource-name> <description/> <url-pattern>/secured</url-pattern> <http-method>GET</http-method> <http-method>POST</http-method> <htt...

How to show Java portlets in Sharepoint

Does someone know/have experience in showing Java web application generated UI in Sharepoint? We have a Java web application and are evaluating the possibilities to embed Java-generated web UI into Sharepoint. I don't think Sharepoint supports Java portlets, but it might support consuming WSRP? ...

Why is Multiple Inheritance not allowed in Java or C#?

I know that multiple inheritance is not allowed in Java and C#. Many books just say, multiple inheritance is not allowed. But it can be implemented by using interfaces. Nothing is discussed about why it is not allowed. Can anybody tell me precisely why it is not allowed? ...

Runtime.getRuntime().exec(), hide the console screen

I am executing a batch file using Java code. The code is given below: Process proc = null; proc = Runtime.getRuntime().exec("cmd /c start somebat.bat"); With this, the normal command prompt screen gets open. Now I want to suppress/hide the command prompt window(the black one). I found somewhere that if I remove the start attribute fr...

GUI: Changing panels based on value of combo box

Hi, I have a question about GUI design, specifically with Java Swing and creating clean separation between presentation and model. It's a bit difficult to describe, but essentially we have lots of reference data in our system (i.e. that would correspond to lookup tables in the DB). We want people to be able to edit them all from one scr...

Free/Open source screen capturing library in java.

I am working on screen capturing tool. Currently my requirement is to capture screen shot of current screen, which can be extended to screen cast (video) etc. So just want to know which is best (open source/ free) java framework/library which meets my requirement. ...

What naming convention do you use for the service layer in a Spring MVC application?

I'm stuck with figuring out a good naming convention for the service layer in a spring application. For each class in the service layer I first write the interface it should implement and then the actual class. So for example I have the following interface: public interface UserAccountManager{ public void registerUser(UserAccount new...

Why does Java toString() loop infinitely on indirect cycles?

This is more a gotcha I wanted to share than a question: when printing with toString(), Java will detect direct cycles in a Collection (where the Collection refers to itself), but not indirect cycles (where a Collection refers to another Collection which refers to the first one - or with more steps). import java.util.*; public class Sh...

Java polymorphic methods

In Java i have abstract class named Operation and three its subclasses called OperationActivation, OperationPayment and OperationSendEmail. ADDED FROM COMMENT: Operation* objects are EJB Entity Beans so I can't have business logic inside them. No I want to create processor class like this: public class ProcessOperationService { publi...

Https Connection Android

I am doing a https post and I'm getting an exception of ssl exception Not trusted server certificate. If i do normal http it is working perfectly fine. Do I have to accept the server certificate somehow? ...

Open window from applet (Bang! Howdy)

I need to open an external window from a Java applet. How can I do it without making the window a child of the applet? I need the window to stay open even when the applet is closed. I know it can be done. Bang! Howdy does exactly what I'm trying to achieve. http://www.banghowdy.com/launch.html ...

JAR installer that auto-detects if Java is there and autostarts the application

Hi guys, I need to build an installer that does the following: 1. Installs my jar on the client 2. Auto-detects if JRE is installed (in which case it does not re-install it), otherwise installs it without the user clicking on another button 3. Auto-starts the application when the client is booted 4. Works across Windows, Mac and Linux. A...

Java string comparison?

String parts is String[6]: [231, CA-California, Sacramento-155328, aleee, Customer Service Clerk, Alegra Keith.doc.txt] But when I compare parts[0] with "231": "231" == parts[0] the above result is false, I'm confused, so could anybody tell me why? ...

SSH library for Java

Hi All, Does anyone know of a good library for SSH login from Java. Thanks, Ronen. ...

Deleting duplicate lines in a file using Java

As part of a project I'm working on, I'd like to clean up a file I generate of duplicate line entries. These duplicates often won't occur near each other, however. I came up with a method of doing so in Java (which basically made a copy of the file, then used a nested while-statement to compare each line in one file with the rest of the ...