java

Android add item to global context menu

When you long press on something in Android, a context menu comes up. I want to add something to this context menu for all TextViews in the system. For example, the system does this with Copy and Paste. I would want to add my own, and have it appear in every application. ...

Benefits/drawbacks to running 64-bit JVM on 64-bit Linux server?

We run the 32-bit Sun Java 5 JVM on 64-bit Linux 2.6 servers, but apparently this limits our maximum memory per process to 2GB. So it's been proposed that we upgrade to the 64-bit JVM's to remove the restriction. We currently run multiple JVM's (Tomcat instances) on a server in order to stay under the 2GB limit, but we'd like to consol...

Looking for Java spell checker library

I am looking for an open source Java spell checking library which has dictionaries for at least the following languages: French, German, Spanish, and Czech. Any suggestion? ...

Good-looking Java Swing Look&Feel?

I'm working on an open-source Java Web Start application, and I'd like to give it a consistent theme across platforms. Metal is totally ugly, and I'm not particularly happy with Substance (esp. performance). What are the best Swing Look&Feel options out there today? ...

What's the best library for manipulating JPEG metadata?

I'm after a library that can read and write JPEG image metadata. For example if I wanted to embed and read back a short description or story relating to the jpeg image, in the image file itself, what development library/s would you recommend? I'm not too fussed about what language (it's a new project), though I've tagged this question f...

What are usable databinding libraries for Swing?

Something that can do two-way bean synchronization with components, and also more fancy (advanced) stuff? ...

Generic Method Fail

I wrote this simple test code, by adapting a piece from a book, to help me understand the working of generic methods in Java. The line that I marked is supposed to work, why isn't it? import java.util.*; class Test { public static void main(String args[]){ List<Number> input = null; List<Number> output=null; output = Test...

Should Java treat arrays as objects?

I have often thought it would be a good idea to allow the use of arrays as proper objects with their own methods instead of relying on helper classes like Arrays, Arrays and ArrayUtils. For example: ints.sort(); // Arrays.sort(ints); int[] onemore = ints.add(8); // int[] onemore = ArrayUtils.add(ints, 8); I am sure I ...

Big-O summary for Java Collections Framework implementations?

I may be teaching a "Java crash-course" soon. While it is probably safe to assume that the audience members will know Big-O notation, it is probably not safe to assume that they will know what the order of the various operations on various collection implementations is. I could take time to generate a summary matrix myself, but if it's...

how do you print a bag datatype?

Bag<String> wordFrequencies = getWordFrequencies(text); how do i see what this wordfrequencies bag contains.. i ve used org.apache.commons.collections15.Bag org.apache.commons.collections15.bag.HashBag packages ...

The word break rule file

IBM has apparently open-sourced their ICU source code for Unicode and Globalization support, part of which is a text boundary locator for detecting where breaks can be located in text. However, the break detection stuff relies on rules and I cannot locate the rules files anywhere. Where can I get the word break rules text files for com...

How do I get the OSGi BundleContext for an Eclipse RCP application ?

I have just gotten started with an Eclipse RCP application, it is basically just one of the provided "hello world" samples. When the application boots up, I would like to look at my command-line parameters and start some services according to them. I can get the command-line parameters in IApplication.start: public Object start(IApplic...

What are the steps for connecting jdbc with mysql

I'M NOT ASKING ABOUT THE CODE. I just want to know what are and all the steps involved in the connection other than coding. I'm using j2sdk1.4.0 and MySQL Server 4.1. Am very new to this area. Thanks in advance ...

How to launch the default (native) application for a given file from Java?

I am displaying a list of files; i.e. xls, doc, pdf, odt etc., in my Java application (Eclipse RCP). When the user clicks on the file, I want to launch the appropriate (according to what the OS thinks) native application, just like it happens in Windows Explorer or the Finder. And while I am here: It would be nice to also display the s...

Automating build process for a web application created in Eclipse

I have an eclipse Tomcat project that has several dependencies on other eclipse projects. For example imagine the main project is called server and has several dependencies: server (depends on): data-lib server-utils messaging-utils Currently every time I change data-lib,server-utils,messaging-utils I have to recreate the .jar f...

Reading file from serial port in Java

Hi, i'm beginner in java technology, I have to read file from port. Frst I'll write "FLASH" to outputstream then I'll get response as a "FLASH_OK" from target device, after getting FLASH_OK as response then again i have to write name of the file which i want,but problem is its not writing file name to outputstream, below is my code. Plea...

Universal keybindings in Eclipse

I want to be able to use CTRL-SHIFT-T to open a Java Type (source code file) from any perspective in Eclipse. Unfortunately, the keybinding only works in the Java perspective. I tried defining the keybindings using context "In Windows" and "In Dialogs and Windows." That did not do the trick. Any ideas how to do this? (For documenta...

Stopping EntityResolver from using the internet in maven2 build ?

Our build is a standard maven2 build running surefire on jdk 1.5. I know that some of the tests are connecting to the internet to resolve schemas/dtds because they use a loong time when the internet connection is down. How do I stop this ? ...

Is there a log4j or commons logging extension or other logging framework that is designed for Java 5 or higher?

Java 5 has introduced many features that can be make logging statements less cluttering, such as variable number of arguments and printf. That can alleviate all the message building code that happens when something is logged, as well as the surrounding if. For example, instead of writing: if (log.isDebugEnabled() { log.debug("User ...

How to strip HTML attributes except "src" and "alt" in JAVA

Hi, problem: How do I strip all attributes from HTML tags in a string, except "alt" and "src" using Java? And further.. how do I get the content from all "src" attributes in the string? :) ...