I am trying to display my command objects collection field inside a list box. Inside said collection is a field, id and name. I want use the id as the html option value and the name as the option text. See the code below;
<form:select id="customCollection" path="customCollection" size="10">
<form:options items="${command.customColle...
Hi,
I want to wrap a number of classes implementing the Job interface with a JobEnabledDecorator object that determines whether or not it executes.
I am having trouble figuring out how to configure this in PicoContainer, so that it knows to create the Job implementation objects with a JobEnabledDecorator wrapping them.
Is this possi...
I have this code (you probably can ignore that it is Swing code), but I usually end up with too many arguments in my constructor. Should I use model bean class and then pass that object in the constructor?
public BrowserFrame(final JTextField url, final JTextArea response, final JTextField command, final JButton actionButton) {
th...
These methods are laughably stupid, IMO, but I want to get a feel for what other developers think of such code. Criticisms may include technical and stylistic errors. Corrections may use anything from Apache commons-lang, such as StringUtils, DateUtils, etc, as well as anything in Java 5. The code is intended for a web application, if th...
Does anyone know a 'nice' way to prevent SmartGWT from creating TextItem form items with the spellcheck="true" set? It's annoying to get spellcheck markers on name fields etc.
The nuclear option is to hack out the problem js code from the smartGWT library, or replace the js method at runtime with:
formItem.setAttribute("getBrowserSpel...
Let's say that I create an instance of class B, which has an static variable x, assigned with a value of 3 in the class B declaration. In the main() method, I do this:
B b = new B();
b.x = 7; //allowed to use an instance to set the static member value
After this, b is serialized and then de-serialized. Then, the following line occurs:...
This is an answer to anyone having problems getting a program to appear in the Blackberry simulator or problems generating a COD file.
I have been programming in JAVA using the Eclipse IDE and my program was working fine in the BB simulator. After creating a new package and adding more class files to my project, I noticed that my change...
Hi,
I am writing a java program in eclipse(galileo version). The program reads simple user data from input file specified at console command and process it.
But I am not sure where I should place this input file inside eclipse workspace, so that when I run program in eclipse and type in input file name, it can be found and program can...
Hi,
I think most of you will know, programmers often reuse code from other software. I think, most of the time it is a good idea. But if you use code from another project your program depends on the other project.
I my current case I got three java projects A, B and C. Now A uses B and B uses C. I'm using eclipse IDE and added B to th...
I need a JDBC driver for MsAccess to be used in a Unix environment
I would strongly prefer it to be an open-source
Also it should support SQL statements
(Jackcess came close to being my choice- but it doesn't support SQL queries)
http://jackcess.sourceforge.net/faq.html#query
...
I know that there are many different architectures exist. In this question I consider 3-tiers architecture (presentation-services (busyness logic)-data access layer (DAOs). And I want to concentrate on how presentation tier works with services tier.
The problem I met is standard. I have stateless services layer, and I think it should be...
My app scans part of a file system, and my users reported it was very slow when they were scanning a network drive. Testing my code, I identified the bottleneck: the methods File.isFile(), File.isDirectory(), and File.isHidden(), which are all calling fs.getBooleanAttributes(File f). This method appears to be very slow on Windows netwo...
With the following code, I want to create a Jpanel generic component and add two sub components, a Label and a JTextField. I am to add the components, but they do not left align.
(No, I don't need GridBagLayout, but I was trying to do a basic example with GridBag. Can you describe how to do this with GridBag and not another layout).
...
The rules for defining a properly constructed XML name are defined here.
C# has a utility method to convert strings into a valid XML name: XmlConvert.EncodeName.
What is the Java equivalent of this utility method?
Note: XML names must begin with a letter, _, or : character. After the first character, be composed only of letters, digit...
I am interested in creating a work place consisting of multiple jframes. I would like to implement the functionality that google dashboard uses to dock their frames into a position. I would also like to be able to snap two frames together. Does anyone have any idea how google does this, how it might be done or perhaps code of an open sou...
HTTP Last-Modified header contains date in following format (example):
Wed, 09 Apr 2008 23:55:38 GMT
What is the easiest way to parse java.util.Date from this string?
...
What is the easiest way to programmatically extract structured data from a bunch of web pages?
I am currently using an Adobe AIR program I have written to follow the links on one page and grab a section of data off of the subsequent pages. This actually works fine, and for programmers I think this(or other languages) provides a reasonab...
I have an application which has a font stored within a jar file. It is loaded with:
public Font getChessFont()
{
InputStream in = ClassLoader.getSystemClassLoader().getResourceAsStream("fonts\\MERIFONTNEW.TTF");
Font toReturn;
try
{
toReturn = Font.createFont(Font.TRUETYPE_FONT, in);
}
catch (Exception e)
{
toReturn = gam...
Here's the method I'm trying to write ( doesn't compile now, because what is not seen as an Iterable ):
public <T,V> ArrayList<V> mySelect(T what,ITest<V> x) {
ArrayList<V> results = new ArrayList<V>();
for(V value : what) {
if(x.accept(value)) {
results.add(value);
}
}
return results;
}
...
I have a requirement to calculate the average of a very large set of doubles (10^9 values). The sum of the values exceeds the upper bound of a double, so does anyone know any neat little tricks for calculating an average that doesn't require also calculating the sum?
I am using Java 1.5.
...