we use Gradle for building Java projects and at the moment we have Ivy repositories to store third-party artifacts and also to publish our own artifacts into (repo is build using Gant scripts and the Ivy ANT tasks). but repo management is basic.
Gradle is able to work with a maven repo as well, so switching to a Maven artifact manager l...
IBM has (had) a free learn-Java program called RoboCode, in which custom robots could be written that would then do battle in a 2D space. I would like to write the environment that supports such robots, but don't know what pattern or design to use. Each robot is a thread. Each thread is given a certain (indeterminate) amount of run-ti...
I am catching keyboard events/presses using the onKey method:
public boolean onKey(View arg0, int arg1, KeyEvent arg2) {
//do something
return false;
}
This fires off just fine for physical keyboard presses but it does not fire on virtual keyboard presses. Is there an event handler to handle virtual keyboard presses?
...
Have you ever learned two new technologies at the same time? I'm learning Java at work and ASP.NET MVC at home. Are there any pitfalls to learning two technologies at the same time? What about some benefits? Do you find yourself fighting burnout?
...
I have a class MyMap which wraps TreeMap.
(Say it's a collection of dogs and that the keys are strings).
public class MyMap {
private TreeMap<String, Dog> map;
...
}
I would like to turn MyMap iterable with the for-each loop. I know how I would've done it if my class was a LinkedList wrapper:
public class MyList implements Iterabl...
In the following JTreeBasics.java file, is it possible to have different images for BlackBox and WhiteBox nodes?
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.tree.*;
import java.lang.reflect.*;
public class JTreeBasics{
JFrame f;
DefaultMutableTreeNode root,n1,...
Hi I'm trying to make a game in java that gives users the option to a joystick or gamepad to control movement. So I found something called "JInput" that is suppose to make it easy to detect all connected game controllers. The problem is that when I run it in Eclipse I get the following error: "java.lang.UnsatisfiedLinkError: no jinput-...
I've read a few articles, and I understood the following (please correct me and/or edit the question if I'm wrong):
The java heap is segmented like this:
Young Generation: objects that are created go here, this part is frequently and inexpensively garbage collected
Old Generation: objects that survive the garbage collections of the Y...
I've been updating an existing library to throw exceptions to help improve debugging by people using the library.
At first, I thought I'd define exceptions specific to each class, however it turns out most of those exceptions are simply extensions of existing runtime exceptions (e.g., FooNegativeIntArgumentException extends IllegalArgum...
How in Java do you return the first digit of an integer.?
i.e.
345
Returns an int of 3.
...
Yes, I know, the old question of the best web framework ... but let me explain.
I'm looking for Java Servlet based web framework that allowes RESTful interaktion and is also suitable to build web GUIs.
What I want:
REST support with http content negotiation and nice URL mapping
data conversion from request params to domain object (an...
Does anyone know if there's a very big demand for a touchscreen-based keyboard less UI for Car, Navigation, or Mobile devices?
I know that Android is a very big, very popular platform. So is Cocoa Touch.
What I'd like to envision is using a Java UI with something like Qt that can be applied to a touchscreen. I would initially use And...
I want to implement a Java HTTP server locally, I mean the server computer would be in my control. I'm expecting not more than 20 clients to send requests to it.
I was wondering how to go about it:
Should I use a J2EE servlet container, like Apache Tomcat?
Could I use J2SE classes and just build it using them?
Are there any existing al...
I have a list of all direct flights. From this I want to get flights from A to B with connections. What will be a suitable algorithm or data structure for this problem? Thanks.
...
Can anyone show me (or provide a link to) an example of how to encrypt a file in Java using bouncy castle? I've looked over bouncycastle.org but cannot find any documentation of their API. Even just knowing which classes to use would be a big help for me to get started!
...
I'm trying to digitally sign an XML document using Java. I've got an implementation working with some references I've found that use various implementations in the javax.xml.crypto.dsig package.
However, my current implementation is like many of the examples I've looked at - it's rather verbose and involves using no less than 23 differe...
In my C# project I have a static List that gets filled immediately when declared.
private static List<String> inputs = new List<String>()
{ "Foo", "Bar", "Foo2", "Bar2"};
How would I do this in Java using the ArrayList?
I need to be able to access the values without creating a instance of the class.
Is it possible?
...
Good evening all.
Is there a standard way to do the redirection/rewrite of a specific url to a different one?
Imagine an user accessing the following view: http://www.something.com/us/download.xhtml?id=2
I want to set the Locale from the previous view and redirecting to http://www.something.com/download.xhtml?id=2
<page view-id="/us/...
I am refactoring java 1.3 legacy code, around 700 classes.
Due to the lack of generics in this code I see currently thousands of warnings, which of them should I simply disable? I don't wan't to discuss of every single warning, just a rule of thumb in terms of groups displayed in eclipses the errors/warnings dialog.
...
Hello,
After upgrading to JBoss AS 5.1, running JRE 1.6_17, CentOS 5 Linux, the JRE process runs out of memory after about 8 hours (hits 3G max on a 32-bit system). This happens on both servers in the cluster under moderate load. Java heap usage settles down, but the overall JVM footprint just continues to grow. Thread count is v...