Results 1 to 4 of 4
  1. #1
    porchrat is offline Senior Member
    Join Date
    Mar 2009
    Posts
    105
    Rep Power
    0

    Default Keeping one window above another

    Hi all

    I have encountered a few GUIs that do this: A new window (maybe in the form of a dialog box but I really would prefer a whole new frame I've created) appears above the previous window and until either the methods this new window is concerned with reporting on are complete or some error occurs the user can't select the window beneath.

    For example is there some sort of option that allows you to set a frame so that it can't be selected?

    I hope I have described this adequately I'm finding it difficult to put it into words :p

  2. #2
    StormyWaters is offline Senior Member
    Join Date
    Feb 2009
    Posts
    305
    Rep Power
    6

    Default

    Have you tried a JDialog with setModal(true)?

  3. #3
    porchrat is offline Senior Member
    Join Date
    Mar 2009
    Posts
    105
    Rep Power
    0

    Default

    I haven't tried any of them yet. I was just hoping to get an idea of whether or not this sort of thing was possible in Swing.

    I see that the 1.6 API says setModal() is no longer used and instead setModalityType() should be used. It blocks all input to some windows and hopefully that includes the ability to select it. Regardless this might be what I'm looking for thanks I will give it a try. :)

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,252
    Rep Power
    19

    Default

    Also take a look at JOptionPane. Note that the 'message' argument can be a component.

    db

Similar Threads

  1. Serializing BufferedImage with keeping transparency
    By Spitfire777 in forum Java 2D
    Replies: 2
    Last Post: 12-15-2010, 07:49 PM
  2. Keeping data in memory
    By roud9 in forum New To Java
    Replies: 1
    Last Post: 11-02-2010, 12:28 AM
  3. Keeping a graphic central
    By Josisco in forum AWT / Swing
    Replies: 1
    Last Post: 10-24-2010, 06:38 PM
  4. Problem with keeping values into an arrayList
    By Daniel Silvester in forum New To Java
    Replies: 0
    Last Post: 12-02-2009, 01:14 AM
  5. Java Keeping Text in One Place
    By xpngamer in forum New To Java
    Replies: 1
    Last Post: 04-09-2009, 06:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •