Drawing in code (Part 2)

Drawing in code:

Part 2 (Transfer the prototype into swing):

So you will find out that this is not magic but only drawing the same elements that we used in the vector drawing programm but now in their Java2D representations. We just create a buffered image with the same size as the prototype. So we could use the same pixelcoordinates for the shapes and gradients in swing.
weiterlesen

 

Drawing in code (Part 1)

Drawing in code:

Part 1 (Drawing the prototype):

After i published my little fun swing nixieclock i got a lot of requests on how i transferred the image into swing.
Because i remember when i was starting swing development i asked myself the same questions when i saw the amazing work of swing/design guru’s like Kirill Grouchnikov, Romain Guy, Joshua Marinacci, Chet Haase, and others.
Well in the meantime i figured out how to do this and find a workflow that i would like to share here. By the way this is really nothing compared to the things these swing/design guru’s are able to do.

So here we go, first of all i have one good advice for you „Know your tools“,
which means not only java and swing but also your graphics program.

So i’m using Adobe Fireworks for that but you could also use any other kind of graphics program like Adobe Photoshop, Gimp, Inkscape etc.

I will start the tutorial with the drawing of the tube in Adobe Fireworks because it makes coding in swing so much easier if you know how to draw it in a graphics program. So the first part will be focussed on the drawing and the second part will explain how to draw all the different points in java2d/swing: weiterlesen

 

Talklets Münster: JSF 2.0 mit Matthias Wessendorf und Bernd Bohmann

Am Mittwoch dem 27.01.2010 finden im Hörsaal Leo18 auf dem Leonardocampus (am Johann-Krane-Weg zwischen der Eishalle und dem Technologiepark http://tinyurl.com/jugmsleo18) im Rahmen unserer Vortragsreihe „Talklets Münster“ der nächste Vortrag statt.

Vortrag:
JavaServer Faces 2.0
Seit dem Sommer 2009 ist die JSF 2.0 Version „final“. Der Vortrag stellt die wesentlichen Bestandteile der neuen Version vor. Anschließend gibt es einen aktuellen Status zu Apache MyFaces 2.0, dass eine Alternative zur SUN RI (Mojarra) darstellt.

Referenten:

Matthias Wessendorf
arbeitet für Oracle an einer Server-Side-Push (aka Comet) Lösung für die ADF Faces JSF Bibliothek. Er ist PMC Chair von Apache MyFaces. Matthias blogt regelmäßig auf http://matthiaswessendorf.wordpress.com und twittert unter @mwessendorf

Bernd Bohmann
arbeitet für die IRIAN Deutschland GmbH als Software-Entwickler und Berater. Er ist ein PMC Mitglied der Apache MyFaces-Projekt.

Agenda:
| 18:30 | Einlass
| 19:00 | Vortrag: JavaServer Faces 2.0

Damit wir in etwa die Anzahl der Besucher abschätzen können wäre es schön wenn sich alle Interessenten unverbindlich unter http://tinyurl.com/talkletsanmeldung anmelden würden.

UPDATE 2: Falls Ihr die Demo oder die Folien noch mal ansehen wollt: weiterlesen

 

Swing NixieClock

During my search for some i²c stuff i found these nixie tube clocks. So my first idea was to create such a clock in Swing.
Here is the original i took as master…

To my surprise it was really not a big deal to complete this task and it tooks me around 4 hours until i got my first homebrew swing nixie clock.
Because i received some question on how i did this i will shortly explain it here: weiterlesen

 

Java Usergroup Stammtisch: 13.01.10

Die Java Usergroup Münsterland freut sich den ersten Stammtisch in 2010 einen Stammtisch anzubieten. Für alle an Java, Softwareentwicklung und aktuellen Trends interessierte Personen – auch PHP, Ruby on Rails Entwickler sind natürlich willkommen!

Der Java Treff für Münster, Osnabrück und Umgebung findet am Mittwoch dem 13.01. ab ca. 18:30 Uhr im Cuba Nova statt. Das Cuba Nova befindets ich in der Achtermannstrasse in der Nähe vom Hauptbahnhof. (3 Minuten zu Fuß, wenn man langsam geht.). weiterlesen

 

Pro JPA 2 (Book review)

Mike Keith and Merrick Schincariol authored a book which focuses on JPA 2, the Java persistence API which is now included in the Java EE 6 specification.

JPA has its origins in object relational mapping tools like hibernate, JDO or TopLink. While JPA was originally created as a standard for the Java enterprise stack, it did not take much time until it was was also used in the Java SE environment. JPA is easy to use and helpful if integrated into Desktop applications whenever object relational mapping  makes sense.

While JPA is covered in Java EE books as well, Pro JPA 2 only focuses on JPA and provides a profound coverage of the topic, attracting all kinds of developers. The books does not require previous knowledge of JPA 1 or other object relational mapping technology. A basic understanding of database systems, SQL and JDBC is required, but the required knowledge can be achieved by using Wikipedia or any introductory article.

The book motivates the usage of ORM (object relational mapping) software by showing the differences to JDBC, proprietary APIs, EJBs, and JDO. After reading the first pages, you are already able to write your first JPA 2 application, getting an overview of the various parts of JPA, configuration and running the application in a Java SE environment. This is especially useful for beginners, who are able to understand how the different parts operate  and are encouraged to try out the technology.

The third chapter provides a short introduction to Java EE and explains the role of JPA in the context of an enterprise application with an emphasis on transaction and dependency management. The following chapters focus on the many aspects of ORM, many UML diagrams help understanding the context. Advanced topics like caching, deployment, packaging and testing are covered as well, contributing to the good overall impression of the book.

The last chapter helps users who need to migrate from CMP entity beans, JDBC or other ORM solutions to JPA 2 and introduces related enterprise design patterns.

In a nutshell, the authors manage to satisfy both the needs of novice and experienced developers with a good introduction and an in-depth coverage. weiterlesen

 

Swing Apollo space program mission timer

Still on vacation i took the chance to spent some time on watching movies i ordered some time ago and so i watched several movies related to the Nasa moon landing program which lead to the landing on the moon in july 20th 1969.
In the movie MoonShot which tells the story of Apollo 11 and it’s flight to the moon in 1969 i was fascinated by the board computer of the command module and took a picture of the mission timer which looked great to me…

MissionTimerOriginal.jpg

Because i love coding in Java and those things could be easily done in Java’s swing framework i decided to create a little mission timer by myself and that’s a picture of the result

MissionTimerJava.png

I don’t know if it’s useful to anybody but for those of you who like it, i added the source as netbeans project here MissionTimer.zip

You will find two classes in the project, a JFrame and a TimerPanel. (If you would like to use the TimerPanel in another project you just can drag’n drop the TimerPanel class onto a JFrame, JPanel etc.)

To start or stop the timer you just have to click on the panel with the left mousebutton. To reset the panel just doubleclick on the panel.

Enjoy it and keep swinging…