java

Hibernate and currency precision

I have a hibernate mapping as follows: <hibernate-mapping> <class name="kochman.elie.data.types.InvoiceTVO" table="INVOICE"> <id name="id" column="ID"> <generator class="increment"/> </id> <property name="date" column="INVOICE_DATE"/> <property name="customerId" column="CUSTOMER_ID"/> <property name="schoolId" column="S...

Synthetic Class in Java

What is a Synthetic Class in Java? Why should it be used? and How can I use it? ...

avoid javax.servlet.ServletException

I am getting a javax.servlet.servletException while executing the following code.... "<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%> "<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> "<%@ taglib uri="http://jakarta.apache.org/tiles" prefix="tiles"%> tiles:importAttribute scope="request" /> h:panelGrid columns="...

Creating tables in a MS Word file using Java

Hello, I want to create a table in a Microsoft Office Word file using Java. Can anybody tell me how to do it with an example. Regards Prashanth Desai ...

How do I enforce a package-level build order in eclipse

Explanation: Say package A is always built first and then package B. I need to configure my eclipse workspace such that it mimics the build environment and shows compilation errors when sources in package A refer package B. Is this possible? If yes, how? ...

Eclipse RCP and JFace: Problems with Images in Context menu and TreeViewer

I'm working on an Eclipse RCP application. Today I experienced some troubles when displaying images in the context menu. What I wanted to do is to add a column to my table containing images of stars for representing a user rating. On Windows, this causes some problems, since the star images are squeezed up on the left corner of the table...

Are EJB Timers supposed to be persistent/reliable ?

E.g. if I set a timer to expire every day at midnight, what will happen if one "misfire" (does not trigger the callback because the server is down, for instance) ? I can't find that in the documentation. Is there a way to make this timer triggers the callback as soons as the server restart ? PS: I know about Quartz, i'm evaluating EJB ...

How do I get my netbeans drag and drop widget to know whether it is rendering inside the netbeans design view window or the running application?

How do I get my netbeans drag and drop widget to know whether it is rendering inside the netbeans design view window or the running application? I'm trying to do some custom rendering. I think it has to do with the root container. ...

prevent rich:tree from scrolling if not needed

Hello to all, I have a problem with JBoss Richfaces tree: Whenever I select a tree node (programmatically or by user click), the tree is re-rendered and (if needed) the tree node is scrolled into the visible area of the tree. So far - so good, but: the selected node is automatically scrolled at the very bottom of the tree view area, al...

Changing JTable reference at runtime - not appearing in GUI

Hi there, I'm trying to get to grips with Java ME development for the Pocket PC. I'm running the NSIcom CrE-ME emulator and building my application with NetBeans 6.5. The application is based around three tab panels, each of which have Swing components. The contents Swing components are updated at various points in the application. The...

Would you use Laszlo to develop a Flash-based front end to a Java web app?

If you have a Java based web application (J2EE webapp - never mind which other underlying frameworks are being used), and you wanted to introduce a Flash based front-end, would you use Laszlo or would you rather expose a ReST-like XML interface and build and deploy a Flash application that uses that? On one hand, Laszlo is quite amazing...

Tool for testing using parameter permutations

I remember there existed a testing program/library that will run your code and/or unit tests, creating all kinds of permutations of the parameters (null values, random integers, strings and so on). I just can't remember what it was called and searching google doesn't seem to come up with anything. I know it was created for Java code and...

Unit testing a Hibernate driven application?

This may be a naive question, but I am new to both the junit and hibernate frameworks and I was wondering what the best way to go about unit testing an application that is largely calls to hibernate, or if it is even necessary to do so? What is the best practice here? EDIT: Spring seems to be the big suggestion here. Unfortunately thi...

How to save an image-file on server through Java applet?

I have a paint application that runs as a Java applet. I need to save the contents of the canvas on server machine in any image-format typically PNG. Please help! ...

What is proper pronunciation for a Java 5 "Executor"?

What is proper pronunciation for a Java 5 "Executor"? Is it "executor" as in "the executor of a will"? Or is it "executor" as in "the executioner of a prisoner"? ...

On a 64-bit machine is the size of an int in Java 32 bits or 64 bits?

On a 64-bit machine is the size of an int in Java 32 bits or 64 bits? ...

Full-justification with a Java Graphics.drawString replacement?

Does anyone know of existing code that lets you draw fully justified text in Java2D? For example, if I said, drawString("sample text here", x, y, width), is there an existing library that could figure out how much of that text fits within the width, do some inter-character spacing to make the text look good, and automatically do basic w...

When using the latest jdbc driver for SQL Server 2005/2008 how do prepared statements, views, and stored procedures compare regarding performance?

When using the latest Microsoft jdbc driver for SQL Server 2005/2008 how do prepared statements, views, and stored procedures compare regarding performance? If I have a plain old select statement with some dynamic where clauses will I see benefits from moving from straight SQL in a prepared statement to a view or even stored procedure?...

How does a Java compiler parse typecasts?

A simple expression like (x) - y is interpreted differently depending on whether x is a type name or not. If x is not a type name, (x) - y just subtracts y from x. But if x is a type name, (x) - y computes the negative of y and casts the resulting value to type x. In a typical C or C++ compiler, the question of whether x is a type or...

Java: handling combined keyboard input

What is the correct way to separate between F1 and i.e. CTRL+F1 respective SHIFT-CTRL+F1 within an KeyListener registered behind i.e. a JButton? public void keyPressed(KeyEvent event) { int key = event.getKeyCode(); logger.debug("KeyBoard pressed char(" + event.getKeyChar() + ") code (" + key + ")"); } .. always gives me 112 ...