java

What is a good & free game engine?

For C++, Java, or Python, what are some good game + free game engines that are easy to pick up? Any type of game engine is okay. I just want to get started somewhere by looking into different game engines and their capabilities. ...

Package and run a Java application with spring dependencies

I built a stand-alone Java application that has a bunch of dependencies (Apache Commons libs, etc) as well as a dependency on the Spring framework, which in turn has a bunch of dependencies. I built this in Eclipse, where it runs fine. Now I need to deploy it to production and so I'm trying to figure out the best way to package it with ...

Easiest way to fetch SSL page via a proxy in Java

Hi folks! I would like to fetch a SSL page in Java. The problem is, that I have to authenticate against a http proxy. So I want a simple way to fetch this page. I tried the Apache Commons httpclient, but it's too much overhead for my problem. I tried this piece of code, but it does not contain an authentication action: import java.io...

dynamic proxies with jmx can cause thread leaks?

I have a problem in Java where I set up a dynamic proxy with a JMX interface, pass this on to another component which then makes calls to the proxy object. When I do this, the application leaks two threads for each call, threads which never seem to time out and keep building up until the application runs out of memory. The threads appe...

If you are a hard core .NET programmer, would you invest in learning Java

Learning just another language is not much work. However, getting familiar with all the supporting libraries is veeeery expensive and actually you cannot go too far without that. Would you consider a worthy career investment to learn java once you already are an accepted professional of .NET or you would rather invest the same amount of...

Does the order of declaration matter in Java/C# like it does in C++?

In C++ I can't use a method if I declare it after the calling method. Does this order matter in other languages like Java or C#? ...

How to redirect all console output to a GUI textbox?

I currently have a program that prints lines of text to the screen in various manners such as 'System.out.println()' statements and for loops the print all elements in an array to screen. I am now adding a GUI to this program. My problem is that I want to print everything that prints to eclipse's console to a textbox in my GUI instead. ...

Sortable table-like Java class

Does anyone know of a class in Java that has a list of elements, so that the elements are sortable by any of the elements members? The idea is basically to have some database table-like implementation, where you can just add fields to sort by. To illustrate: SomeTable table = new SomeTable(); table.addField("name", String); table.addFie...

Java Set Initial Capacity Best Practice

Ok, here's my situation: I have an Array of States, which may contain duplicates. To get rid of the duplicates, I can add them all to a Set. However when I create the Set, it wants the initial capacity and load factor to be defined, but what should they be set to? From googling, I have come up with: String[] allStates = getAllStates(...

Will ConcurrentLinkedQueue#poll() ever block ?

My thread runs forever and calls ConcurrentLinkedQueue#poll() after a ConcurrentLinkedQueue#peek(). But under some conditions, the thread seems to hang. I know this is a bit vague but can people confirm for me that the methods poll() or peek() will NEVER block. Thanks. ...

How to print to textArea instead of console in eclipse?

I currently have a program that prints lines of text to the screen in various manners such as 'System.out.println()' statements and for loops the print all elements in an array to screen. I am now adding a GUI to this program in a seperate class. My problem is that I want to print everything that prints to eclipse's console to a textbox...

Java Web Start - Popularity

I recently used a Java Web Start application. I launched it from my web browser using an embedded jnlp link in the page I was viewing. The application was downloaded, launched and worked just fine. It had access to my local file-system and remembered my preferences between restarting it. What I want to know is why are Java Web Start ap...

What does Class.fromName() not work for me?

Hello, I'm trying to instantiate a class from variable, and written a test script. But, unfortunately, it isn't woriking. There is that script: Object co1 = new CommandDownloadHttp(); Class cc1 = Class.forName("CommandDownloadHttp"); Object co = cc1.newInstance(); Unfortunately on second line it crashes with java.lang.ClassNotFoundEx...

Using jep.invoke() method

Hi, I need to call a function from a python script and pass in parameters into it. I have a test python script which I can call and run from java using Jepp - this then adds the person. Eg Test.py import Finding from Finding import * f = Finding() f.addFinding("John", "Doe", 27) Within my Finding class I have addFinding(firstname...

Java: Are Getters and Setters evil?

I'm currently working on a simple game in Java with several different modes. I've extended a main Game class to put the main logic within the other classes. Despite this, the main game class is still pretty hefty. After taking a quick look at my code the majority of it was Getters and Setters (60%) compared to the rest that is truly nee...

Find the closest server in the network

Given a list of servers & a list of clients, how to find a server that is closest to a particular host using "traceroute"? The program should be in java. ...

How to set a string's colour before printing it to screen.

Hello. Does anyone know how I would set the colour of a string before printing it so that the string changes colour? Thanks. ...

Measuring Documentation Coverage with Javadoc and Ant

I am involved in a project in which public API documentation is a clear deliverable. In order to ensure that the release meets this requirement, I'd like to ensure that the the release target in my Ant build file fails if documentation coverage is too low. As a minimum, each identifier with public or protected access should have approp...

Clover on Java EE Container

Hi, I would like to run Atlassian Clover in a production environment (I don't have an issue with overhead ). Does anyone have experience with this, or can you direct me how to do it? My goal is to get clover reports based on real users actions. I'm using JBoss + JDK 1.5 ...

Java event handlers

Hi, I am writing a small Java app (on Windows, hence the _on_vista appended to my name). I got 3 buttons, all of which will react to a click event, but do different things. Is the following code the accepted way or is there a cleaner way I do not know about? On one half, it works, on the other half, something doesn't seem right... Tha...