File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 38486
    
  23
  • 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: 38486
        
      23
    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: 2250
        
      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.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Lottery GUI issues