java

Adding an Icon to JTable by overriding DefaultTableCellRenderer

I'm trying to add an icon to a particular JTable column by specifying my own table cell renderer as below (based on parts of this tutorial): public class MyTableCellRenderer extends DefaultTableCellRenderer { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int r...

Java 1.5 Filter JTable

I would like to filter some rows in a JTable but all the stuff google found me is for java 1.6. I would like to do this using java 1.5 since i can not upgrade? ...

Un signing a signed jar

I am using bouncy castle provider for AES encryption. I need to create a fat jar from bc and my jar but as soon as i do it i get Algorithm not found exception. Is it possible to get rid of the sign and create regular jar out of it? My build process is.. i unzip all jars in to my build directory. then remove META-INF directory compile ...

Most awkward/misleading method in Java Base API ?

I was recently trying to convert a string literal into a boolean, when the method "boolean Boolean.getBoolean(String name)" popped out of the auto-complete window. There was also another method ("boolean Boolean.parseBoolean(String s)") appearing right after, which lead me to search to find out what were the differences between these two...

Downloading the JRE programmatically?

Sun's Deployment Toolkit contains a function for installing a specific JRE version, but it requires the use of a web browser. How can a desktop application download the JRE programmatically (without the use of a browser)? ...

Take a screenshot of a URL programmatically in Google App Engine?

I would like to take a screenshot of a rendered webpage in Google App Engine. Any suggestions on the best way I can accomplish this? Any Java libraries that I can programmatically render a page to a JPG or PNG? ...

Generics-Get and Put rule

I have read O'Reilly book, in that i came to know this GET and PUT rule Use an extends wildcard when you only get values out of a structure, use a super wildcard when you only put values into a structure, and don't use a wildcard when you both get and put. exception is: *)You cannot put anything into a type declared with an EXT...

redefineClasses in JVMTI

I have two questions Does redefineClasses work with JIT enabled JVM? If so, in multithreaded applications, if one thread uses redefineClasses to redefine a class, does another thread see that redefined class? (especially, if the other thread is running jit compiled code?) ...

Deploy java web service without using web server

It is possible to deploy my own created web service to any of PC without installing any web server app eg:tomcat? I want make it like agent/plug-in in any PC. In order to access the web services i only need to access http://:8080/web_service. Any suggestion about this? ...

Errors and Exceptions

I am using JDK1.6_14. This is a generic question though. When to go for error handling and when to go for exception handling? For example, when I carry a division operation out, I can either check if the denominator is zero and throw an error or just handle ArithmeticException. But when to go for which method? Thanks. ...

What are the new features in Eclipse Galileo?

I couldn't find any description of this on the site. What are some of the new features/improvements/changes in Eclipse Galileo from its previous version? Particularly for Java programming. ...

java logging vs Log4j in Spring framework. Which one is the most suitable.

Hi, We are developing a web-based application in Java using the Spring framework. We are wondering which Logging system would be the most appropriate for it, whether Log4j or JUL (java.util.Logging), which is integrated with jdk. As far as I'm concerned, the former is more popular among developers and offers higher customization option...

Can we deny a java object from serialization other than giving transient keyword

We can avoid serialising fields by using the transient keyword. Is there any other way of doing that? ...

creating folders in IMAP does not work

Hi, I am trying hard to create a folder in IMAP (I am using gmail) Here is what i have attempted so far: public boolean createFolder(String folderName) throws MessagingException { store = session.getStore("imap"); System.out.println("connecting store.."); store.connect("imap.gmail.com", 993, "[email protected]", "pass...

Java API in eclipse

Im new to eclipse , can anybody tell me how to use an JAVA API in eclipse. or share any sample Java API. Yes, how to use JavaDoc file in eclipse. ...

Retrieving information about an Image

Good day, Anybody knows of a good java library for retrieving mime type and dimension of a jpeg, gif, and png image file in java? I tried javax.imageio.ImageIO but it seems that there are some image files that it can't handle (i.e. images created with adobe photoshop). Thanks, Franz ...

How to get a correct visible rect during a validateTree?

First to describe the problem: During a re-layout due to a change in width or height, Java's ScrollPaneLayout requests the preferredSize of it's children BEFORE setting the bounds of it's viewport. On Text-Components calling getPreferredSpan can change the layout since this getPreferredSpan calls setSize internally. The effect is, that n...

Getting full string stack trace including inner exception

Java's e.printStackTrace() doesn't print all the details of the inner exception's stack trace. Is there a ready way to generate the complete stack trace in string form? (besides formatting it myself) Edit I just found out what printStackTrace() does - apparently the stack frames it filters out are exactly the ones common to the inner ...

How to override the location of Ivy's Cache?

I am using Ivy as part of my continuous integration build system, but I need to override the default location that Ivy's local cache area is. ...

tagging Interfaces?

Why do we have tagging interface? what is the use?(sorry for the question if its too noob but i just not getting it!) ...