Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Java - Options

Name: Anonymous 2010-09-09 3:26

Hey, I'm trying to do a multiple options pop-up window. I'm doing a simple Banking program, where you can withdraw, deposit, change the interest etc.

I want to have a pop-up, where you first choose which action you want to take (Deposit, withdraw etc.) and then after, it pops up with an input window for the action you chose.

I have already done the input windows for the options, but I cannot get the first options window to work. Frankly, I don't know how to even make it as JOptionPane seems to not have the abilities to do it.

Am I making any sense?

Name: Anonymous 2010-09-09 11:42

This shouldn't be too hard.  If you're planning on directly opening up different JDialogs or JOptionPanes based on prior actions, set it up so that the MouseListener on the prior window detects which option you've selected and calls the constructor for the appropriate new component.  In some cases, that means modifying the existing Listeners.

If you want to limit the number of pop-up windows and just use a single pop-up, set it's layout manager to a CardLayout, and have it switch cards based on your selected options.

I'd recommend using JDialog components and controlling any default methods of window closing using setDefaultCloseOperation() and using the dispose() method appropriately.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List