I set up JMF using this tutorial http://www.deitel.com/articles/java_tutorials/20060422/PlayingVideowithJMF/ . I set up the mp3 codec in the jmfregistry like you are suppose to and I am able to play any mp3 I want when I use jmstudio. This means I set up everything correctly but when I execute my code I still get this error message:
Una...
I am trying to use Spring and wx-xmlrpc together. The problem is that XmlRpcClient has a setConfig() method that doesnt follow the Java Bean spec : the setter and the getter dont use the same Class. So Spring complaints when I have the following context.xml :
<bean id="xmlRpcClient" class="org.apache.xmlrpc.client.XmlRpcClient">
<pr...
I'm creating a custom taglib with .tag files. Everything works great, except when I load 2 pages at the same time. It seems the .tag files are re-compiled on every request and the concurrency causes the compilation to fail.
Is this normal behavior for .tag files? I would have expected them to be compiled only once.
Is there some way t...
I'm trying to apply an AffineTransform to an image in Java. Here's the code that I'm running.
AffineTransformOp op =
new AffineTransformOp(atx, interactive ? interpolationInteractive : interpolationNormal);
displayImage = op.filter(displayImage, null);
Where atx is a valid AffineTransform object. This code seems to run fine, ...
I am in the process of refactoring my existing code. It actually works fine, but it is a bit cluttered with multiple if-else conditionals checking the value of one variable and change the value of a second variable to an updated value taken from a fixed enumeration structure.
else if (var1 == 'valueX')
{
if (var2 == MyEnum.A)
var2 = ...
I have this method to insert data using jdbc that will insert the value according to the java type. Something like this:
Object o = map.get( key );
if( o == null ) {
// setNull( index );
} else if( o instanceof String ) {
// setString( index, (String) o );
} else if( o instanceof Timestamp ) {
// setTimestampt( index, ( Ti...
Ok, I'm going crazy here. I have been rewriting the NIO code for my server, and running into some real headaches. The bottom line is that getting NIO "right" is very hard. Some people pointed me to the Rox tutorial at http://rox-xmlrpc.sourceforge.net/niotut/, which seems to be on a good path, but is not as complete as I would like. ...
My JOptionPane code is as follows:
selectedSiteName = JOptionPane.showInputDialog("Enter the name of the new site:");
This renders out an input with a textbox and an OK and Cancel button. I need to detect if Cancel was clicked.
Cheers.
...
If we have:
public interface Foo{}
public class Bar implements Foo{...}
Is there a difference between:
public class BarBar extends Bar implements Foo{..}
and
public class BarBar extends Bar{..}
I see a lot of code like this and it always confuses me. Does BarBar need to implement Foo? I mean since it extends Bar to begin with i...
I'm using oracle10g database and eclipselink, I need to obtain the last inserted key from the table so i've created this query
javax.persistence.Query q =
em.createQuery("SELECT nvl(MAX(c.myAtt),0) " +
"from myTable as c");
return Integer.parseInt(q.getSingleResult().toS...
I been working the whole week to troubleshot a production error.
I have eventually got the the point where I can find the culprit record which is causing all the mess.
I've got the following error message:
java.sql.SQLException: [BEA][Oracle JDBC Driver][Oracle]ORA-01438: value larger than specified precision allows for this column
...
The following code leads to "java.lang.IllegalThreadStateException: Thread already started." the second time it is run through on the program.
updateUI.join();
if (!updateUI.isAlive())
updateUI.start();
This happens the second time updateUI.start() is called. I've stepped through it multiple times and the thread is called ...
I am just trying to get some things to work so I can try some of google app engines java. However I seem to have a problem with something that I can't get a hold of.
The java code looks like this:
import java.net.URL;
import com.google.gdata.client.photos.*;
import com.google.gdata.data.photos.*;
public class TestPicasa {
public stat...
I can't figure out why I am getting this exception from my ant build.xml file. I checked and everything is in the classpath. Why must this be so complicated?!
I had trouble with Ant in the past and it seems it always is something related to the classpath. I am pointing to junit.jar using both ways: within eclipse: window->preferences->a...
How do i increase the width of a column in jasper reports dynamically in java, i have tried changing many things in java side like reading the style sheet and changing the values. But in this case i don't know how to initialize the method which will read the width and change it.
...
Hello,
I am trying to use ant to build an application, run the application's main() method, run junit tests, and package everything in a jar file (source+build+libraries+build.xml). The classes include a runner class with a main() method entry point.
The objective however is to inlcude all libraries used, like junit.jar, and the ant bu...
Hi,
I am having an class which extends Activity and i am trying to create an object of that class in normal java class ,It is giving me an exception "Cant create handler inside thread that has not called looper.prepare" ,what i am doing wrong
Thnx in advance.
...
What are class, object and instance in the context of java?
Please illustrate your answer with examples.
...
Hi all
I have a program that needs to query a database in a given interval and with the records it gets call perform some action, then update the table again.
I am using the ExecutorService to run the threads, but am wondering, should each thread get its own connection (because it needs to update database) or can I use the same connect...
I render text with a custom table cell renderer and I want to trim the text drawn if it would exceed the current cell width, switching to a "This text is to long..." kind of representation, where the three dots at the end never leaves the bounding box. My current algorithm is the following:
FontMetrics fm0 = g2.getFontMetrics();
int h ...