Is there a performance difference between these two pieces of code? My gut feeling is that the second option is slower, as the Cell object has to be constructed each time, but I like the idea of returning a Cell.
Option One:
//Call to method
initiTextDefaultCell(borders);
iTextTable.setDefaultCell(iTextDefaultCell);
//Other code...
p...
hi,
I need to popup dialog to be showed when i get a message from differnt thread but the dialog should be not dependent on Activity i.e, it should display the dialog wherever the screen focus is .can it be done ..because the dialog is handled per Activity ,i thought of using service but again it would be one more thread added so ...
I am building an application in Java (with a jQuery frontend) that needs to talk to a third party application. it needs to update the interface every two seconds at the most.
Would it be a good idea to use comets? If so, how do they fit into the picture?
What other means/technologies can I use to make the application better?
...
I've read a lot of the SCJP questions here, and all the tips and tricks from Sun and the Head First publishers, and I wonder if I am missing something.
I'm having trouble moving from knowledge about a component of Java to being able to answer a question that applies that knowledge. If you asked me a specific question about the language ...
I'm looking for a standalone Java library which allows me to parse LDAP style filter expressions Is such thing available, or is it advisable to use ANTLR instead and build it by one self?
As background: the filter itself is submitted through a network, and I want to create say, the appropriate hibernate Criteria. I'm not doing anything ...
A couple of questions regarding Java's WeakReference and Collections:
Is there a library out there that implements Java's various data-set interfaces (eg Collection, List, Set, Queue etc) with WeakReference transparently? Like WeakHashMap is for the HashMap interface?
Or is the common solution to simply create normal Collections and th...
It's 2009 and we still all hold on the JavaBeans despite all their flaws, mostly because of the tooling support which we wrote in our own blood.
But now we have method chaining and internal DSLs and some pressure to replace or extend JavaBeans with DSL classes. Has anyone an implementation that implements PropertyDescriptor for a DSL (w...
I have already developed a setup.exe for windows, having features like autodetecting JRE version, autoinstalling required JRE version, autostart on windows start etc. I have made this exe from a jar file(jar file was not having the above mentioned features. Features are added later when transforming a JAR to EXE. Now I was wondering if I...
I want to run unit tests (Junit) on some model classes that typically will send emails confirming that things happened. Is there a mock email server that you can use with unit tests that will let you confirmation that your run tried to send an email without actually sending the emails out?
This seems like it would be a nice to have, ju...
Hello all,
I am working on an assignment to create a tictactoe game using a multidimensional array, a separate class with methods to be invoked by the main class.
The array is 3 X 3 and is initialized to zero. When player 1 chooses a location on the board a 1 is put in that specific index. Then the prompt allows player 2 to make thei...
I wan to check if my stateful bean is passivated/activated and the corresponding callbacks are called properly.
For that I want to configure the containers GlassFish and/or JBOSS to limit the number of instances of the bean.
Is it possible ? If yes, how ?
...
Hello,
I'm new to the Spring MVC Framework and Webflow, and ofcourse, I've been thrown on a project involving these technologies. I'm having a problem that I can't get answered on the Spring website forums, so I thought I'd check with the smart people on this forum.
I have a view (i.e. screen) which when I exit, I want to go to differe...
Java Reflection provides a mechanism to introspect an Object at runtime. No second thoughts, this is a great feature, but it breaks all the Refactoring conventions!
There is no easy way (other than File Search) even in modern IDE's to know which attribute is referenced and where. This makes Refactorings much more complex (tiresome!) and...
I am getting the value of amount like 4567.00 , 8976.00 etc. Now while dispalying this value in displaytag i would like to print it as $4567.00 instead of just 4567.00. How can i do that?
Provided i just want to use display tag. I can acheive the same thing using core:out tag.
$<core:out value="${variableInMyList}" />
Answer Found ...
We have a text field on a Subreport with 173 carriage returns causing a crash. If we remove this data it works fine. We have Stretch Type for this text field No Stretch, the Print When Detail Overflows is false and the Stretch with Overflow. Now we plan on changing the interface as well, but is it possible to make this work with Jasper...
I have a message handler, which consumes from a JMS queue and that sends results to another JMS queue. The message handler lives in a Spring DefaultMessageListenerContainer.
When the container shuts down, I would like for it to finish handling any requests that it already consumed and send out the results. At the same time, it should no ...
Is there a thread-safe way to concurrently consume the stdout from an external process, using ProcessBuilder in Java 1.6?
Background: I need to invoke pbzip2 to unzip large files to stdout and to process each line as the file is decompressed (pbzip2 utilizes multiple CPUs, unlike other implementations).
The logical approach is to creat...
I am practicing over the summer to try and get better and I am a little stuck on the following:
http://www.javabat.com/prob/p123384
Given a string, return a new string where the first and last chars have been exchanged.
Examples:
frontBack("code") → "eodc"
frontBack("a") → "a"
frontBack("ab") → "ba"
Code:
public String fr...
I trying to parse a data in a MySql Format, I ran accross SimpleDateFormat. I can get the proper day and month, but I got a strange result for the year :
date = 2009-06-22;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date d = sdf.parse(date);
System.println(date);
System.println(d.getDate());
System.println(d.getMonth())...
Hi all,
I'm trying to replicate some image filtering software on the Android platform. The desktop version works with bmps but crashes out on png files.
When I come to xOr two pictures (The 32 bit ints of each corresponding pixel) I get very different results for the two pieces of software.
I'm sure my code isn't wrong as it's such a...