This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Here's a simple problem that I know most of you guys would know the answer in an instant, and willing to help your humankind.
I have a JDialog. On it is a JButton. I want this JDialog to be modal, I set it to setModal(true). Fair enough. I have an actionEvent for the JButton press.
The problem is, because it's set to Modal, it won't process the actionEvent.
What I am trying to do here is make a JDialog with a JButton (the easiest part). It must be modal so the the JButton must be pressed to close this JDialog (call it dialog1). It then creates another JDialog (call it dialog2). This dialog2 has a Jbutton, which also must be pressed to close it.
Very familiar. Hoepfully lots of you there would provide help.
Thanks much, guys!
amerzil co-ed student<br />"Praise be the Code"
Joined: Mar 02, 2005
I can close it now. However, in the JDialog is a JTextArea, how do I handle the event (and which method) when there is no text input to the JTextArea?
Hi Karen, it's fairly simple: before you close the JDialog you have to check if there is no text input in the JTextArea, you simply do this checking if the getText() method of JTextArea returns an empty string or not.