Search:

Type: Posts; User: jo15765

Search: Search took 0.24 seconds.

  1. Replies
    3
    Views
    604

    Re: Create a JText field upon button click

    I have been trying to use JTextField, but set editable to false and here is the line I run:


    JLabel areaLabel = new JLabel("Answer Equals: ");
    JTextField areaField = new JTextField(5);...
  2. Replies
    3
    Views
    604

    Create a JText field upon button click

    I have 2 JText fields where I put in a 1st number in textfield1 and a 2nd number in textfield 2. I then have a button for "Total" What I want to do is when the Total button is pressed, create a 3rd...
  3. Replies
    12
    Views
    485

    Re: Help Passing Variables

    Cool :) I'll make a note of this, and use it in future coding projects!
  4. Replies
    12
    Views
    485

    Re: Help Passing Variables

    How would I use that?
  5. Replies
    12
    Views
    485

    Re: Help Passing Variables

    I was comparing the wrong 2 variables. Beginner's error. Thank you for the help! (As well as the future tip of printing the variables when results are not looking like I think they should)
  6. Replies
    12
    Views
    485

    Re: Help Passing Variables

    When I print the value of the variables, they display properly (as they should). That's why I was curious if I wrote my If statement wrong.
  7. Replies
    12
    Views
    485

    Re: Help Passing Variables

    Such a simple solution! I don't know why I didn't think of that! One more question...I think I have my if...else statement set up improperly. What it is supposed to do is if masterNumber equals...
  8. Replies
    12
    Views
    485

    Help Passing Variables

    I am running this code below:


    public static void Check(int masterNumber)
    {
    int reverseIt = 0;

    for (int i=0; i<=masterNumber; i++)
    {
    int r = masterNumber%10;
  9. Replies
    5
    Views
    858

    Re: Find Biggest Number in Array

    Ah, that makes sense. I was barking up the wrong tree thinking the error was due to trying to pull an int from a string array. Let me work on the coding a little bit and declare my statements a...
  10. Replies
    5
    Views
    858

    Re: Find Biggest Number in Array

    No it does not compile. When I try to compile that code, I get an error of:
    error: cannot return a vlue from a method whose result type is void


    To answer your questions:
    --My plan of attack...
  11. Replies
    5
    Views
    858

    Find Biggest Number in Array

    I am trying to find the Biggest number in an array. I can't seem to get my coding down pat with it.


    myarray[size] = JOptionPane.showInputDialog("Enter Number" + size + ":");

    if...
  12. Replies
    17
    Views
    3,859

    Re: Having Java output in Tabular Format

    Okay you lost me on your post, I don't understand what you mean?
  13. Replies
    17
    Views
    3,859

    Re: Having Java output in Tabular Format

    I tried to tweak that code slightly and it didn't work :(


    String fmt = "%-7s %-7s % -7s %s%n";

    System.out.printf(fmt, userinput1, "+", userinput2, total);


    That's the...
  14. Replies
    17
    Views
    3,859

    Re: Having Java output in Tabular Format

    So if I am understanding printf() properly, I set the length for my variables, correct? So would this syntax work:


    StringBuilder sb = new StringBuilder();
    // Send all output to the...
  15. Replies
    17
    Views
    3,859

    Re: Having Java output in Tabular Format

    I googled StringBuilder earlier, but the examples I saw didn't really fit my specifications (or at least to my understanding didnt). I will google printf() now and see if I can find something like...
  16. Replies
    17
    Views
    3,859

    Re: Having Java output in Tabular Format

    I see it now, thank you! I honestly wasn't 100% sure what I was searching for. This is a pretty advanced coding IMO, WAY WAY more detailed than what I was thinking it was going to take to complete...
  17. Replies
    17
    Views
    3,859

    Re: Having Java output in Tabular Format

    Okay still not seeing anything? Am I just blind?
  18. Replies
    17
    Views
    3,859

    Re: Having Java output in Tabular Format

    I am looking at the 2nd link, and haven't seen anything yet, but I did just notice that there was a "Next" option at the bottom of the page, so I am scrolling throu the pages searching for it!
  19. Replies
    17
    Views
    3,859

    Re: Having Java output in Tabular Format

    I don't see the Javadoc Luke you are referencing. I am browsing the site now, and am lost :(
  20. Replies
    17
    Views
    3,859

    Re: Having Java output in Tabular Format

    I want to display 2 Columns of output using JOptionPane
    Formula............Answer
    1+1.................2
    1-1.................0

    The Formula is pulled from user input so it will be different, but...
  21. Replies
    17
    Views
    3,859

    Having Java output in Tabular Format

    How can I have my Java Output be in a Tabular Formating?
Results 1 to 21 of 21