Couldn’t Think Of a Clever Title

Software Ramblings

Posts Tagged ‘Java’

Push

Posted by castever on August 17, 2009

I have started developing a new game using the Slick game library.  It’s a simple game of moving around blocks to put them into the correct spots.  I haven’t got very far, just a working example with two blocks, but I am pretty excited.  In the screen shot you simply move the red and green squares into the big yellow one.   When one of the smaller squares is fully inside the yellow square it shrinks and spins.  When both squares have been put in the yellow square, you win.  There is some collision detection.  You can’t go off the screen and you can’t go through any of the little squares.   No big deal.  Pretty simple.   I have plans of making it bigger though.

screenshot

Posted in Java, game development | Tagged: , , , , | 1 Comment »

Playing On The Google Playground

Posted by castever on June 29, 2009

I have decided to play around with Google Web Toolkit (GWT) and Google AppEngine.  Both look very interesting , very promising, and very fun.  I don’t know very much about them, so this should be an interesting experience and I am sure to learn a ton of new technologies along the way.

My first app is just going to be a Task list.  There are a plethora of Task Lists out there, but I think it will be fun and a good place to start.  I’ve already created my site, The Super List, so feel free to watch the progress (if any)!

Posted in Google, Java, JavaScript, Software Engineering, Web Development | Tagged: , , , , , , , | Leave a Comment »

Java Is Pass By Value

Posted by castever on June 29, 2009

This is something that threw me off when I first encountered it; I should have read the tutorial.

“Primitive arguments, such as an int or a double, are passed into methods by value. This means that any changes to the values of the parameters exist only within the scope of the method. When the method returns, the parameters are gone and any changes to them are lost.”

“Reference data type parameters, such as objects, are also passed into methods by value. This means that when the method returns, the passed-in reference still references the same object as before. However, the values of the object’s fields can be changed in the method, if they have the proper access level.”

(reference: The Java Tutorial: Passing Information to a Method or Constructor)

Posted in Java | Tagged: , , | Leave a Comment »

Magic Poi

Posted by castever on May 6, 2009

I just discovered the Apache POI Project.  I needed to export data from a JTable into an Excel spreadsheet and I didn’t want the hassle of exporting as csv and getting warnings from Excel, so a little search gave me POI, and it is simple and easy to use.

Download it and read the documentation that comes with the download (it seems to be a little more updated than the website).  Plenty of examples.

Posted in Java, Software Engineering, tools | Tagged: , , , , | Leave a Comment »

TicTacToe the Game

Posted by castever on February 23, 2009

I finally finished a game!  This may seem like no big deal to most programmers, but for me it is, because I finally finished a game.  I have often started to write one but have always quickly become bogged down by the details.

So here it is in all of its glory!!  You can download it here.  Later, because now I have to get to work, I will go into the details of how I made it, and then everyone can give me tips on how to make it better.

Posted in Java, game development | Tagged: , , , , | Leave a Comment »

Game Dev Focus

Posted by castever on February 17, 2009

It’s been a very long time since I said I wanted to develop a game.  And I have been very busy since then.  Work, home, etc.  But I have been tinkering in the meantime.  I have experimented with Python using PyGame and Panda3D.  The trick to that is I don’t know Python (yet).  I have played around with java using  LWJGL, Slick, and a little bit of  jME.  I’ve even just did some accelrated graphics using Java2D thanks to the great tutorials on Coke And Code.

I am going to make a game; game development is fast becoming my software engineering passion.  I have decided to start with a simple Tic Tac Toe game using Java2D and accelerated graphics, which I have already begun to develop in the spare time I can spare.  If you are reading and are interested, keep coming back and see the results.

Thanks again for everyone in the world who creates game libraries, tutorials, etc.

Posted in Code Libraries, Java, game development, python | Tagged: , , | Leave a Comment »

KeyListener in JComboBox

Posted by castever on December 9, 2008

You’ve seen those auto-complete combo boxes out there. SwingX has one, and it is a good one, but not exactly what I needed.  I didn’t want all of the highlighting and I didn’t want the options in the combo box to be static.  All my suggestions are coming from the database.

So what I discovered and what I want to share is how to listen for key events on an editable jComboBox.   If you did something like this:


jComboBox1.addKeyListener(new KeyListener() { ... }

You would not be notified of KeyEvents.  Why?  you ask.  When you type into an editable JComboBox the key events are not being fired on the JComboBox but rather on the editor of that JComboBox.


jComboBox1.getEditor().getEditorComponent().
addKeyListener(new KeyListener() { ... });

Simple as that!

Posted in Java | Tagged: , , | 1 Comment »

How To Create Your Own Events In Java

Posted by castever on July 31, 2008

I’m pretty new to the Java language.  A couple of years ago I started looking into it then pursued PHP as my main focus, so I never really bit into the Java scene.  I now am able to focus on learning Java and I am learning a lot.

So here is something I have learned:

Creating custom objects with their own custom events.

When I learned how to do this (thanks to this helpful article: http://www.javaworld.com/javaworld/javaqa/2002-03/01-qa-0315-happyevent.html ), I was very excited.  I must have looked like a complete idiot when I shouted for joy in the office and then had to explain my trimuph to all who would hear.  My poor wife even got to listen to the story.  I’ve spared my children.

I’ll give a brief overview of what I learned from that article.  It is from 2002, but I found it very helpful, so check it out if you can.

Read the rest of this entry »

Posted in Java, example | Tagged: , , , , | 1 Comment »