Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: JFrame declared as setAlwaysOnTop doesn't stay on top during slide show

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default JFrame declared as setAlwaysOnTop doesn't stay on top during slide show

    Hi,

    We came across a very typical difference in the behavior or JFrame and JWindow.

    We are maintaining a desktop application developed in java swing with one of the functionality to capture the screen. The application is a JFrame with various buttons added to it. The JFrame is set as setAlwaysOnTop(true). This screen capture works fine for all cases expect when OpenOffice presentation is running in slideshow mode on Ubuntu 8.04.

    When the slideshow for presentation is activated, the presentation is coming on top of JFrame. Even though JFrame is declared as setAlwaysOnTop, it is not coming on top of slideshow. This is preventing the user from initiating the capture. This is happening only on Ubuntu (Linux Flavor). It works fine on Windows.

    When we made a minor change (i.e. changed the JFrame to JWindow), it is staying always on top even when slideshow is activated.

    Please go though the below example code. When the below code is run, the JFrame stays on top till a presentation is opened and slideshow activated. When slide show is running, it goes behind the slide show. If you change the JFrame to JWindow (shown in commented line), it is staying always on top even when slideshow is activated and we don’t even have the setAlwaysOnTop() property for JWindow.

    import javax.swing.JFrame;
    import javax.swing.JWindow;
     
    public class TopJFrameTester {
     
                public static void main(String[] args) {
     
                            //JWindow topContainer = new JWindow();
                            JFrame topContainer = new JFrame();
                            topContainer.setSize(300, 300);
                            topContainer.setAlwaysOnTop(true);
                            topContainer.setVisible(true);
                }
     
    }


    Can anybody explain how can I make my JFrame to sit on top of PPT slide show as that of JWindow or any workaround to achieve this?

    Any help in this regard is highly appreciated.

    Thanks & Regards,

    Ravindra Appikatla


  2. #2
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    494
    Thanks
    8
    Thanked 48 Times in 46 Posts

    Default Re: JFrame declared as setAlwaysOnTop doesn't stay on top during slide show

    Last edited by Darryl.Burke; March 30th, 2010 at 09:21 AM.

Similar Threads

  1. J2ME-Show RMS data in tabular form
    By Sunil Raghuvanshi in forum Java ME (Mobile Edition)
    Replies: 1
    Last Post: January 24th, 2011, 08:06 AM
  2. Replies: 1
    Last Post: March 22nd, 2010, 04:34 PM
  3. Show Text With cursor
    By ravjot28 in forum AWT / Java Swing
    Replies: 1
    Last Post: January 20th, 2010, 10:02 AM
  4. How do i show all the values in one window(JOptionPane)??
    By Antonioj1015 in forum AWT / Java Swing
    Replies: 1
    Last Post: November 25th, 2009, 09:24 PM
  5. JFrame help
    By Uden in forum AWT / Java Swing
    Replies: 0
    Last Post: August 14th, 2009, 01:37 PM