Search:

Type: Posts; User: sonicjr

Search: Search took 0.19 seconds.

  1. Replies
    1
    Views
    1,141

    JPanel not reacting to Keystrokes

    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...
  2. Why do layouts never work the way I want them to?

    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...
  3. Replies
    2
    Views
    1,477

    Border question

    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...
  4. Re: noClassDefFoundError trying to run JNLP file with Web Start

    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...
  5. noClassDefFoundError trying to run JNLP file with Web Start

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

    Getting a screenshot with Java

    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...
  7. Why does GridLayout ignore the number of columns I specify?

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

    Re: Understanding the Comparable Interface

    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) {...
  9. Replies
    9
    Views
    1,925

    Re: Understanding the Comparable Interface

    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...
  10. Replies
    9
    Views
    1,925

    Understanding the Comparable Interface

    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...
  11. Replies
    1
    Views
    2,319

    Re: help with delete method of linked list

    nevermind the code works, i made a silly mistake elsewhere. how do i delete posts, or is that the mods job?
  12. Replies
    1
    Views
    2,319

    help with delete method of linked list

    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...
  13. Re: String.split("") puts null in the first index

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

    linked list null pointer exception

    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...
  15. String.split("") puts null in the first index

    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...
  16. Replies
    1
    Views
    2,241

    g.setColor or repaint is not working

    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...
  17. Replies
    8
    Views
    2,520

    [SOLVED] Re: JOptionPane problem

    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
  18. Replies
    8
    Views
    2,520

    [SOLVED] Re: JOptionPane problem

    "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...
  19. Replies
    8
    Views
    2,520

    [SOLVED] Re: JOptionPane problem

    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...
  20. Replies
    8
    Views
    2,520

    [SOLVED] Re: JOptionPane problem

    That makes sense but how do I pass interval to paintComponent so that it knows what do draw?
  21. Replies
    8
    Views
    2,520

    [SOLVED] JOptionPane problem

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