Responsive Ad Area
Home » Blog

Blog | Software Developer Zone

Learn to code Java now!

Easy steps and tips to get started learning to code Java How easy is it to begin learning Java? I will explain the steps needed to get started. What tools are needed? Which tools to avoid at first. Ask yourself a few questions. Why do you want to learn Java? What are your main goals in learning Java? What do you want Java to do for you? What kinds of problems do you want it to solve? You can use Java to code console apps, desktop apps, web apps, phone/tablet apps etc. Are you learning it because of school or because of work? For hobby? For self-education? Get the JDK (Java Development Kit) Get a console or command line, either Linux shell or Windows shell or Windows Power Shell Get a text editor JEdit,  Atom or Editpad Pro. or VScode, Notepad++, Brackets, Sublime or  Notepad on windows for...

PHP

PHP is a fun language many applications on the web is written in PHP. Unlike Java, PHP does not a full blow language like C and C++ what I mean by that is, with PHP there are certain limitations. Such as, we don't have direct access to the machine so we can't quite interface with hardware the way we can with C/C++. PHP had it's start in the bad old days of the web. People wanted an interactive website even back in the early 90s and the most popular option of the time was to use a CGI (Common Gateway Interface) using PERL as the language of choice. Then along comes some guy that thought he could create a better scripting language and created something called Personal Home Pages (PHP) and then it formed into the Hypertext PreProcessor. Sounds pretty catchy doesn't it? I just wanted to edit t...

Random Access Files with Java

Random Access Files with Java Random Access Files (RAF) in Java are super easy to use. Use an RAF when you are doing more database-like operations vs document-like operations. With an RAF you can move to any location in the file based on the byte number.  Then read or write primitives and Strings. You can also read and write arrays of bytes. It would be easy enough to write a set of primitives associated with an object which is the object's state, then reload and rebuild the object later. Six Examples So in this article, I will give you 6 examples of storing and reading - one, two and three dimensioned arrays of integers. The first 3 examples simply generate random numbers in arrays then write them to an RAF. They then read the whole file back displaying it at the console. The next 3 read ...

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, Move ...

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...

Sound effects and Musical Notes.

Sound Effects and Musical Notes I will demo how to play a wave file or other sound files as effects. How to play musical notes. Later I will write on how to play music files simultaneously with sound effects.  There is a website that is like a YouTube for sound effects. freesound.org is a website where anyone can get an account to upload sound effects that they have recorded. So you too can record and contribute.  Sox Wikipedia and Sox Sourceforge is a command line sound conversion tool where you may convert most any format found on freesound.org to .wav for use in your Java software. Listen to my Podcast about 2D Game coding. Playing WAV Sound Effects I now show you how to play some sound effects. I have a small collection of wave files for a beaver trapping game. One of the files threw a...

Database: H2 (formerly HypersonicSQL)

H2 Database and Java When I began using Java years ago I heard of a database that was being coded entirely using Java. This was HypersonicSQL and you can still download it at Sourceforge. The author working on it decided it needed a rewrite and he began H2 database. First download H2 installer at H2 download.  Get the stable version 1.4.195 as the h2 jar file for the last version .196 gave a class not found exception on startup looking for the driver. And the tutorial can be found here H2 Tutorial.  Next look at your install and find the H2/bin folder. Here you find the jar file needed h2-some-version.jar i.e. h2-1.4.195.jar. Most if not all databases now create the database when you connect to it. All we need to do is make the JDBC connection and create a table, add some records with SQL ...

SQLite: JDBC and SQLite

SQLite and Java First, you must go to download page and get the binaries for either 32 or 64 bit, placing them in the system path. If you don't know how to do that, google adding folders to the system path. There will be an SQLite.exe file. Run it as a command to verify that it is in the path and working. But for Java coding get the jar file at Jar file. A very good resource you will need is A good tutorial and Another tutorial. Working with Java and Files Tutorial Trail Serialize Java to XML H2 DB and Java Setup for simple example Download the SQLite jar file from BitBucket SQL downloads. Put it and the source below in the same folder. Set the classpath to include that jar file and the '.' current folder or use -cp option with 'sqlite-jdbc-3.21.0.jar;.' when using java.exe. One Step Creat...

Changes: Software Developer Zone Podcast Episode 9-Changes and Plans

Newest Changes and Plans softwaredeveloperzone.com----->Softwaredeveloperzone.com I talk about the changes and plans with the changeover from softwaredeveloperzone.com to SoftwareDeveloperZone.com and new plans. The new domain, theme, layouts, and features. New post and tutorial trail. Upcoming Post and plans. New marketing plans for how to use paid subscription levels. New plans for how I will use the now SDZ Golf Rating System. Maybe seeking a few co or guest authors. See the first podcast About Arksoft RSS feed is http://arksoft.libsyn.com/rss  

Serializing Java Objects to XML and Deserializing XML back to Java Objects

Like object serialization this is very easy and straight forward. Below is two examples of psuedo code for writing and then reading. This code merely shows the steps. We didn't have to use the buffered streams. With small files you do not have to but with larger files it will speed up reading and writing. XMLEncoder Class //psuedo code does not run import java.beans.*; import java.io.*; public class SerializeToXML { public static void main(String args[]){ // an object, composition of objects or collection of objects AnObject anObject = new AnObject(); XMLEncoder encoder=null; try{ encoder=new XMLEncoder(new BufferedOutputStream(new FileOutputStream("objects.xml"))); }catch(FileNotFoundException fnfe){ fnfe.printStackTrace(); } encoder.writeObject(anObject); encoder.close(); } } //psuedo co...

ESS Model an easy to use UML Modeling Tool

ESS Model UML Tool ESS Model is a light weight easy to use Modeling tool that can help you to understand your source as well as other developers source code. It will give you at a glance uml models for classes in the same folder. This shows classes, fields and methods for given classes in a box model. Lines will connect classes in the same package(folder). I use this on my article post here at SDZ some when I feel I have the time. You can make screen shots of the uml using PrtSc on home row then paste into MS Paint, crop, save then insert images in your own post. When you download this put the exe in the path somewhere or add it to the path. Then just navigate to the folder which is the package you want to display. Then type 'essmodel *.java' at the command line. More about ESS Model If yo...

Handling Keyboard Input and Mouse Events

Keyboard Input and Mouse Events In this example, I show you some simple input examples using Applets. Later I might add Web Start or even Swing Desktop examples. Here we get keyboard input (typing) as keyDown event. And we get mouse positions and clicks. We demonstrated mouse input as move, clicks and mouse drag and drop with a more complex example using a vector sprite stickman. See also Sound Effects and Music Keyboard Input Here I give you sample HTML needed. Put the source and HTML in the same folder and compile the source with 'javac KeyTest.java' Save this as 'keyboard.html' then run it at the console with 'appletviewer keyboard.html' . Note that you will have to give the window focus by clicking it, then when you press a key, output in the console will show which key was pressed. It...