java

Cron to human readable string

I am using Quartz with Java to schedule jobs. One thing is that i store cron expressions on a database and i would like to present them to a user but in a more readable form. So i was wondering if there is a utility that could convert a cron expression into a human readable string. Something like : ""0 30 10-13 ? * WED,FRI" will becom...

programatically using Hardware Random number generator

I'm working on a desktop application and would love to use any hardware random number generators that happen to be available, though I dont want the user to have to do any confusing setup to use it. its Java/Clojure based so something in the java world would be nice though I'm willing to work with just about anything. Know of any program...

Bringing tab to front in JTabbedPane

When I use setSelectedComponent or setSelectedIndex on a JTabbedPane object, the panel always comes up in my UI. However, sometimes the tab associated with the panel remains hidden. In other words, the tab does not scroll to a visible portion of the tabbed pane. How can I fix this? I have tried the cheesy select one index, then selec...

How can I wait until a component is shown in Java?

Hi, I have a component (JPanel) inside a Window. I always get false when calling panel.isShowing(), when calling from a windowGainedFocus() event (when the parent window gets focus). I assume that when the windowGainedFocus() event is called, the painting of the JPanel within this Window had not been finished yet. I was trying to plac...

Java threading question - listening to n error streams

Hello all, Let me say first that my experience with threading is pretty low. I have an app that starts up several other Java jars via the Runtime.exec method. The problem is that the jars that are started need to be run concurrently, but in order to get at the error stream for the started jars you have to basically have a loop 'sitti...

mobile app auto dial on message from server

How do I autodial a mobile using a j2me app running on it based on a message initiated from a remote server. The server message could trigger the j2me app to dial a predefined number. I have figured out that the dialing can be done with the platformRequest() method through which I can send it a phonenumber as a url string. However I don...

Alternative LAF to quaqua

Since installing the new version of quaqua I have been having weird problems like text not displaying over my intro splash screen and the default java icon showing up on dialogs instead of mine. I was wondering if anyone knew an alternative to quaqua I could try for Mac LAF. ...

Fastest service wrapper for Java apps

Hi. I'm looking for most performing Java service wrapper, which could make Java application running as a service on Linux. Can anyone recommend such utility. Thanks. ...

Does Spring-MVC annotation based bean validation support for collection-based property ? (Spring-MVC)

Hi, I have a command class named Parent as follows: public class Parent { private List<Child> childList; // getters and setters } And a Child class according to public class Child { @NotBlank private String name; @NotBlank private String email; @NotBlank private Integer age; } In Spring valid...

How can I split out individual column values from each line in a text file?

I have lines in an ASCII text file that I need to parse. The columns are separated by a variable number of spaces, for instance: column1 column2 column3 How would i split this line to return an array of only the values? thanks ...

Validating that all JDBC calls happen within a transaction

How can I validate that all JDBC access happens on an active transaction, i.e. java.sql.Connection.getAutoCommit() always return false? I'm using Spring for transaction management ( @Transactional ) and Hibernate for data access. Update: What happens is that some Hibernate access is performed without the service method being annotate...

Managing swing UI default font sizes without quaqua

We are trying to get quaqua out of our application but we had been using a call to quaqua to set the font size to be smaller with a call like this: System.setProperty("Quaqua.sizeStyle", "small"); My question is there an easy to do the same sort of thing without using quaqua? Or does anyone know another good look and feel for os x? ...

Hibernate 'tableless' enum mapping?

I am dealing with the following scenario: We use table-per-subclass inheritance, meaning the concrete tables' primary keys are foreign key references on the abstract table. Superclass is Product, subclasses are Book, DVD, AudioCD, ... Now in the Java superclass, say Product.java, we have an enum of the types of products: book, dvd, mu...

How do I create an alphablending BufferedImage using J2ME (CDC/PP 1.1)

I have a BufferedImage created using new BufferedImage(wid,hgt,BufferedImage.TYPE_INT_ARGB); to which I assemble a wallpaper using multiple other images. It works fine in Jave SE, but when I tried to run the code on a J9 CDC/PP platform I discovered that the Personal Profile BufferedImage has no constructors! Can anyone point me to ...

Best strategy for reading XmlFormatter formated log files in Java?

Hi! I've got an xml log file formatted with XMLFormatter. I'd like to process this file for report purposes. My problem is, that the log file is not finished by tag, because it is still being written, which makes xml parser bail out. The log structure is following: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE log...

RSA decrypt with Java

I am trying to decrypt a string with RSA. It was encrypted in C# on the iPhone and I have the private key. This seems like a silly problem, but all of the examples I have seen show generating the private key. I have the private key (it is a byte[] of hex). It using PKCS#1 padding. The part I cannot figure out how to do is create a ja...

Eclipse and curly braces

Is there a quick way to make Eclipse put curly brace on the next line (by itself) on a block of code? ...

the distance tends to be one, but I want the distance to tend to be another

When I'm positioning textareas on the screen (with the gui-builder of netbeans), the distance between the first and the second tends to be one (18 pixels), the distance between the second and the third tends to be one too (18 pixels too), but I want both distances to tend to be another (25 pixels). How to do that? ...

In java what does extending from a comparable mean

I see code like this class A implements Comparable<A> { } What does this mean, what are the advantages and disadvantages of it? ...

Add description to columns using Java code

I can create a table and its columns in Java by using the statement: CREATE TABLE table_name(column1 int, column2 double, etc...) What I would like to do is to add descriptions to each of these columns with an appropriate statement, I found a stored procedure sp_addextendedproperty that looks like it can be used to accomplish this I j...