Search:

Type: Posts; User: nemo

Search: Search took 0.48 seconds.

  1. Re: locating the path to a jar file within a program

    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...
  2. locating the path to a jar file within a program

    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...
  3. Thread: Key Bindings

    by nemo
    Replies
    2
    Views
    425

    Re: Key Bindings

    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...
  4. Thread: Key Bindings

    by nemo
    Replies
    2
    Views
    425

    Key Bindings

    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...
  5. Replies
    6
    Views
    1,524

    Re: XOR'ing BufferedImages onto a Graphics2D object

    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....
  6. Replies
    6
    Views
    1,524

    Re: XOR'ing BufferedImages onto a Graphics2D object

    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...
  7. Replies
    6
    Views
    1,524

    XOR'ing BufferedImages onto a Graphics2D object

    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. ...
  8. Replies
    8
    Views
    1,398

    Re: Pyramid of Doubling Numbers

    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;
  9. Re: Moving an image around the screen using the arrow keys.

    thanks (: i think you meant to say frame.addKeyListener(panel); though.
  10. Moving an image around the screen using the arrow keys.

    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...
  11. Thread: Hello all

    by nemo
    Replies
    1
    Views
    288

    Hello all

    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...
  12. Replies
    2
    Views
    14,328

    Re: drawing a BufferedImage onto a JPanel

    wow.. i feel really dumb right now. i can't believe i forgot that. thank you!
  13. Thread: array trouble

    by nemo
    Replies
    3
    Views
    495

    [SOLVED] Re: array trouble

    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
  14. Replies
    2
    Views
    14,328

    drawing a BufferedImage onto a JPanel

    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...
Results 1 to 14 of 14