I'm working on a tetris game and I've been trying to get the keystroke actions to work; i've done it before in other applications but for some reason my jpanel is not calling any of the key methods...
Type: Posts; User: sonicjr
I'm working on a tetris game and I've been trying to get the keystroke actions to work; i've done it before in other applications but for some reason my jpanel is not calling any of the key methods...
Ok so these layout managers are driving me crazy. I am trying to create a Tetris program but my **** keeps on getting resized, and once I fix one thing something else gets moved. I created a simple...
I am having trouble understanding exactly how borders work within the context of a JPanel, especially in regards to using paintComponent. Say I have a JPanel that needs 100x100 of free space to draw...
Finally got it working, just thought I'd update this post with my solution in case it can help anyone else with the same problem. I'm not even sure why it works, but this is what I did: In my first...
I am attempting to run a swing application on my site; I created the jar with my class file as its sole member, and wrote the JNLP file below. But when I try to run the JNLP with Web Start either...
Hi all, I am developing a program that will need to take screenshots of an external windows application; I have been able to do this in Python but am having trouble with the Java language. All that...
I'm learning how to use layout managers, and I've come to learn that when the GridLayout constructor is set with both the number of rows and columns to non-zero values, it ignores the number of...
This is what I was trying to do before I replied, and I still can't find it. Here is the code for Collections.sort():
public static <T extends Comparable<? super T>> void sort(List<T> list) {...
Thanks, but I still don't totally understand how Collections.sort() results in compareTo() being called. Could you be more detailed than "due to inheritance"? I'm looking at the Oracle Docs and I...
I am a new programmer learning about interfaces, and I was wondering if someone could explain how exactly the Comparable interface works. For example, I have two classes, one which implements...
nevermind the code works, i made a silly mistake elsewhere. how do i delete posts, or is that the mods job?
I am learning about linked lists, and so far find them to be very confusing. Take for example my delete method, which seems to be able to delete an object at the head of the list, but doesn't do...
this is probably too late to get another response, but kB18001 I tried String.trim() first but to no avail, I get the same output
I am trying to create a Linked List class for my programming homework. I need to make my insert method perform the lookup method first so that I cannot insert any duplicate elements. the code works...
So I have absolutely no idea why this is happening, hopefully someone can help me out. I'm a novice programmer, and lately I've noticed that whenever i use String.split() with "" as a delimiter, the...
I have to design a tetris program for class, whenever a brick falls i am trying to paint over its original location white to clear it off and then paint in its new location in black, to make it look...
Oh wait I got it now, put double interval = Global.interval in the class myPanel before the method definition right? It's working fine now, thanks for the help
"Move this line to the class level" -I don't know what you mean by this
and the problem isn't an error message; the code compiles fine but if you look at my original post you will see the picture...
ok so I think I did what you said and it's still giving me the same problem... here's the code:
import java.util.*;
import java.lang.*;
import javax.swing.*;
import java.awt.*;
public...
That makes sense but how do I pass interval to paintComponent so that it knows what do draw?
I'm creating a program for a programming course which creates an approximation of a circle using line segments. The user inputs the parametric interval and the program will draw the circle using the...