Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #5330
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Henry <Henry@example.com> |
| Newsgroups | comp.lang.java.gui |
| Subject | Design Suggestions? |
| Date | Thu, 02 May 2013 17:56:00 -0400 |
| Organization | A noiseless patient Spider |
| Lines | 69 |
| Message-ID | <klun5u$8m3$1@dont-email.me> (permalink) |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Injection-Date | Thu, 2 May 2013 21:51:59 +0000 (UTC) |
| Injection-Info | mx05.eternal-september.org; posting-host="9792db11e36ae5fde9b84274f469df23"; logging-data="8899"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/PK9+7HdFRR3sALKauvnNniuG2iGFKMaw=" |
| User-Agent | Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 |
| X-Antivirus-Status | Clean |
| X-Antivirus | avast! (VPS 130502-0, 2013-05-02), Outbound message |
| Cancel-Lock | sha1:3lNz46gSdi3Ag5gnWVZciX0dEBE= |
| Xref | csiph.com comp.lang.java.gui:5330 |
Show key headers only | View raw
I need someone to brainstorm with me about a very small project. I'm trying to build a small private application (or applet) to simulate a draw with a small number of tickets. It's for a club to which I belong. Currently, we do the draw with real paper tickets, purchased from an office supply place. Anyone who wants to purchase tickets indicates how many they want and paper tickets, each containing two copies of a 6 digit unique number are torn in half so that each half has the unique number intact. The buyer gets half of the ticket and the other half is tossed into a hat or suitable container. Tickets sell for $0.25 each or 5 for a dollar. No one has ever bought more than 10 tickets for a given draw. After everyone who wants one has their tickets, a neutral party draws a winning ticket; the winner gets half of the cash raised by the draw (rounded up to the nearest quarter if necessary) and one book or DVD from a pile of books and DVDs donated by various members. After the winner has claimed his/her prize, a second draw is made and the second place winner gets first choice of the remaining books and movies but no cash. Drawing continues with each subsequent winner getting first choice of whatever books and films remain until all books and films are exhausted. The club keeps the remaining half of the money raised by the ticket sales. Tickets are discarded after the draw. I want to write a Java application or applet that duplicates what happens in our existing draw. I'm intrigued by Java FX and am tempted to write the program that way to learn more about FX but I'm more familiar with Swing and would be willing to go that way. I've installed NetBeans 7.3 and Scenebuilder but as I look through Scenebuilder, I don't see anything that looks like Card Layout. You see, I'm picturing this like one of the Windows wizards where each stage is a separate page of a CardLayout and you can go back and forth between different stages. For example, the first "page" is ticket sales and for each buyer, you put his/her name in a text box (or combo box) and use a Spinner to set the number of tickets purchased. Then you calculate the cost of those tickets and display it beside the number of tickets. Then you collect that money from the buyer. When you have collected all the money for all the tickets sold, you have finished Page 1 of the draw. At that point, you click a Next button and go to Page 2. Page 2 displays the ticket buyer names in a table or list. Beside each buyer name is the unique numbers of the ticket that person has purchased, e.g. 100001, 100002, 100003 or just 100006. (Ticket numbers are given out sequentially, just as tickets appear sequentially numbered in the paper roll of tickets.) At this point, a late arrival might want to still buy tickets or an existing buyer may want to buy additional tickets so it should be possible to go back to Page 1 and sell more tickets, which will necessitate increasing the ticket count for an existing buyer or adding a new buyer to the list. When that is done, you go back to Page 2. The bottom of Page 2 needs a button that initiates the actual selection of the winning tickets. The winning ticket numbers should be listed in order (with buyer name) on the third page. The person operating the program should be able to scroll up and down if necessary and simply reads the list of winners from top to bottom, stopping after reading each one to allow that person to collect his prize before moving on. All the details of that draw - who bought tickets, how many they bought, what ticket numbers were issued, and which tickets won - should be written to a file so that it can be easily viewed again at some point in case anyone wants to challenge the fairness (or the randomness of the random number generator). At least that's the way I'm thinking of doing this. Unfortunately, I don't see how I can do that in JavaFX since I don't see any equivalent to CardLayout there. But perhaps there is a better way to design this. That's why I'm asking here. Does anyone have any thoughts on the best way to design this?
Back to comp.lang.java.gui | Previous | Next — Next in thread | Find similar
Design Suggestions? Henry <Henry@example.com> - 2013-05-02 17:56 -0400
Re: Design Suggestions? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2013-05-02 18:18 -0700
Re: Design Suggestions? Roedy Green <see_website@mindprod.com.invalid> - 2013-05-29 00:27 -0700
Re: Design Suggestions? Lew <lewbloch@gmail.com> - 2013-05-30 12:55 -0700
Re: Design Suggestions? Roedy Green <see_website@mindprod.com.invalid> - 2013-05-31 09:36 -0700
Re: Design Suggestions? Lew <lewbloch@gmail.com> - 2013-06-02 12:56 -0700
csiph-web