Search:

Type: Posts; User: Cornix

Page 1 of 20 1 2 3 4

Search: Search took 0.64 seconds.

  1. Replies
    6
    Views
    30

    Re: why is there no scrollpane?

    As far as I know JScrollPane's dont work with JTextFields because JTextFields already have a build-in scroll functionality.
  2. Thread: PROJECT

    by Cornix
    Replies
    3
    Views
    37

    Re: PROJECT

    By the way, not only is the good very ugly and has bad style (there should be an array of Buttons as I can see it), but you also dont start your Swing application on the EventDispatcherThread,...
  3. [SOLVED] Re: String method that creates a word out of given letters (Need a little help, please step in)

    Just as a little side not, do NOT use the StringBuffer class, use the newer StringBuilder instead. The StringBuffer class is needlessly synchronized which is not necessary at all.
  4. Re: JFrame windowClosed event not being fired

    I think you are confusing 2 events with similar names. There is both the WindowClosing and the WindowClosed event.
    The event for WindowClosing is only fired when the window is being closed by...
  5. Replies
    5
    Views
    62

    [SOLVED] Re: Math matrix problem or sudoku

    A brute force algorithm could solve this easily, since X can only assume values between [1, 9] this would be very fast.
  6. Re: Effective Process for Learning Java in college

    The best way to learn a language (and a programming language is no different in this regard) is to use it.
    Just keep programming small things, perhaps tools or games, or just silly tests, anything....
  7. Replies
    4
    Views
    119

    Re: Java Swing Code Problem

    There are several different ways of how to start your application on the EDT, I personally use the following piece of code:

    EventQueue.invokeLater(new Runnable() {
    public void run() {...
  8. [SOLVED] Re: Array Index Out of Bounds Exception error

    You have an array, and at some point you are trying to access an index from the array that does not exist. In this case an ArrayIndexOutOfBoundsException is being thrown.
    In the first case the...
  9. Replies
    4
    Views
    69

    Re: help parameters passage

    What do you mean "what the local variable value is"? A variable does not have a fixed value, thats why it is called a variable. The value might be anything that is valid for the variables type.

    ...
  10. Replies
    4
    Views
    69

    Re: help parameters passage

    It assigns the value of the local variable age to the class member variable age.
  11. Replies
    4
    Views
    100

    Re: Beginner's question about objects

    The compiler does this when you compile your program. Each time you use a String literal that literal will be saved in a constant pool and reused whenever it is used again.
    Just do some internet...
  12. Replies
    4
    Views
    100

    Re: Beginner's question about objects

    What you see is because your compiler optimizes your code.
    All Strings that you put within quotation marks '"' will be remembered as constants and reused if possible. But strings that get generated...
  13. Replies
    4
    Views
    119

    Re: Java Swing Code Problem

    There is quite a bit that is wrong.

    First of all, all Swing applications must be started on the EventDispatcherThread (EDT). If you dont start your application on the EDT strange things can happen...
  14. [SOLVED] Re: Problem with program to find sum of two numbers

    Because the underscore '_' and the whitespace ' ' are 2 different characters. You class name must be exactly equal to the name of the java file it is declared within.
  15. Thread: jFrame issue

    by Cornix
    Replies
    1
    Views
    59

    Re: jFrame issue

    Your question does not make any sense to me. Could you provide some context?
  16. Replies
    2
    Views
    117

    Re: Converting an int to Double

    Instead of creating a new Double object via the constructor you should use the static method "valueOf(...)" to create instances of wrapper classes


    Integer foo = 1;
    Double bar = Double.valueOf(...
  17. Replies
    2
    Views
    78

    [SOLVED] Re: JPanel and PaintSurface not agreeing.

    You should NOT override the paint(Graphics) method, instead override paintComponent(Graphics).
    I dont know if this will fix your current problem, but it is still important to change this regardless.
  18. Thread: while loop

    by Cornix
    Replies
    11
    Views
    132

    Re: while loop

    Furthermore, you are calling sc.next() twice in your loop!
    Each time you call sc.next() you will need to give the program input. Since you call it twice, once to append to your string builder and...
  19. Replies
    2
    Views
    76

    Re: What does this super( ) call do?

    It calls the constructor of the super class.
    If you do not understand what this means I would highly recommend reading a book and/or online tutorial on polymorphism in java.
  20. Replies
    4
    Views
    133

    [SOLVED] Re: Code breaks after upgrading to Java 8

    Your code should not break with the newest version. Are you sure that the JRE (or JDK) for Java8 has been properly installed after any previous versions were uninstalled?
  21. Replies
    4
    Views
    88

    Re: Change default program for extension

    You can do this if you start your java application via WebStart. For regular java applications this is impossible as far as I know.
    This should help you:
    Associate file type with Java Swing...
  22. Re: Comparing 2 source codes and telling how similar they are

    It really depends on what you want.
    In source code, you can usually swap the positions of certain lines of code without making a huge difference, for example:
    public int sumUp(int[] a, int[] b) {...
  23. Re: Comparing 2 source codes and telling how similar they are

    In this case I really misunderstood. The way you have explained it now it sounds pretty simple.
    I would suggest ignoring variable names all together.

    This is what I would recommend:
    1) Remove...
  24. Replies
    2
    Views
    77

    [SOLVED] Re: Converting char toUpperCase

    You call the method toUpperCase(char) of the Character class, but that method does not change the value that your variable "reply" has. Instead, it will return a new value that you are supposed to...
  25. Re: Comparing 2 source codes and telling how similar they are

    If you are not good with algorithms then I would not recommend trying something like this. The task you have set for yourself is very very difficult, even for experienced programmers.
    A brute force...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4