Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Java GUI (Swing) Focus Question

  Asked By: Adelisa    Date: Feb 21    Category: Java    Views: 1453

I have a question about Java GUI Swing. I want to do something
like this, if the user clicks "Help" menu and chooses " About " item,
an "About" frame will jump out. Then the focus can be only set
within the "About " frame until user closes it.
Right now I'm creating a JInternalFrame for the "About" Frame, but
before the "About" frame is closed, the user can still click on other
thing, like menu something, except the "About" frame and set the
focus out of the "About" frame before it is closed.
Thanks a lot for consideration.



2 Answers Found

Answer #1    Answered By: Cesara Fernandez     Answered On: Feb 21

For an "About" frame  jump out, this is very ambigous
statement. Why's Frame? I would call
showMessageDialog(), then setEnabled(false) write some
functions allow users to do other things before switch
it back to setEnabled(true).

Well, who your logic better then yourself.

Answer #2    Answered By: Archana Kamble     Answered On: Sep 05

JOptionPane.showMessageDialog(demo,"This is information message","My Info Message",JOptionPane.INFORMATION_MESSAGE);

where in demo is the parent frame which extends JFrame

Didn't find what you were looking for? Find more on Java GUI (Swing) Focus Question Or get search suggestion and latest updates.