JSuggestField – The JTextField that makes suggestions

JSuggestField behaves like “Google Suggest”, but you can use it in Java. It extends JTextField, adding special features. You can use it just like any other JComponent.

JSuggestField s = new JSuggestField(this, suggestData);

suggest

Archive contains the JSuggestField-class and an example. Tested with jre 1.6

Download

version 0.5, 1. November 2011
new: define how jSuggestField matches inputs,
case sensitivity and setHint() for displaying a ‘type here’ text
Licensed under the GLPv3

Introducing: jNetMap – network monitoring

I’m happy to (finally) present a new tool: jNetMap

jNetMap will ping all registered devices every x minutes, updating it’s status according to the result of the ping. Alternatively you can also monitor a specific port, such as port 80 for webservers. Available devices are green, unavailable devices are red. Gray means “unknown” and orange “not found”.
NetMap
To start drawing a new map, select “add”, enter the details and hit enter. You can connect the devices by right-clicking on a device and selecting “connect”. The rest is pretty self-explanatory I guess…
You can also save and open existing maps so you don’t have to redraw everything ^^
It also supports arguments, e.g. “java -jar jNetMap.jar some/where/some.netmap” will open the “some.netmap” when starting the application. This also works for the “open with…” option in any OS.

I’m working an a complete rewrite of jNetMap for the 0.5 release. This project has grown to much and the current framework is not able to carry more features. Please be patient, it may take a while 🙂
I was also able to take over the project space over at sourceforge.
More…

» Download

Version 0.3.3.5 (25. Jul 2009)

executable .jar file (crossplattform)
requires Java version 1.6.0.13 or later
Ubuntu/Debian available .deb-file

» User Manual

PDF File (right-click, save as …)
» get the source code zip  (released under the GPLv3)

Feedback, suggestions & feature requests: public(ät)rakudave(dot)ch

Avoider Game

avoiderAs part of the lecture, we developed a small JApplet game. I decided to create an avoider.

Rules:

  • don’t toch the wall
  • don’t touch the red circles
  • circles will bounce off the walls and each other
  • circles will grow over time
  • catch the green circle to reduce the size of the circles and gain 3 seconds of shield power
  • the shield will protect you from all threats
  • you have 3 seconds of shield power for an easy start

» Open the game in a new window

» Download the source

I also wrote my own “collision detection” for the game, as there is no intersect method for ovals:
let’s call our circles a and b:
If sqrt((bx-ax)²+(by-ay)²) < (a.radius + b.radius), then a and b are colliding.
The collision is only 1D, without friction etc., so I just swap the velocity-vectors of the circles.