This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Lottery GUI issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Lottery GUI issues" Watch "Lottery GUI issues" New topic
Author

Lottery GUI issues

Han Sal
Greenhorn

Joined: Nov 15, 2012
Posts: 1
Hi all, im really struggling with a lottery GUI programme that i need to create for one of my assignments. I have created the core functions to store, sort, shuffle and display the lottery numbers but need help with the GUI aspects of the programme. The code i have added below compiles without errors.

The bits that i need to add to my exisiting class includes displaying a logo, a button and a text box to contain the six numbers. The numbers should only be generated when the button is pressed.

I have looked at numerious GUI swing tutorials and have had a go myself to no avail. My lecturer doesnt offer much help as she is teaching me java out of a book herself and I would be grateful if someone could offer a hand. Im still relatively new to programming but i do wish to become more familiar with java.

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38045
    
  22
  • 1: Find out how to deal with a top‑level container. You will almost certainly want a JFrame.
  • 2: Work out how to start a Swing application, using the EDT. I told somebody else this morning.
  • 3: Work out how to get the frame visible, at a particular location and with a particular size.
  • 4: That should take you the rest of the day.
  • 6: And I won’t tell you where you can find a tutorial.
  • 7: Ask again for the next stage.

  • It is unfortunate if somebody who is teaching has to learn from a book as they go along, but it is a good idea to use a good book as a reminder of what you might have forgotten. You will have to learn your GUI in stages, and I shall move you to the GUIs forum. Which book are you using?



    And welcome to the Ranch
    Campbell Ritchie
    Sheriff

    Joined: Oct 13, 2005
    Posts: 38045
        
      22
    Does that lottery number class actually work? What you want is to be able to pass an int eg 6 to a constructor or method and have something return an array that size containing the numbers. You need that working as the actual application before you put the GUI on top of that.
    Tony Docherty
    Bartender

    Joined: Aug 07, 2007
    Posts: 2173
        
      47
    Campbell Ritchie wrote:1: Find out how to deal with a top‑level container. You will almost certainly want a JFrame.
    2: Work out how to start a Swing application, using the EDT. I told somebody else this morning.
    3: Work out how to get the frame visible, at a particular location and with a particular size.
    4: That should take you the rest of the day.
    6: And I won’t tell you where you can find a tutorial.
    7: Ask again for the next stage.

    Err, what happened to 5.
     
    It is sorta covered in the JavaRanch Style Guide.
     
    subject: Lottery GUI issues
     
    Similar Threads
    Selection Sort?
    Lottery GUI
    shuffling
    isnt this code a little "obtuse" ?
    Array Comparison doesnt appear to be working