User Profile

Collapse

Profile Sidebar

Collapse
newgal
newgal
Last Activity: Mar 1 '08, 03:31 PM
Joined: Jan 21 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • newgal
    started a topic slider controlling height of wave
    in Java

    slider controlling height of wave

    Hi all,

    I need to use a slider to control the height of the wave, but have no idea!

    I have created a slider. Do I have to formulate another formula to control the height or is there an easier way? I may be on the wrong track :(

    Here is part of the code. Any pointers would be great!

    Code:
    private JSlider adjustHeight = new JSlider(JSlider.VERTICAL, 1, 100, 5);
      
    public SineDraw()
    ...
    See more | Go to post

  • newgal
    replied to Random Number
    in Java
    Got ya! Thanks very much.
    See more | Go to post

    Leave a comment:


  • newgal
    replied to Random Number
    in Java
    Thanks, random.nextInt( ) gives a printout.

    If a number is seeded,
    Random random = new Random(10)
    I find that it also does not print the given seed. Is it because it's also not called from the method? So the real seed is not 10, but someother number right?
    See more | Go to post

    Leave a comment:


  • newgal
    started a topic Random Number
    in Java

    Random Number

    Hi,

    I am wondering if I create a random number

    Random random = new Random()

    Is there a way to print out the random number?

    I tried to System.out.prin tln("random number = " + random);

    and it printout "random number = java.util.Rando m@9304b1"
    See more | Go to post

  • newgal
    replied to How to get 10 values per line in output?
    in Java
    Oh! I get it now....thanks so much. Now both my program works and so did the little one.
    See more | Go to post

    Leave a comment:


  • newgal
    replied to How to get 10 values per line in output?
    in Java
    OK, I've been thinking about this program and I can write it out and it output, but again, I can only output it continuously.
    I understand the concept that I need to count the output of prime to 10, then reset, but I am not sure how to do it. (Sorry this is my first programming class and I'm struggling :(
    Do I use for loops to do it? I tried that route, didn't work!

    ~newgal...
    See more | Go to post

    Leave a comment:


  • newgal
    replied to How to get 10 values per line in output?
    in Java
    How do I do that? Where should I insert the int variable?
    Sorry I am really lost on this one....
    See more | Go to post

    Leave a comment:


  • newgal
    started a topic How to get 10 values per line in output?
    in Java

    How to get 10 values per line in output?

    I have been stuck on an assignment; hopefully you can help me out.
    I have posted the code below; basically I need to output n into rows of 10 answers per line.
    I cannot use arrays! I am able to output the answers into a continuous row, but cannot seem to break it into the requirement above.
    [CODE=Java]class PrimeFinder {
    public static void main(String[] args) {
    Boolean prime;
    for (int...
    See more | Go to post
No activity results to display
Show More
Working...