Search:

Type: Posts; User: snowguy13

Page 1 of 14 1 2 3 4

Search: Search took 0.13 seconds.

  1. Re: Why we should use only final local variables from inner classes?

    Hi, ramclever!

    After a little digging, I found this post.

    So here's what's going on:

    Inner classes behave a little bit differently than variables. Whereas the variables in a method are...
  2. Replies
    1
    Views
    586

    Re: 1D Sub-Array From 3D Array of Doubles

    Here's a way to think about it: every time you use brackets to refer to an element in an array, the number of dimensions is reduced by one.

    Look at this code:


    int[][] numbers = {{1, 2}, {3,...
  3. Re: perameterizing a combobox in eclipse makes gui builder give error

    If you are going to declare a type parameter in the constructor, you also have to do it in the variable declaration. For example:

    ArrayList<Object> list = new ArrayList<>();
  4. Having Trouble Using a Project as a Library

    Hello, everyone!

    I have a NetBeans project MyUtility which contains, as you may surmise, methods that I've created to quicken up my coding. I have imported this project as a library into another...
  5. Replies
    4
    Views
    455

    [SOLVED] Re: Regular Expression Difficulties...

    Thanks for the link; but I've already been reading that extensively. :P

    I do the same with the pronunciation. Regex is so much easier to say than regular expression, though I sound awfully lazy...
  6. Replies
    4
    Views
    455

    [SOLVED] Re: Regular Expression Difficulties...

    Oh, alright! That makes perfect sense! All of those other wrong inputs did match, because they contained the characters I asked for. Never did I realize my assumption that the Matcher would only...
  7. Replies
    4
    Views
    455

    [SOLVED] Regular Expression Difficulties...

    Hi everyone!

    Right now I'm working on a regular expression that searches for comparison operators (">", "<=", "!=", etc.).

    Here's the regex I've come up with:


    private static final String C...
  8. Re: Updating JPanel on JTabbedPane with a Resize Event

    JTabbedPanes have methods called getTabComponentAt(int index). This method will allow you to get a component at a certain index in the JTabbedPane. If your JPanel is the first component, it can be...
  9. Re: Simple chess program (no AI) - Need help with structuring my code

    Yeah, that looks a lot better!

    What you're doing now looks fine, so long as it is easy for you to understand. If another organization seems more logical to you, then I'd do that.

    Yeah, all the...
  10. Re: Updating JPanel on JTabbedPane with a Resize Event

    Can you explain what you mean by that?


    When a JFrame is resized, it should repaint itself and all its children. If you override the paintComponent(Graphics g) method of the JPanel, as I think...
  11. Re: Simple chess program (no AI) - Need help with structuring my code

    You've got it partly. Now, think about
    private ImageIcon icon;

    You said

    which makes sense, but think about this: though each piece has a different ImageIcon, EVERY piece has one. If every...
  12. Re: Simple chess program (no AI) - Need help with structuring my code

    One suggestion I have: instead of defining x, y, icon, and placeHolder in the Pawn class, do it in the Piece class. Every Piece you make is going to have these fields, and it's redundant to redefine...
  13. Re: Sorting an ArrayList by MyObject.getDate()

    What is the code for your custom comparator? Does it take into account day, month, and year?
  14. Re: Method printTriangle that has a char parameter ch and an int parameter n.

    What do you have so far?
  15. Replies
    9
    Views
    565

    [SOLVED] Re: Painting Issues

    Oh, whoops -- I misunderstood you the first time. Yes, I will add that line of code. Thank you for your help!
  16. Replies
    9
    Views
    565

    [SOLVED] Re: Painting Issues

    If I'm calling repaint() in the LevelPanel class, will super.repaint() suffice if placed before the repaint() call?
  17. Replies
    9
    Views
    565

    [SOLVED] Re: Painting Issues

    Exactly as I found. Thank you for your help!
  18. Replies
    9
    Views
    565

    [SOLVED] Re: Painting Issues

    Okay, this is utterly silly, but I found a solution.

    The renderLevel method declaration I switched to this:

    renderLevel(LevelPanel l, Graphics g)

    and then I switched the paintComponent...
  19. Replies
    9
    Views
    565

    [SOLVED] Re: Painting Issues

    Heh, it's not much:


    public class LevelPanel {
    //... blah blah ... a lot of other code
    public void paintComponent(Graphics g) {
    Renderer.renderLevel(this);
    }
  20. Replies
    9
    Views
    565

    [SOLVED] Painting Issues

    Hello! I've been doing HTML for a while and now am returning to Java after a few months, and I can tell I've lost a few things...

    Right now, I'm trying to develop a very basic layout for an RPG....
  21. Replies
    2
    Views
    591

    Re: live minecraft map

    That would require you to request information from the game as it runs, which means you would have to write a new class in the game source, which means you'd need the game source code... Other than...
  22. Re: Question to Pattern.matches and escape sequences

    The first one matches because the two strings are exactly the same. The "\n" in both strings represents a new line.

    In the second one, "\\" is read as a single "\" in an input string. This may...
  23. Replies
    1
    Views
    1,001

    Re: adding background image to a frame???

    Have you tried a nice Google search?
  24. Replies
    2
    Views
    400

    Re: A few questions

    Extend the JFrame class, and become familiar with Swing and AWT.


    I suggest learning about the URL class.

    I do not know how to go about your last request. Hopefully you can use ^ to work...
  25. Thread: Array

    by snowguy13
    Replies
    3
    Views
    363

    Re: Array

    Glad you got it working!

    Have fun learning the language! :)
Results 1 to 25 of 340
Page 1 of 14 1 2 3 4