java

Java table model design

I have a table class that creates modifies a table of items. I want to display those items in a JTable using a table model. To me table model belongs to my gui package but table needs table model in order to fire changes and table model needs table class in order to display it so i can not separate the two. if you need to do this what wo...

Fast compiler error messages in Eclipse

As a new Eclipse user, I am constantly annoyed by how long it takes compiler error messages to display. This is mostly only a problem for long errors that don't fit in the status bar or the "Problems" tab. But I get enough long errors in Javaespecially with genericsthat this is a nagging issue. (Note: The correct answer to this question ...

How to properly use Struts ActionForms, Value Objects, and Entities?

I've inherited a large Java app that uses Struts, Spring, and Hibernate. The classes and interfaces I deal with daily are: Struts Actions, Struts ActionForms, Value Objects, Service Interfaces and Implementations, DAO Interfaces and Implementations, and Entities. I'm pretty clear on the how and why of most of these, except I'm unsure abo...

Java Tutorial

I am interested in learning Java. What is the best online tutorial? ...

How do you make a web application in Clojure?

I suppose this is a strange question to the huge majority of programmers that work daily with Java. I don't. I know Java-the-language, because I worked on Java projects, but not Java-the-world. I never made a web app from scratch in Java. If I have to do it with Python, Ruby, I know where to go (Django or Rails), but if I want to make a ...

(Vocal code) Need some help finding text-to-speech addon

Hi! I am looking for an addon that can say characters vocally. It is for non-commercial use, and it would be nice if it can vocalize more languages, like asian, english etc... I have googled it, but can't seem to find anything for free use. Update: This is for web use ...

Can I connect to SQL Server using Windows Authentication from Java EE webapp?

I am currently investigating how to make a connection to a SQL Server database from my Java EE web application using Windows Authentication instead of SQL Server authentication. I am running this app off of Tomcat 6.0, and am utilizing the Microsoft JDBC driver. My connection properties file looks as follows: dbDriver = com...

Naked Objects. Good or Bad

I have recently been exposed to naked objects. It looks like a pretty decent framework. However I do not see it in widespread use like say, Spring. So why is this framework not getting any mainstream application credit. What are its shortcomings as you see? ...

Possible Memory leak in Number of Loaded classes in Java Application

I recently began profiling an osgi java application that I am writing using VisualVM. One thing I have noticed is that when the application starts sending data to a client (over JMS), the number of loaded classes starts increasing at a steady rate. The Heap size and the PermGen size remains constant, however. The number of classes nev...

Spring: Obtaining ResourceBundle based on MessageSource

I'm using hibernate validator framework with Spring. A class implementing the Spring Validator validates objects with Hibernate's ClassValidator. To localize ClassValidator's error messages I need to pass a ResourceBundle into the class' constructor. My ApplicationCountext has a MessageSource bean (ReloadableResourceBundleMessageSource) ...

Java Development on a Mac - Xcode, Eclipse, or Netbeans

I've been using Xcode for the usual C/C++/ObjC development. I'm wondering what are practical considerations, opinions of Xcode, Eclipse or NetBeans usage on a Mac for Java development? Please don't include my current usage of Xcode in your analysis. ...

JPA and inheritance

I have a some JPA entities that inherit from one another and uses discriminator to determine what class to be created (untested as of yet). @Entity(name="switches") @DiscriminatorColumn(name="type") @DiscriminatorValue(value="500") public class DmsSwitch extends Switch implements Serializable {} @MappedSuperclass public abstract class ...

Is there a more efficient way of making pagination in Hibernate than executing select and count queries?

Usually pagination queries look like this. Is there a better way instead of making two almost equal methods, one of which executing "select *..." and the other one "count *..."? public List<Cat> findCats(String name, int offset, int limit) { Query q = session.createQuery("from Cat where name=:name"); q.setString("name", name);...

How do I add a shortcut key to Eclipse 3.2 Java plug-in to build the current project?

One of the few annoying things about the Eclipse Java plug-in is the absence of a keyboard shortcut to build the project associated with the current resource. Anyone know how to go about it? ...

Escaping a String from getting regex parsed in Java

In Java, suppose I have a String variable S, and I want to search for it inside of another String T, like so: if (T.matches(S)) ... (note: the above line was T.contains() until a few posts pointed out that that method does not use regexes. My bad.) But now suppose S may have unsavory characters in it. For instance, let S = "[hi"...

Recommended books on Desktop Application development using MVC

I'm looking for recommendations on books about MVC on the desktop. If they use Java, that is a bonus. Some background: I'm writing a desktop application in Java. It's an audio application that has a number of views and a central model called a Library with playlists, effects lists and a folder structure to organize them. In this appl...

How do you specify a particular JRE for a Browser applet?

I have an third-party applet that requires JRE v1.5_12 to work correctly. THe user is installing JRE v1.6.07 or better. It used to be with 1.5 and below, that I could have multiple JRE's on the machine and specify which one to use - but with 1.6 that apepars to be broken. How do I tell the browser I want to use v1.5_12 instead of the ...

How should I convert Java code to C# code?

I'm porting a Java library to C#. I'm using Visual Studio 2008, so I don't have the discontinued Microsoft Java Language Conversion Assistant program (JLCA). My approach is to create a new solution with a similar project structure to the Java library, and to then copy the java code into a c# file and convert it to valid c# line-by-line....

Can I use Collections.EMPTY_LIST wihout an UncheckedException?

Is there a Generics Friendly way of using Collection.EMPTY_LIST in my Java Program. I know I could just declare one myself, but I'm just curious to know if there's a way in the JDK to do this. Something like users = Collections<User>.EMPTY_LIST; ...

What are some good java make utilities?

I'm looking for a make utility for building large java programs. I'm aware of ANT already, but want to see what else is available. Ideally, it should be able to handle the .java->.class package directory weirdness that fouls up GNU Make. Win32, but cross platform is a plus. EDIT: I see some cons to using ANT, which is why I wanted to ...