Page 3 of 4 FirstFirst 1234 LastLast
Results 41 to 60 of 64
  1. #41
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,785
    Rep Power
    7

    Default

    Quote Originally Posted by Ryan10 View Post
    It's not adding up right..any last help calvin
    Do you seriously think that anyone can help with such little information provided?

  2. #42
    Ryan10 is offline Senior Member
    Join Date
    Mar 2011
    Posts
    144
    Rep Power
    0

    Default

    I got everything to add up right i just need to add a letter grade at the end of the script to say if the final grade is 80 its a B and so on.. but if i put an output label as grade then i dont know what the "grade" is being based on. I want it to be based on the final grade.

  3. #43
    Ryan10 is offline Senior Member
    Join Date
    Mar 2011
    Posts
    144
    Rep Power
    0

    Default

    Got it all set !!!

  4. #44
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by ryan10 View Post
    got it all set !!!
    phew!!!!!!

  5. #45
    Ryan10 is offline Senior Member
    Join Date
    Mar 2011
    Posts
    144
    Rep Power
    0

    Default

    now just trying to spiff it up..is there a simple code for line spacing so its not all jumbled up?

  6. #46
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,785
    Rep Power
    7

    Default

    You can use the printf method (instead of print and println) or use the String.format method.

  7. #47
    Ryan10 is offline Senior Member
    Join Date
    Mar 2011
    Posts
    144
    Rep Power
    0

    Default

    Thanks Junky :)

  8. #48
    Ryan10 is offline Senior Member
    Join Date
    Mar 2011
    Posts
    144
    Rep Power
    0

    Default

    I thought /n would work but still i cant find out how to add a space in between each line so its not all jumbled

  9. #49
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,785
    Rep Power
    7

    Default

    You mean \n.

  10. #50
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,785
    Rep Power
    7

    Default

    If you want:

    line 1

    line 2

    then you will need to add 2 new line characters as printf method does not add one. Only println does.

  11. #51
    Ryan10 is offline Senior Member
    Join Date
    Mar 2011
    Posts
    144
    Rep Power
    0

    Default

    say i want to add a line between these two what would i put?

    Java Code:
    Label titleLabel = new Label("\nTasks are 50% of your overall grade:");
    		Label number1Label = new Label ("First Task Grade:");
    			TextField number1Field = new TextField (4);

  12. #52
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,785
    Rep Power
    7

    Default

    You would use an appropriate layout manager.

  13. #53
    Ryan10 is offline Senior Member
    Join Date
    Mar 2011
    Posts
    144
    Rep Power
    0

    Default

    That doesnt really give me a direction as to what i should use since \n doesnt even break the lines

  14. #54
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,785
    Rep Power
    7

    Default

    A. You do not separate 2 different Labels by adding blank lines to one of them. You add space between the labels using a layout manager.

    B. If you want a single Label to have a blank line then you need to use html and the <br> tag.

  15. #55
    Ryan10 is offline Senior Member
    Join Date
    Mar 2011
    Posts
    144
    Rep Power
    0

    Default

    Yeah i knew what the <br> tag was in html but i didnt know i could use it in java..anywhere i put it though it gives me an error.

  16. #56
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,785
    Rep Power
    7

    Default

    Then fix it.

  17. #57
    Ryan10 is offline Senior Member
    Join Date
    Mar 2011
    Posts
    144
    Rep Power
    0

    Default

    im a noob i dont know how

  18. #58
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,785
    Rep Power
    7

    Default

    Neither do I or anyone else if you don't provide details. Do you call the doctor and say "I'm sick" and expect him to be able to diagnose your illness?

  19. #59
    Ryan10 is offline Senior Member
    Join Date
    Mar 2011
    Posts
    144
    Rep Power
    0

    Default

    If he can give me a direction as to what medicine i need..<br> tags dont even work in java unless you add a bunch of other garbage i've already tried and nothing has worked. Add a simple line in java shouldnt be this hard seriously. It's like pulling teeth im sure this is pretty basic for most of you on here that has had experience with java.

  20. #60
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,785
    Rep Power
    7

    Default

    Java Code:
    JLabel thisWorks = new JLabel("<html>line one<br>line two</html>");
    Yes it is like trying to pull teeth because you refuse to provide sufficient information to help you.

Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. Quick question
    By Thumper in forum New To Java
    Replies: 10
    Last Post: 11-07-2010, 10:06 PM
  2. Quick Question...
    By FatalSylence in forum New To Java
    Replies: 4
    Last Post: 10-15-2010, 02:38 PM
  3. quick question
    By vouslavous in forum Java Applets
    Replies: 4
    Last Post: 04-24-2009, 08:35 PM
  4. One last quick question
    By jigglywiggly in forum New To Java
    Replies: 7
    Last Post: 01-26-2009, 08:53 AM
  5. Quick Question
    By Graeme in forum New To Java
    Replies: 4
    Last Post: 01-08-2009, 08:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •