Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

  1. Replies
    50
    Views
    2,284

    Re: resetting label text alongside gui

    Ok, I'll wait for the small, complete program before making any further posts here.
  2. Replies
    50
    Views
    2,284

    Re: resetting label text alongside gui

    What is the variable name of "the label" that you are talking about?
    I thought that was what you wanted in the label.

    Without a small, complete program that compiles, executes and shows the...
  3. Replies
    50
    Views
    2,284

    Re: resetting label text alongside gui

    Something like this:
    get value from buttonClicked into x
    get value from label??? into y
    concatenate x to end of y: y = y + x
    set value for label??? from new value of y
  4. Replies
    50
    Views
    2,284

    Re: resetting label text alongside gui

    Use concatenation so the display will be:
    1
    then
    12
    then
    123
    then
    1234
    etc
  5. Replies
    50
    Views
    2,284

    Re: resetting label text alongside gui

    Use the String concatenation operator:

    String x = "1"; // define x and give it a value of "1"
    x = x + "2"; // now x has value of "12"
  6. Replies
    50
    Views
    2,284

    Re: resetting label text alongside gui

    Are you asking how to concatenate a new String to the end of the String currently being shown?
  7. Replies
    50
    Views
    2,284

    Re: resetting label text alongside gui

    Then see posts #29 and end of #37
  8. Replies
    50
    Views
    2,284

    Re: resetting label text alongside gui

    An example of what?
    Here's how to set the value of correctLabel from the value in buttonClicked:

    correctLabel.setText(buttonClicked.getText());

    If you need more: make and post a SMALL,...
  9. Replies
    50
    Views
    2,284

    Re: resetting label text alongside gui

    Then use the variable: correctLabel to show the results. Don't create a new JLabel.
  10. Replies
    50
    Views
    2,284

    Re: resetting label text alongside gui

    The fix for that statement is to remove it:

    // footer.add(new JLabel(buttonClicked.getText()));

    so that it does NOT add a new JLabel.
  11. Replies
    50
    Views
    2,284

    Re: resetting label text alongside gui

    What one line of code? Please post the line of code that you are asking about.
  12. Replies
    50
    Views
    2,284

    Re: resetting label text alongside gui

    Can you make and post a SMALL, simple program that compiles, executes and shows the problem?
  13. Replies
    50
    Views
    2,284

    Re: resetting label text alongside gui

    Don't create new labels, reuse the existing ones.
  14. Replies
    50
    Views
    2,284

    Re: resetting label text alongside gui

    New labels without reference variables are hard to access if you want to change their values.
  15. Replies
    50
    Views
    2,284

    Re: resetting label text alongside gui

    Execute this code:

    correctLabel.setText(" ");

    Is the program executing that code? If not, why isn't it?
    What are the values of the variables used in the if statement that controls if that...
  16. Replies
    50
    Views
    2,284

    Re: resetting label text alongside gui

    Sorry, that last post does not make sense. Labels don't interact. It's the code that makes changes to labels.


    What do you expect to be in each label AFTER that code executes?
    Give the name...
  17. Replies
    50
    Views
    2,284

    Re: resetting label text alongside gui

    Did you have a question or comment?
  18. Replies
    50
    Views
    2,284

    Re: resetting label text alongside gui

    If the statement is not executed, the label is not cleared. Is the if statement true?


    if (gui.buttonCounter > gui.ROWS * gui.COLUMNS) {
    Add a println() statement to show the values used in...
  19. Replies
    50
    Views
    2,284

    Re: remove text from label

    You have this:
    gui.correctLabel.setText("");
Results 1 to 19 of 19