this will be distributed onto other computers, where i won't know where the jar file is. that's why i'm trying to make code that locates the jar's path for me, so i don't have to tell the user to put...
Type: Posts; User: nemo
this will be distributed onto other computers, where i won't know where the jar file is. that's why i'm trying to make code that locates the jar's path for me, so i don't have to tell the user to put...
hello, i am writing a program which will be turned into an executable .jar file. i need to locate the directory in which the jar file is located, using code within the jar file. my code works only in...
that didn't work. i've also tried changing control to ctrl, putting both control and ctrl, changing z to Z and y to Y, putting "VK_" in front of z and y (which returns null).
i've resorted to...
i can't seem to get this example to work. the goal is for "REDO" to be printed when you type ctrl+y, and "UNDO" when you type ctrl+z. there are no errors, but nothing is outputted when you type...
why not? i had it working using paintComponent, but it was at least 5 times slower than using a buffer. plus, if i need to, i can using a SwingTimer to control the painting of the screen manually....
i tried to make it short but it still ended up relatively long.. here's the code:
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import javax.swing.*;
import...
i've begun programming a game in java, and was wondering how one would XOR a sprite onto a Graphics2D object. i know about Graphics2D's setXORMode() method, but i'm unsure how to apply it correctly. ...
why use arrays? why not use algebra?
public class Doubling{
public static void main(String[] args)
{
for(int rows = 1; rows <= 15; rows++)
{
int num = 1;
thanks (: i think you meant to say frame.addKeyListener(panel); though.
the code compiles, the GUI frame appears, and the image is drawn on the panel in the upper left corner. but when i press the arrow keys, he doesn't move. i've never used events before so my problem...
hello java programmers. i am a sophomore in high school taking AP Computer Science A, which uses Java as its programming language. i'm not here to ask for homework help though. i just like to...
wow.. i feel really dumb right now. i can't believe i forgot that. thank you!
for (int r = 0; r < values.length; r++)
{
sum = sum + values [r];
sum = sum/values.length;
}
this is where your problem lies. if you need more help, post again and i'll elaborate
hey guys, i'm relatively new to java programming and recently tried to create a program that displays a BufferedImage onto a JPanel. i don't get any compiler errors when i compile, but the image...