I have the bones of the program which uses a thread I wrote in the first post and the guy I am doing this for told me to consider running it in EDT instead. It is just a simple game. Everything what...
Type: Posts; User: Asido
I have the bones of the program which uses a thread I wrote in the first post and the guy I am doing this for told me to consider running it in EDT instead. It is just a simple game. Everything what...
So I am having an issue with making a thread as EDT. This is the prototype of program I have:
public class Program implements Runnable {
public Program() {
new Thread(this).start();
}
...
I am not sure, but can the serialization help in this case?
Oki, I am choosing the first way then :)
Hello,
I am making a game and I want to add fonts from the sprite sheet. I have 2 ways in my mind how to implement this:
1. Cut every letter and put it into the Image Hashtable. So every time the...
Yeh, solved.
In this case just override the method compareTo()
Oh, now I get it. I had set the CLASSPATH to servlet-api.jar. After deleting this variable everything is alright.
Try to look at Comparator and Comparable interfaces. You have to implement one of these or both interfaces, implement some methods and then sort the method by calling Collections.sort() or something....
I just moved to windows and have a strange problem when trying to run the application. Everytime I run a package, instead of simply writing "java Package.ClassFile" I have to write "java -classpath ....
I was trying to solve it since yesterday and just now when checking the code I wrote here noticed the mistake in web.xml file. ProtectedPade instead of ProtectedPage. That's embarrassing.
Hello,
I am trying to make a servlet which would have a security. When you try to access to it, the box pops up with login and password boxes. The thing is, that it doesn't appears to me. When I am...
Hello guys,
I have one question. What does it mean when you put <..> in the class declaration line? Here is one example, KeyType is in there:
when calling registerEvent method, the input to a...
I tried. This method actually refreshes the JFrame but it is still the same - look&feel doesn't change:
javax.swing.SwingUtilities.updateComponentTreeUI(JFrame frame);
Here is the way I try...
Hello guys,
Anyone can tell me why I don't see different look&feels? This is my main method:
public static void main(String[ ] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable()...
Ah, I feel pity that I didn't suggest you that before. I remember I was thinking that you may need both, preferred and the minimum sizes set. Next time I will try to be more confident with the...
Hello,
I have such method:
private ImageIcon createSelectionPattern(int x, int y) {
BufferedImage bi =...
I don't know why right know, but your paintComponent method in BackgroundPanel class is not working. Try to add System.out.println there, you will see.
I am wondering, is there a big difference between JOGL and C++ openGL programming apart the Java and C++ syntax?
Good openGL tutorials can be found at Nehe production LINK
The original examples are written in C++, but below every tutorial you can download JOGL version as well.
Well, for 3D game creation pure JRE isn't enough. You will need JOGL (wrapper library that allows OpenGL to be used in the Java) or JWJGL (Lightweight Java Game Library)
Solved myself by adding getPreferredSize and getMinimumSize methods in ShowDeck class ;)
[SOLVED]
Hello,
I am messing up with MVC constructions a little and have a strange problem with adding JPanel to a JFrame. Here is the "skelet" of the code:
MAIN CLASS:
public class MVCtest...
Actually, another good start would be: The Java 2D games tutorial
You can find there Tetris, Space Invaders and many other game source codes with good explanation of every part in it. Check it out.
Just read what I wrote once more ;)
TIP:
Anyway, with helloworld922 advice I have solved it. Thanks!