Home » Blog » Java » Desktop

Desktop

Simple 3D Graphics using JavaFX

Simple3D Graphics JavaFX rewrite of my first article using Swing Simple 3D graphics using Java was my first article using Swing UI. As you know JavaFX is the replacement for Swing. In this article I will talk about JavaFX a bit more than the app itself because it was a conversion. This is not only a JavaFX app it’s a JavaFX FXML app. So like Android apps there are two ways to define the UI. You can build it with code within class  definitions and constructors. Or you can define the UI with XML. In this case its FXML for Java FX XML. SceneBuilder and NetBeans You can define the FXML with a text/code editor. This would be painful and you would have to know FXML fairly well and do a lot of looking things up. Or you can download SceneBuilder from Gluon. You can use the FXML generated wit...

Sprite Organizer 0.1 Alpha

Organizing Sprites, Tiles, Textures etc on Image Strips or Grids. This article is about a tool for organizing sprite or tile images into image grids or image strips. It’s useful for organizing game sprites, simulation sprites, textures or even CSS sprites used on web pages.  It has buffers which contain images. Images can be broken into cols and rows.  Cells or sprites are defined as so many pixels by so many pixels in size.  Saves and loads images.      Features Load and save single images or sprite sets. Load images into one of 10 buffers (more buffers in the next versions) Paste from one buffer into a grid or image strip.  Divide a blank image into cols or cols and rows. Sprite size is determined by the size of the grid in pixels and number of cols and rows. Copy, Paste,...

Simple 3D graphics using Java

Isometric or Orthogonal 3D views In this article, I demonstrate 3D Graphics showing you how to project a surface in 3D using 3 modes for drawing the surface. There is a left-hand mode, a center mode, and a right-hand mode. This same transformation math works for 3D polyhedron objects as well and you could use if for voxel type games. I show some effects you can use on the surface such as zoom, pan, skew etc. This is entirely wire frame. I do not remove hidden lines. I do not fill or texture map. And I do not rotate. I may do all this in future versions of this article. 90-degree rotation is very easy to do. Using basic trigonometry math more fine rotation is not difficult. The Iso3D class I did not have to put this code in its own class. As a matter of fact, in such a simple demo applicati...

Widgets/Java Beans/Components

Java Desktop Widgets, JavaBeans and Components GUI applications are made up of Components in a modular manner. These components (parts) are plugged into one another more or less. Some contain others. Below I list some commonly known GUI widgets. Here is a link to a cool set of charts showing Java Swing Components And here A visual guide to Swing Components Frame Menu Bar Button (Press and Toggle) Button Bar Text Label Text Field Text Box Combo Box List Box Icon Dialog Box (popup) Tool Tip Panel Scroll Pane Tabbed Pane Scroll Bar (vertical or horizontal) Progress Bar Check Box (for selections) Option Button (for selections) Resize Bar Tree Viewer Table Viewer I am sure there are more than listed above. And anyone may make custom widgets of any kind for any purpose for more robust or special...

Desktop Applications

Java Desktop Applications Let me explain a few things that will prepare you to run a Java Desktop Application, and other Java Applications as well. If you do not get this right the application won’t run. Bytecode example that looks very similar to assembly language. [code language=”java”] iconst_2 istore_1 iload_1 sipush 1000 if_icmpge 44 iconst_2 istore_2 iload_2 iload_1 if_icmpge 31 iload_1 iload_2 irem ifne 25 goto 38 iinc 2, 1 goto 11 getstatic #84; // Field java/lang/System.out:Ljava/io/PrintStream; iload_1 invokevirtual #85; // Method java/io/PrintStream.println:(I)V iinc 1, 1 goto 2 return [/code]   Java runs in a virtual machine, meaning this VM (java.exe or javaw.exe) interprets Java bytecode. For the VM to be able to interpret the bytecode it needs to be st...