Type: Posts; User: BinaryDigit09

Page 1 of 4 1 2 3 4

Search: Search took 0.08 seconds.

  1. Re: I need help deleting a line of code after it has been selected by the user.

    The guardBarracks function should only offer (and process) the option to pick up gold if the gold hasn't already been picked up. This is just one of possibly dozens or even hundreds of "states" that...
  2. Re: I'm seriously struggling in my Ap computer science class

    Divide and conquer. Programming is immensely complex and it's almost never helpful to try and take it all in at once. Just focus on the specific concepts that the class is trying to teach, and don't...
  3. Replies

    Re: Am i blind?????

    Your main() function is empty, and your statements to calculate and display are not inside any function.

    public static void main(String[] args) {
    int highScore = calulateHighScore(1500);
  4. Replies

    Re: Abstract and code output

    To explain the output, you need to first understand how the increment operators work. Are you having trouble understanding the difference between j++ and ++j, for instance?
  5. Re: Where should I toggle the breakpoints ?

    Put just one breakpoint on "c.firstMethod();" near the bottom and then use Step Into exclusively. Each statement it stops at is another place where you could put a breakpoint if you wanted.
  6. Re: Can anyone help me with this java problem? [Java]

    It's because your Calculator class does not implement ActionListener. If you add the @Override annotation to the actionPerformed function (a good habit for all overridden functions), you'll get a...
  7. Re: Can someone help me to bring just a variable from one method to another?

    You can either return the variable from the Amount() function, or make it a class-level variable:

    public static double Amount() {
    double math = initialAmount + paycheckAmount;
  8. Replies

    [SOLVED] Re: running java files in the cmd.exe

    There's no way to tell if you have the JDK by simply invoking "java -version", because the JDK comes with the JRE and "java -version" always invokes the JRE, regardless of whether or not you also...
  9. Re: BufferedWriter writing garbage after a close()

    Sounds like it's appending to the file when you expected it to overwrite instead. If that's the case, did you try using BufferedWriter.write() instead of append()?
  10. Replies

    [SOLVED] Re: running java files in the cmd.exe

    To compile with javac from the command prompt, the command window needs to know two things: the location of javac.exe and the location of your .java source file(s). From your posts, it appears that...
  11. Replies

    Re: Comments on this code?

    It seems your predecessor wanted to have an alternative to Thread.sleep(), but I'm not sure why that would be helpful. To fully understand HOW it works (not necessarily WHY), have a look at the API...
  12. Re: cant understand where the problem is


    This is a compile-time constant:

    String x = "z";

    This is not a compile-time constant:

    String userName =;
  13. Thread: java

    by BinaryDigit09

    Re: java

    One pitfall you're going to run into is the use of BufferedReader. That class is no good for reading binary files (such as PDF), it's only good for reading plain ASCII text files. So you'll want to...
  14. Replies

    Re: JavaFX - Main Program Loop

    I had a similar disappointment with the way JavaFX expects you to start your program. The init() function is nice for background initialization, but try showing a GUI splash screen from there. Not...
  15. Re: Eclipse: The import cannot be resolved.

    Taking a wild guess here, but I believe this is looking for a Java wrapper for Windows Foundation Classes, which may have only existed in Microsoft's proprietary JVM before the whole antitrust...
  16. Re: Coding a MVC applciaiton without a scenebuilder


    MVC and SceneBuilder are not related like that. SceneBuilder is just one way to build the "V" (or "View") part of an MVC architecture.

    To create a View without using SceneBuilder, have a...
  17. Re: General Question how to create Project Management App

    In JavaFX, use a Canvas to do your own 2D drawing. Unfortunately, Oracle in all their awe-inspiring wisdom decided it's not necessary to have a single JFX component that can both draw and respond to...
  18. Replies

    Re: What Layout Manager to use here


    As unpleasant as it is, I would urge you to bite the bullet and get very familiar with the GridBagLayout. It's the most complex and daunting layout manager, but with great responsibility...
  19. Re: Write a Java program that accepts an integer (n) and computes the value of n+nn+nnn.

    It prints "1010" because you're just concatenating the String "10" twice with System.out.printf("%d + %d%d + %d%d%d", n, n, n, n, n, n). If you want it to print the individual values of 10*1, 10*11,...
  20. Re: error: array required, but String found


    public int getToppings()
    return toppingChoices;
    This has two problems: There is no 'toppingChoices' variable in scope for this function, and based on how you've used the other...
  21. Replies

    Re: Redraw Issues on Shapes with FX

    First, the circle will need a fill that is non-null:

    Then you've asked the user for the radius but didn't do anything with it:

    r = q.nextInt();...
  22. Re: why should we declare checked exceptions?

    3)Why should we declare the exception in method header in case of checked exceptions ? what benefits are we getting by declaring exception in method header?

    Checked exceptions must be caught...
  23. Replies

    Re: Java.swing JScrollPane

    You should add the JScrollPane to the panel, but NOT the JTextArea.

    this.add(scrollArea); // This is good

    add(resultField); // Take this out
  24. Replies

    Re: Cant Complete the Program

    Those directions don't appear to be very good. Here's the correct structure (and preferred convention) of a lamda expression:

    setOnKeyPressed(e -> {

    Note where the start/end parenthesis...
  25. Replies

    [SOLVED] Re: help with my object and code


    The commented-out code doesn't work because it's changing the color of a newly-created FrameExample object instead of the actual FrameExample object that you're seeing on the screen. It's...
Results 1 to 25 of 93
Page 1 of 4 1 2 3 4