Lottery GUI issues

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.

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: 44016

33

posted Nov 15, 2012 07:52:09

0

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.

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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com