java

Would you hire a C /Java programmer for a C++ role?

If you have a position where C++ experience is essential, would you consider someone who has little C++ experience but is experienced in both C and Java? ...

Class method and variable with same name, compile error in C++ not in Java?

class Test { bool isVal() const { return isVal; } private: bool isVal; }; On Compiling this file it says testClass.cpp:9: declaration of `bool Test::isVal' testClass.cpp:3: conflicts with previous declaration `bool Test::isVal()' Although the same would work for java class Test { ...

Hibernate 3.4 with slf4j and log4j

I'm attempting to upgrade from Hibernate 3.2 to 3.4, which apparently uses slf4j. Our project currently uses log4j. So my assumption is that I should be using the slf4j-log4j12 wrapped implementation. The Maven slf4j dependency is: <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1....

Canvas isn't resizing with window in Java?

I have a jFrame with a Canvas on it. When I run my program in Windows XP/Vista and resize the window the canvas resizes proportionately along with the window. However, in Ubuntu linux, when I compile the same java application and resize my window, the Canvas stays the same size. What do I need to do to make my Canvas resize with my wi...

Consuming a .Net library via COM or direct integration in Java

Hello, I have to admit the last time I programmed in Java was a data structures class in high school. So please be kind to this Java noob. I have spent a good deal of time putting together a C# COM library at work. This library relies heavily on some new .Net technologies (WPF being the big one) so translating it into another languag...

How to restart thread in java?

Hi to all, I have created a program which searches for files in a source folder. If it finds any file, it processes that file and moves it to a destination folder, then looks for a new file in the source folder. It has to keep on checking the source folder for a file. I have used a thread to look for files in the source folder. The pro...

Java, GUI builder or hand coding?

My company software has a lot of forms, till now we wrote the code by hand (MVC way). We consider start using GUI builder. There are few problems with using a Builder. Parts of the code are not readable. Parts of the code are not editable. It will be harder to edit the code later. We will have to continue using the builder in the fut...

Doubt in thread concept

Hi to all, I have created a program which search for a file in source folder. If it founds any file, it process that file and moves the file to destination folder and looks for new file in source folder. Like that it has to keeps on check the source folder for a file. I have used thread to look for files in source folder. Problem i am f...

Lobo Cobra HtmlPanel does not update GUI after JavaScript action

HI, I started implementing a HTML Browser in Swing. I want to use the Lobo Cobra toolkit because this toolkit inclused a renderer and parser for CSS and JavaScript. The pages are looking very nice and it is easy to use (one class implementation to show a html page). I want to show HTML pages in swing which can show javascript generate...

What's a good html e-mail template system that also, correctly, renders a text/plain alternative?

We have a web application that periodically sends out e-mails to users. At the moment we generate the html version and the text version in the code. However, this is cumbersome to maintain. Is there a good e-mail template system out there that can generate both the html and text versions of an e-mail from the same template for Java? So...

How can I measure the size of the object I send over RMI?

I'm doing some performance tuning on my application and would like to know a good way of measuring the size of the object that I am sending over RMI. The aim is to make my object leaner. ...

How can I share my JSP .tag files between multiple contexts?

I have a set of .tag files (for example a tag that renders a copyright notice) that I want to share across all my application contexts on my Tomcat application server. I've only ever used them in a context's /WEB-INF/tags directory, referring to them via the taglib directive tagdir = "/WEB-INF/tags" How can I make the tags available to...

Java date and calendar controls

Does anybody have any recommendations of good date pickers (either drop down calendars or small calendar components) for use in a Java Swing application - either beans or source code? They need to be robust enough for commercial applications. ...

Is there a way in Java to determine if a path is valid without attempting to create a file?

I need to determine if a user-supplied String is a valid file path (i.e. if createNewFile() will succeed or throw an Exception) but i don't want to bloat the file system with useless files created just for validation purposes, so is there a way to determine if the String i have is a valid file path without attempting to create the file? ...

BlockingQueue: put() and isEmpty() do not work together?

I would like to have a SynchronousQueue where I insert elements from one thread with put(), so the input is blocked until the element is taken in another thread. In the other thread I perform lots of calculations and from time to time want to check if an element is already available, and consume it. But it seems that isEmpty() always re...

Class.getResourceAsStream() issue

I have a JAR-archive with java classes. One of them uses some resource that is embedded into the same JAR. In order to load that resource I use MyClass.class.getResourceAsStream(myResourceName); One thing that bothers me though is whether it is guaranteed that required resource will be loaded from within the same JAR. The documentati...

C# vs Java Enum (for those new to C#)

I've been programming in Java for a while and just got thrown onto a project that's written entirely in C#. I'm trying to come up to speed in C#, and noticed enums used in several places in my new project, but at first glance, C#'s enums seem to be more simplistic than the Java 1.5+ implementation. Can anyone enumerate the differences ...

How to use RMI with applet client behind a firewall?

How can I use RMI with a applet client behind a firewall? How can I use RMI with a firewalled server and firewalled applet client? (If possible) I know that the RMI server uses port 1099 (by default, but this is configurable); however after this the communication requires a new socket on a different random port. I also know that you ca...

What's Your Complete Tool Stack for Java Web Development and Why?

My Team recently embarked on our first real Java web app. Prior to this, our corporation was primarily a COBOL shop with some VB and C thrown in. Recently, new blood's been injected, including me and a few others who by education are primarily experienced with Java but none of us have really done this full blown and for real at this po...

String.lastIndexOf() is there a difference between a char and a string with a single character?

Just wondering if anyone knew off the top of their heads if there was much difference in doing the following: String wibble = "<blah> blah blah </blah>.... <wibble> blah wibble blah </wibble> some more test here"; int i = wibble.lastIndexOf(">"); int j = wibble.lastIndexOf('>'); ...