java

What is a good open source J2SE JTA TransactionManager implementation?

Basically, what it says on the tin; I need a JTA implementation useable in a J2SE application, ideally one that doesn't carry too much of a framework burden with it. ...

Example of Jasper Reports in Swing Application using Web Start

How do I use Jasper Reports in a Swing application using Web Start? ...

Setting up java3d on os x leopard

I have recently installed OS X on my MBP and am wanting to set up java3d on it. I have set this up on windows which proved a lot easier with the installer provided. the mac install instructions can be found here: http://inverse.chi.googlepages.com/README-unzip.html I have placed both the j3d and jogl libs in my home directory /Users/ma...

3d draw, setting perspective point, setting view point!!

I need to draw 3d projections and i am using opengl wrapper for JAVA. Problem: - how to set view point in java opengl (for examle i want to my program to draw object on screen like i am looking at that object from (0,0,0) ) - how to set perspective point(point in 3d where look is heading to, for example i want may progra...

proper usage of synchronized singleton?

So I am thinking about building a hobby project, one off kind of thing, just to brush up on my programming/design. It's basically a multi threaded web spider, updating the same data structure object->int. So it is definitely overkill to use a database for this, and the only thing I could think of is a thread-safe singleton used to con...

Java Aptitude Test Tips

Hi, I'm applying for as a Java software engineer in a company in a couple of days. I really want to get hired in this company. Do you guys have any suggestions on what I should review or learn so that I'll be prepared? Also do you guys have any tips? Thanks in advance! ...

Java: How can I feed commandline input into an array?

I'm working on a Bruce Eckel exercise on how to take a keyboard command line input and put it into an array. It's supposed to take 3 separate inputs and place them into an array and print them back out. Here is the code I have so far: //: object/PushtoArray import java.io.*; import java.util.*; class PushtoArray { public stati...

spring MVC sample web app

Hi, I'm looking for an example Spring MVC 2.5 web app that I can easily: Setup as a project in Eclipse Deploy to a local app server (using Ant/Maven) There are a couple of example applications included with the Spring distribution ('petclinic' and 'jpetstore'), but they don't provide any Eclipse project files (or a way to generate t...

Creating animated GIF with ImageIO?

Has anybody managed to convince ImageIO to write an animated GIF, and in particular setting the correct metadata? My first attempt is roughly as follows (where b1 and b2 are BufferedImages): ImageTypeSpecifier spec = new ImageTypeSpecifier(b1); ImageWriter wr = ImageIO.getImageWriters(spec, "GIF").next(); wr.setOutput(ImageIO.createImag...

Why doesn't this Java regular expression work?

I need to create a regular expression that allows a string to contain any number of: alphanumeric characters spaces ( ) & . No other characters are permitted. I used RegexBuddy to construct the following regex, which works correctly when I test it within RegexBuddy: \w* *\(*\)*&*\.* Then I used RegexBuddy's "Use" feature to conver...

PDF Text Extraction Approach Using OCR

Has anybody attempted to extract text from a PDF using an OCR library and Java? What did you find to be the most reliable library for text extraction. Most of the approaches I've seen (tesseract, GOCR) are C libraries that would require some JNI code to be written. I'm familiar with pdfbox, which is now an Apache incubator project ...

Streaming Data through Spring JDBC, unknown length

I currently have an application that inserts byte[] into our DB through the use of Spring JDBC [SqlLobValue]. The problem is, this is not a scalable way to take in data, as the server is buffering all the data in memory before writing to the database. I would like to stream the data from the HttpServletRequest Inputstream, but all the ...

Getting directory path to .class file containing main

Is it possible to get the path to my .class file containing my main function from within main? ...

make a button round

hi, im trying to make a JButton round at the (x,y) corrds of (150,210). i want the button to be an oval of the size (40,40). and the buttons background color red. it doesnt need text so i should get a button to what ever size i want right. i am using a panel and i set the setLayout to null setLayout(null) i checked google and it brou...

Can I connect to a Java API with C#?

I am tasked with writing an application to connect to the DoubleClick DART API and download ad creatives. The API is currently Java only, but they are working on (eventually) releasing a SOAP version. As a C# developer, I'd like to write the application in C# and access the Java API, until the SOAP API is available. Can I do this? I...

What is the proper way to configure SMTPAppender in log4j?

I'm trying to configure log4j to use the SMTPAppender but I keep getting relay access denied errors. I get this error when executing my code on my laptop AND straight from my shared hosting environment. Here's the relevant config: #CONFIGURE SMTP log4j.appender.email=org.apache.log4j.net.SMTPAppender log4j.appender.email.SMTPHost=mydo...

What programming language offers the best salaries?

I keep having discussions about this topic and I want the input of the community. As far as I've heard, .NET is the current leader in $/hr or $/project ranking. How does .NET rank against Java or J2EE? ...

What is Object serialisation?(Java)

Hi In not so technical way, what is object serialization and the purpose of it? When should it be used? (any analogies exampls welcome) Thank You ...

Connecting to MS SQL Server with JRuby

I'm working on a project that involves some scripting and data storage. The database that I have available to me is MS Sql Server and it is on a windows platform. Despite this I'm looking to leverage Ruby to write the script, specifically JRuby. There are a couple of reasons for this I would like to leverage Prawn to create pdfs ...

javax.comm: Error when device is disconnected

I have an application that reads data from a com port using javax.comm. The problem I am having is that if the device that I'm reading from is unexpectedly disconnected I get an error in the console that says "WaitCommEvent: Error 5" I have looked around and can't find any helpful information about this. I have set all of the notifyOn...