java

Delete all tables in Derby DB

How do i delete all the tables in the schema on Apache Derby DB using JDBC? ...

How best to store Subversion version information in EAR's?

When receiving a bug report or an it-doesnt-work message one of my initials questions is always what version? With a different builds being at many stages of testing, planning and deploying this is often a non-trivial question. I the case of releasing Java JAR (ear, jar, rar, war) files I would like to be able to look in/at the JAR and ...

Is there a destructor for Java?

Is there a destructor for Java? I don't seem to be able to find any documentation on this. If there isn't, how can I achieve the same effect? Thank you in advance. EDIT: First of all I thank everyone for swift reply. I see a lot of very good answers there. To make my question more specific, I am writing an application that deals with d...

Which data structure for linking text with audio in Java

I want to write a program in which plays an audio file that reads a text. I want to highlite the current syllable that the audiofile plays in green and the rest of the current word in red. What kind of datastructure should I use to store the audio file and the information that tells the program when to switch to the next word/syllable? ...

Should one use Tapestry 5 for a production release?

We're starting a large web project, mostly green field. I like the Tapestry framework for java/web solutions. I have concerns about starting a Tapestry 5 project since T5 is still in beta. However, if I understand the documentation correctly, T4 development will not be supported by T5 and up. My question: Should I begin a large project f...

How do I use BGGA closures prototype on standard Mac JDK6?

I am trying to use the BGGA closures prototype with an existing JDK 6 (standard on Mac OS X Leopard). The sample code I'm compiling is from a BGGA tutorial: public static void main(String[] args) { // function with no arguments; return value is always 42 int answer = { => 42 }.invoke(); System.out.println(answer); } I have trie...

Java: Serializing Array of own Objects

Hello, i have an Array of Objects of my class: public class Message implements Serializable{ static final long serialVersionUID = -1L; private String receiver; //Empfänger private String sender; //Absender private String Betreff; private String content; private String timestamp; ...} I am able to safe it with an Object*Stream b...

Is there a better Java implementation of SSH2 than JSch?

I've been using JSch for a couple of weeks now. It seems to work okay, but its API is a little bit cumbersome. I'm also a little off put by its total lack of documentation (not even javadoc style comments). Has anyone used a good Java SSH2 library that they'd recommend. I'm particularly interested in SCP file transfer and issuing com...

How to discover the type of media inserted in a DVD/CD drive? (java)

When I insert a DVD or CD, I want to programmatically know what type of media(DVD or CD) is it. ...

Selection overridden by formatter.

I have applied a Formatter to a JFormattedTextField using a FormatterFactory, when a user clicks into the text field I want to select the contents. A focus listener does not work as expected because the formatter gets called, which eventually causes the value to be reset which ultimately de-selects the fields contents. I think what is ...

How to determine if a JNI (jogl) is available at runtime?

I'm working on a source-code visualization project that uses the Processing core library. The processing library has the option to use the jogl OpenGL library to render graphics which really improves performance. However, the JNI files that jogl uses aren't necessarily available at runtime, depending on who is using the project and on ...

Why log4j cannot generate backup files?

I'm running some java processes on Windows 2003 server R2 I'm using Apache log4j-1.2.8. All my processes called via one jar file with different parameter example java -jar process.jar one java -jar process.jar two java -jar process.jar three And I config log4j.properties follow #=============================== # Decla...

Ghostdoc-like plugin for IntelliJ IDEA

I've become lazy in my old age. For my C# work I've become quite reliant on Roland Weigelt's excellent GhostDoc plugin for Visual Studio. Is anyone aware of a similar plugin for Java work in IntelliJ IDEA? ...

Getting started with mobile programming. What is a good platform ?

What is a good mobile programming platform to go with for a c++ developer? Is learning android a good option? ...

What is the best installation tool for java?

Depends on your experience could you recommend something? I've use izpack, and it's very nice tool, is there any other, better tool? ...

Problems with shutting down JBoss in Eclipse if I change JNDI port

1st phase I have a problem shutting down my running JBoss instance under Eclipse since I changed the JNDI port of JBoss. Of course I can shut it down from the console view but not with the stop button (it still searches JNDI port at the default 1099 port). I'm looking forward to any solutions. Thank you! Used environment: ...

Create destinations for all bookmarks in a PDF file with iText API

I'd like to write some Java code that takes a PDF document, and creates named destinations from all of the bookmarks. I'm thinking that the iText API is the easiest way of doing this, but I have never used the API before. How would you go about writing this sort of code with the iText API? Open, find bookmarks, create destinations, sav...

Calling JS from Applet: MalformedURLException: unknown protocol: javascript

Hey guys. I read that you could call JavaScript code from a Java Applet by calling JApplet.getAppletContext().showDocument( "javascript:alert('Hello World');" ); However, when I do this i get the following error: java.net.MalformedURLException: unknown protocol: javascript How do I work around this? ...

Where can I find sample uses of LWJGL?

I have seen the official demos on lwjgl.org but I would like to see some more tutorial level examples. ...

Can I Define Exceptions to Eclipse cleanup rules?

Most often the cleanup rules (Preferences > Java > Code Style > Clean Up) in Eclipse work perfectly and create nice-looking code. But sometimes, especially with comments and concatenated string snippets (like inline SQL queries), the cleanup just messes things up, and destroys my formatting. Is there a way to say to Eclipse "Don't touc...