JInternalframe always on top instead of overlapping

Hello guys,
I have some JInternalFrames but one window paints its content above all, even overlapping frames. The code looks like this:
package visnav.bachelor.gallery;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Insets;
import java.awt.ScrollPane;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Vector;
import java.lang.Math;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.SwingUtilities;
import javax.swing.border.EtchedBorder;
import visnav.bachelor.DataLoader;
import visnav.bachelor.preview.PreviewMap_Ext;
import visnav.common.Config;
import visnav.common.DBListener;
import visnav.common.Options;
import visnav.common.Photo;
* The class Gallery adds a window in which all selected Photos (=their
* thumbnails) can be seen.
* @author Florian Kratschmann
public class Gallery extends ScrollPane implements DBListener {
     private static Vector<Photo> selectedPhotos;
     private static Gallery instance;
     public JPanel content = new JPanel(new ModifiedFlowLayout(
               ModifiedFlowLayout.LEFT, 6, 6));
     public String filename = "";
      * Constructor which creates a new Gallery object.
     public Gallery() {
          selectedPhotos = DataLoader.getInstance().getSelectedPhotos();
          this.updateGUI(selectedPhotos);
     public static Gallery getInstance() {
          if (instance == null)
               instance = new Gallery();
          return instance;
     public void collectionChanged() {
          selectedPhotos = DataLoader.getInstance().getSelectedPhotos();
          this.updateGUI(selectedPhotos);
     public void selectionChanged() {
          selectedPhotos = DataLoader.getInstance().getSelectedPhotos();
          this.updateGUI(selectedPhotos);
     public void valueChanged() {
          selectedPhotos = DataLoader.getInstance().getSelectedPhotos();
          this.updateGUI(selectedPhotos);
     public void updateGUI(Vector<Photo> data) {
          content.removeAll();
          removeAll();
          for (int i = 0; selectedPhotos.size() > i; i++) {
               filename = Gallery_Ext.getFileName(selectedPhotos.get(i)
                         .getFileLocation());
               final int j = i;
               ImageIcon icon = (new ImageIcon(selectedPhotos.get(i)
                         .getThumbLocation()));
               if (filename.length() > 15) {
                    filename = filename.substring(0, 15) + "...";
               JButton thumb = new JButton("<html><p align=\"center\">" + filename
                         + "<br>[" + (i + 1) + "/" + selectedPhotos.size()
                         + "]<br></p></html>", icon);
               thumb.setContentAreaFilled(false);
               thumb.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                         Gallery_Ext.openMIME(selectedPhotos.get(j)
                                   .getFileLocation());
               thumb.setVerticalTextPosition(JLabel.BOTTOM);
               thumb.setHorizontalTextPosition(JLabel.CENTER);
               thumb.setBorder(new EtchedBorder());
               thumb.setPreferredSize(new Dimension(140, 140));
               content.add(thumb);
          add(content);
      * A modified version of FlowLayout that allows containers using this Layout
      * to behave in a reasonable manner when placed inside a JScrollPane
      * Workaround made to fit size of screen on first updateGUI firing
      * @author Babu Kalakrishnan
      * @author Florian Kratschmann
     public class ModifiedFlowLayout extends FlowLayout {
          public ModifiedFlowLayout() {
               super();
          public ModifiedFlowLayout(int align) {
               super(align);
          public ModifiedFlowLayout(int align, int hgap, int vgap) {
               super(align, hgap, vgap);
          public Dimension minimumLayoutSize(Container target) {
               return computeSize(target, false);
          public Dimension preferredLayoutSize(Container target) {
               return computeSize(target, true);
          private Dimension computeSize(Container target, boolean minimum) {
               synchronized (target.getTreeLock()) {
                    int hgap = getHgap();
                    int vgap = getVgap();
                    int w = target.getWidth();
                    if (w == 0) {
                         Dimension size = new Dimension(0, 0);
                         int noOfTn = selectedPhotos.size();
                         try {
                              size = (Config.getDimension("InternalFrameSize4",
                                        new Dimension(0, 0)));
                                             if (size.width==0){size.setSize(300, 200);}
                              int noOfRows = (int) Math.ceil(size.width / 140);
                              int heightNeeded = (int) ((noOfTn*1.25 / noOfRows) * 140);
                              size.setSize(140, heightNeeded);
                         } catch (Exception ex) {
                              ex.printStackTrace();
                              int peter = 2;
                              int heightNeeded = ((noOfTn / peter) * 280)+140;
                              size.setSize(140, heightNeeded + 100);                    
                         return size;
                    } else {
                         // w = Integer.MAX_VALUE;
                         Insets insets = target.getInsets();
                         if (insets == null)
                              insets = new Insets(0, 0, 0, 0);
                         int reqdWidth = 0;
                         int maxwidth = w - (insets.left + insets.right + hgap * 2);
                         int n = target.getComponentCount();
                         int x = 0;
                         int y = insets.top;
                         int rowHeight = 0;
                         for (int i = 0; i < n; i++) {
                              Component c = target.getComponent(i);
                              if (c.isVisible()) {
                                   Dimension d = minimum ? c.getMinimumSize() : c
                                             .getPreferredSize();
                                   if ((x == 0) || ((x + d.width) <= maxwidth)) {
                                        if (x > 0) {
                                             x += hgap;
                                        x += d.width;
                                        rowHeight = Math.max(rowHeight, d.height);
                                   } else {
                                        x = d.width;
                                        y += vgap + rowHeight;
                                        rowHeight = d.height;
                                   reqdWidth = Math.max(reqdWidth, x);
                         y += rowHeight;
                         return new Dimension(
                                   reqdWidth + insets.left + insets.right, (int) (y*1.2));
                         // return new Dimension(120, 300);
}Any idea why it's content is always on top?
Cheers,
Flo

As the title I can have inside a JDesktopPane some JinternalFrame "always on top" compared to one that makes the background?You might get better help by explaining what you want to achieve, rather than how you want to achieve it.
You can do custom painting in a JDesktopPane, you know.
db

Similar Messages

  • Dreamweaver Panels - Only one panel visible at a time, others get obscured even with Always On Top.

    I have a problem with my Dreamweaver MX, and it is that I can only see one panel at a time, any other open panels get obscured. For example, with the work space maximized, and having the properties and behaviors panels open, I can only see one of the panels at the same time. If I click on any area of the work space each open panel will display and with the next click the other will display. If I make the work space smaller then the whole area of my screen, and move any open panels outside of the Dreamweaver work space, only then they will stay visible. I know this is not normal behavior, because I used to be able to see all the open panels simultaneously, with the work space maximized to use all the screen area. I went to Preferences> Panels> Always On Top, and all the checkmarks are still set, so as to keep all panels on top at all times, but this does no longer be the case. Can someone tell me what happened here, and how I can get back to being able to see all the open panels? BTW, I tried installing older version of Dreamweaver 4, and the same thing happens to both installed versions. This is extremely annoying!
    Thanks. -Al.

    Since I upgraded to Firefox 19 from 18.0.2, on my Windows XP (SP3) laptop, I, too, can no longer open a new window. File-->New Window does nothing; also can no longer tear off a tab and open it in a new window (it stays where it is). Also, if I right-click on a tab and select Move to New Window, nothing happens. All of these worked fine in FF 18.0.2. All of these work fine with FF 19 on Windows 7. Only an issue on my XP laptop.
    After trying to open a new window, and not seeing the new window come up (and yes, I waited a long time), I decided to close my current window, which had multiple tabs open. Instead of just closing, it pops up the message reminding me that I'm about to close all those tabs. If I say close, and then go into the Task Manager, the Firefox application has disappeared (as expected), but the firefox (and plug-in container) processes are still running. So I have to manually kill the Firefox process to get it to quit. it's as if it thinks there is another Window open (the one I tried to open but never appeared). This happens every single time! I've restarted my laptop, and that does not resolve the problem.
    Is there a way to downgrade back to v 18.0.2 until this is fixed?

  • "Show Desktop" bug forces any program windows to be stuck "Always-on-top"

    What I found under Windows 7, when you use the "Show Desktop" feature (I prefer the ⊞ Win + D shortcut) and then bring all windows back by using it again, some windows behave as if they're glued to the front of the z-order. What this means is, say, I have windows
    A B and C open, with focus on A, hit ⊞ Win +D twice, and now it may happen that if I then want to switch to B or C, either by Alt+Tab or by selecting them on the taskbar, the taskbar shows the highlight, but A stays visible (and usable, it's not just a rendering
    issue) in the foreground.
    Imagine the following situations, all three windows cascading and overlapping:
    A (focus)
    B
    C
    -> ⊞ Win + D
    Desktop (focus)
    -> ⊞ Win + D
    A (focus)
    B
    C
    -> click C on taskbar
    A
    C (focus)
    B
    -> click B on taskbar
    A
    B (focus)
    C
    And so on. Focus means actual input focus, i.e. in second situation, any keyboard typing is sent to window B while window A is in the foreground.
    It does not matter what kind of application; in my current case an instance of Outlook and an instance of Explorer is stuck, while a second instance of Explorer and an instance of Firefox behave normally. This should show that this problem can occur even between
    multiple instances of the same application, and that there are no fancy applications involved that like to pretend they are the most important program and internally force "always on top".
    Showing and unshowing the desktop again doesn't help; in the worst case another window might end up with the "glued to the top of the z-order" too. Between those, I can easily switch, but in order to get a window which still behaves normally on top, I have
    to manually minimize the offending windows.
    The only cure seems to close the offending windows so far, I've not found anything else that helps.
    Could it be that Windows 7 has a bug that can force an ALWAYS_ON_TOP flag
    onto some windows when restoring from "Show Desktop", or am I doing something wrong?
    More information from another user:
    I use win+d. Issue easy to replicate, Win7-64bit-Ultimate.
    The affected windows (any program) seem to be placed into a separate "Z" group. You can place multiple/many windows into this always-on-top state, those in the affected state will function normally in relation to each other with the exception that: - The group
    as a whole is always-on-top of any non-affected window - The whole group is on top of the taskbar. - The whole group does not respond to (context on taskbar) "cascade windows" or similar commands.
    The fact that the affected windows are on top of the taskbar and otherwise function as "special windows" shows that windows 7 has a hidden "feature" of always-on-top that gets applied with Win+D. The feature appears to place windows in a super window state
    that is on top of the taskbar. The normal group remaining behind the taskbar. (When you click the start menu or context menu of the taskbar, the start menu/taskbar comes to the foreground of the always-on-top group, however this does not revert the affected
    windows, only a temporary takeover until you switch to something other than the start menu/taskbar)
    This is key to finding an answer. How do we get windows to unassign the special status or not do the assignment in the first place?

    It appeared to have cleared by closing all windows and restarting. Initially I could not reproduce the error, then after opening all my working windows, I did indeed reproduce it on any window.
    I almost think it could be initialized with something to do with multiple windows of Chrome, and then the show desktop problem will crop up once one window has it. This was because: After messing around some more with a chrome session saver (session buddy)
    and restoring sessions and getting the super state, I restored and closed the window I was in and now I am again at a place where I can not reproduce the error, even in my "work environment" with some 35 chrome tabs in two windows, plus other programs, file
    locations, remote desktops and a second chrome profile with another dozen tabs.
    So, back to square one with finding the actual instigator of the super state phenomenon.
    Once you actually have the super sate issue, the following will reproduce:
    Ok, I am doing this as I type it:
    Open chrome (to view this website), then Notepad, then Calculator, (could be any windows, but for the purpose of demonstration, follow along with me)
    The windows should function normally, overlap your windows so that you can see the edge of all windows and the Z-order is (from front to back):the browser on top, then the calculator, then Notepad (you should be able to see part of the background windows).
    Now, with the browser on top, press win+d, then win+d again.
    Click on Calculator, then your browser, your browser is now stuck in the foreground. Clicking on notepad will bring the focus to notepad, and it will be in front of the calculator, yet it will stay behind the browser, as your browser is in "super state". (many
    arrangements of switching focus after returning from win+d will create the problem, with the exeption of clicking the desktop, I also noticed that I could not get calculator into super state unless it overlapped my chrome browser).
    Again, this does not seem to work until at least one of your windows is affected. We do not know how to get the initial window, only subsequent ones.
    I will post back if I find anything else.
    Let me know if there is anything that develops.

  • How to have Always on top

    Am using a JInternalFrame to have my tools. i open new JInternalFrames with canvas for painting with tools from my first JInternalFrame. Now my problem is i want to have my InternalFrame with tools to be always in front, so that i can select tools. can i make that InternalFrame as always on top.. Or else suggest me some other option to obtain such scenario..

    Well a JDesktopPane is a layered pane. This means that the components added to it have an associated z coordinate. You can add the floating internal frame at a higher layer then the other internal frames.
    myDesktopPane.add(myToolbarFrame,JLayeredPane.PALETTE_LAYER,0);

  • How to keep Calendar Helper always on top?

    In my jsf page, I have a input field with a calendar helper. Below this, is a drop down combo box. My problem is that when i click on teh calendar helper, the calendar appears in a drop down manner, and inspite of this, my combo box which is below, overlaps and appears in the middle of my calendar. Is there a way to avoid this? Perhaps by keeping the calendar always on top, or atleast making the calendar appear on top rather as a drop down.?
    My code snippet is like this:
    <TR>
                                                 <TD width="40%" align="right" height="30"><h:outputText
                                                      styleClass="normalText" id="text12" value="#{msg.To}"
                                                      style="color: black; "></h:outputText></TD>
                                                 <TD width="60%"><h:inputText styleClass="inputText" id="text13"
                                                      onblur="return func_2(this, event);">
                                                      <f:convertDateTime dateStyle="short" />
                                                      <hx:inputHelperDatePicker />
                                                      <hx:inputHelperAssist inputAssist="true" autoTab="true" />
                                                 </h:inputText><h:message styleClass="message" id="message2"
                                                      for="text13"></h:message></TD>
                                            </TR>
                                            <TR>
                                                 <TD width="40%" align="right" height="30"><h:outputText
                                                      styleClass="normalText" id="text10" value="#{msg.Status}"
                                                      style="color: black; "></h:outputText></TD>
                                                 <TD width="60%"><h:selectOneMenu styleClass="selectOneMenu"
                                                      id="menu1">
                                                 <f:selectItems value="Option1" /></h:selectOneMenu></TD>
                                            </TR>

    We are having the same results. Have you heard of a "fix" for this?

  • "Always on top" behavior for Navigator Window?

    Greetings,
    Several of our users have asked for an "Always on Top" feature for the OHJ help navigator window. We are using OHJ 4.2.3, on Windows platforms. Our application displays help topics from certain dialog buttons and menu items (using CshManager.showTopic()). If the help windows are currently displayed from a previous help request and the user maximizes the application window, any new help requests are not seen as the help windows do not top themselves.
    Is there any way to force the OHJ window to top itself when a new help topic is displayed? Our users are also asking for the help window to always be on top (a la Task Manager on windows) so they know where it is especially if they're performing a complex task and relying on a set of instructions in the help topic...
    thanks,
    Elizabeth Dyer.

    Elizabeth,
    As part of the showTopic() implementation OHJ calls toFront()
    to bring the help window to the front. If this isn't working
    in a particular case, please let us know. I don't think any
    permanent "on top" feature is feasible, since OHJ windows are
    normal Java dialogs and frames and selecting another Java
    window will activate it instead of OHJ.
    - Ryan (again with quoting from Jeff Stephenson)

  • Always on top feature for inspector window

    Are there any ability to enable/disable 'Always on top' feature for inspector shown in separate window in Mac OS ? On my laptop not always comfortable to keep inspector in browser window. On Ubuntu window managers allow to pin windows always on top but mac os has no abilities to do it. (using firefox developer edition)

    Elizabeth,
    As part of the showTopic() implementation OHJ calls toFront()
    to bring the help window to the front. If this isn't working
    in a particular case, please let us know. I don't think any
    permanent "on top" feature is feasible, since OHJ windows are
    normal Java dialogs and frames and selecting another Java
    window will activate it instead of OHJ.
    - Ryan (again with quoting from Jeff Stephenson)

  • Make modal dialog box "Always on Top"

    i know there has been discussion about Frame always on top etc. but i have a slightly different problem.
    I have a Modal Dialog box which goes to the background when the parent window loses focus and gains it back.
    i am working on java version1.4. So the new methof in 1.5 version is of no use. Also i am working on Windows XP SP1.
    Do i have to make the dialogbox extend OptionPane instead of JDialo, which i am doing rt now?
    but OptionPane comes with a baggage and unnecessary code which i have to implement etc.
    Is there any easier way to solve this issue.
    Thanks
    PM

    This solution works for me under J2SDK v1.4.2_03. If you were to use it on a large scale, you'd probably want to develop a bit more of a formalized framework for it.
            final JFrame test_frame = new JFrame("Test");
            test_frame.getContentPane().setLayout(new BoxLayout(test_frame.getContentPane(), BoxLayout.Y_AXIS));
            JPanel panel = new JPanel(new FlowLayout());
            test_frame.getContentPane().add(panel);
            final JDialog[] modal_dialog = new JDialog[]{null};
            final JDialog d = new JDialog(test_frame, "Bah", true);
            JButton close = new JButton("Close");
            d.getContentPane().add(close);
            close.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    d.setVisible(false);
                    modal_dialog[0] = null;
            FocusListener fl = new FocusAdapter()
                public void focusGained(FocusEvent e)
                    if (modal_dialog[0]!=null)
                        modal_dialog[0].requestFocus();
            test_frame.addFocusListener(fl);
            JButton open = new JButton("Open");
            panel.add(open);
            open.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    modal_dialog[0] = d;
                    d.pack();
                    d.setLocationRelativeTo(test_frame);
                    d.setVisible(true);
            test_frame.pack();
            test_frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            AWTUtilities.centerWindow(test_frame, null);
            test_frame.setVisible(true);

  • Need to make JFrame Always on top.

    I have the main application window(JFrame).It in turn creates many JFrames , i want the newly created JFrames to be set as ALWAYS_ON_TOP , ie even if i click on the the main window,the new JFrames should be always on top similar to Yahoo messenger and MSN messenger.
    Actually i don't want the functionality of "ALWAYS_ON_TOP" with JDialog or JInternalFrame,as both of them will ultimately have their parents as the main JFrame window.
    I want this functionality with JFrames that are created from the main JFrame window.
    Actually i am floating some components of my main JFrame window for which i create a new JFrame window and place that floated component.
    Now this floating JFrame is independent of the main JFrame window ,but i want to set "always on top" for the floating JFrame windows similar to the Yahoo and MSN messengers.

    Try this code. It should be work on all windows which are inherited from java.awt.Window
    * Call this from class consructor
    public void initialize() {
    TopThread top = new TopThread();
    top.start();
    * Keep JWindow on top (inner class)
    class TopThread extends Thread {
    public void run() {
    while(true) {
    toFront();
    * Let 10 milliseconds for other code to execute
    try {
    Thread.sleep(10);
    catch(Exception e) {
    // Nothing to do

  • Firefox always on top (No Addon's installed) I moved away from chrome for this but it still happens in latest version?

    I have installed latest version of FF
    It started off great for a few hours and then it happened, ALWAYS ON TOP
    I have to shut down and start again
    no additional add-ons have been installed, it is out of the box
    Can you please fix this? I have the same issue with chrome which is a great browser however it actually is so problematic for me that I switched to mozilla. However you have the same problem.
    Help please.
    Regards
    -=D

    When this happens, can you force all windows to minimize as a workaround (instead of shutting down), then choose the desired window from the jump list on the Firefox icon on the task bar? Either:
    * Window key + d
    * Window key + m
    * click the unmarked vertical button at the far right end of the Windows task bar
    I can't think of a way for a web page to put itself in front of all other applications, but perhaps it could do so using a plugin.
    Have you noticed any pattern in the sites where this happens?

  • Tilda in awesome always on top

    Hello everyone,
    I'm trying to get a good working terminal in awesome that looks transparent and doesn't conflict with workspaces in such a way that it's always on top.
    Currently I'm using tilda which seems to work fine untill the point of switching workspaces and being on top of everything.
    Is there any way to change this?
    I already tried installing gnome-terminal to be my terminal for awesome but for some reason I can't get it to be transparent. I've tried using devilspie2 to make it transparent but couldn't get it to work.
    I've installed the AUR version of gnome terminal with transparency but that also wouldn't work.
    Could someone point me into the right direction, either by telling me how to make tilda respond correctly to awesome or by telling me how to get my gnome-terminal to be transparent?
    EDIT: I'm at the point of thinking about using a different window manager and or desktop environment. If I can't get this to work I'll probably go with openbox.
    Last edited by SimbaClaws (2015-01-27 20:29:51)

    Maybe you need a composite manager to have transparency. https://wiki.archlinux.org/index.php/Rx … ansparency https://wiki.archlinux.org/index.php/Xorg#Composite
    Maybe you could use urxvt instead. And maybe you could use http://awesome.naquadah.org/wiki/Drop-down_terminal, if you find a solution working with awesome 3.5.

  • Flash always on top in Safari 5.0.5

    Hi,
    I have some problems with flash in Safari 5.0.5 with Flash Player 10.2. My flash banners is always on top and covers menus and popups. wmode and z-index seems to be correct. It works as expected in the latest nightly build of webkit and Google Chrome, but not Safari.
    Here is the webpage, scroll down and you will see the flash covering the top menu: http://www.booli.se/bostad/villa/hisingen/plockerotegatan+16/786830
    I found this question on the same topic (https://discussions.apple.com/thread/2458855?start=0&tstart=0) where the problem was said to be solved with Safari 5.0.1. A test site was set up in that thread by user suastegui which can be found here: http://www.guru.ag/fl2/iframeTest/index.html. On this page the flash is still covering the other elements for me.
    Any ideas?

    BBC iPlayer relies on Adobe Air. AIR 1.5.3 is the last version of AIR that supports Mac PowerPC and Windows 2000. AIR applications that require AIR 2 or later cannot be installed or used on a Macintosh PowerPC or a computer running the Windows 2000 operating system.
    http://kb2.adobe.com/cps/853/cpsid_85304.html
    I am in the same boat. I cannot watch flash videos on the BBC website or on BBC iPlayer, although all other flash videos (YouTube for example) are fine.
    For reasons that passeth all understanding, they work with the PPC version of Firefox, called TenFourFoxG5.app, once you have anabled plug-ins, as it does not natively support Flash.
    You can download TenFourFoxG5 from here:
    http://www.floodgap.com/software/tenfourfox/
    Now for the intersting bit: TenFourFox, like Firefox, does not support most plug-ins. Unless you are prone to headaches (in which case don't) you can read about that here:
    http://code.google.com/p/tenfourfox/wiki/PluginsNoLongerSupported
    But there is a workaround!
    Open TenFourFox and type in the address bar: about:config (no spaces) and click return. This gives you a warning that it might harm the application. Ignore that and click on 'I'll be careful, I promise' and you get the config file that you can edit - with great care.
    Look/search (scroll down) for: tenfourfox.plugins.enabled
    Set it to true. (Double click it to toggle it)
    Now close TenFourFox, open it again, and Flash will now work, as it now uses the plug-ins that Safari has stored.
    I am using Flash 10.1.102.64 in TenFourFox and it works just fine.

  • How to keep toolbar in Photoshop CS5 always on top

    I have just upgraded to CS5 from CS3. In CS5, when I move an open document around on screen it covers over the toolbar, but only if the toolbar is docked to the side of window.  It will also cover the property bar and menu bar at the top of the interface.  The palettes on the r/h side always stay on top if not docked to the edge of the window, but if docked they too get covered over. In CS3 all the interface items stayed on top.  Is there any way to make sure they is always on top when docked (I prefer not to have them free floating)?
    I'm using Vista Ultimate.  My monitor is a Dell 24" Ultrasharp running at native 1920x1200 res.

    Thanks for the suggestion.  Turning OpenGL off makes no difference, and with it turned on I have also tried the three different quality settings, none of which made any difference either.
    I've also just tried with CS5 in a window, rather than fully maximised, and like that I can actually drag an open image right outside the Photoshop interface!
    Dave

  • JOptionPane show Message Dialog always on top found a Solution

    just thought of a solution for the age old java problem with message boxes / dialogs / input .
    It's funny when you google it you'll find like a million people asking for a solution but none or very few that gives an answer that works.
    this is probly not a new solution but i came up with this yesterday and thought i would "share".
    dunno why the java developers hasnt made a always on top function for this since there seems to be a very high demand for it.
    this hax will hopefully work at all times.
    hope google will find this thread, i searched for a solution yesterday and found none? which is surprising and im a pro googler too.
    import javax.swing.*;
    public class main{
         public static void main(String args[]){
              JFrame j=new JFrame();
              j.setAlwaysOnTop(true);
              j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              j.setVisible(true);
              j.setVisible(false);
              JOptionPane.showMessageDialog(j,"hi");
              System.exit(0);
    }

    I didn't realize it was an "age old problem." The JOptionPane's showXXX methods just show an ordinary modal dialog. If you want to set the alwaysOnTop property of said dialog then you just need to obtain a reference and call the method in question.
    JOptionPane op = new JOptionPane("hi",JOptionPane.INFORMATION_MESSAGE);
    JDialog dialog = op.createDialog("Message Dialog");
    dialog.setAlwaysOnTop(true); //<-- this line
    dialog.setModal(true);
    dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    dialog.setVisible(true);No need for an intermediate frame.

  • I am using JComboBox.i want ihe JComboBox popup always in top direction.

    Hi friends,
    i am using JComboBox.i want ihe JComboBox popup always in top direction(like mobile options ).by default JComboBox popup always in down direction.plz help me

    probably have better success if you tried to get hold of the source code
    for a mobile app that does what you want, then modify it for swing/awt

Maybe you are looking for

  • Google, Yahoo searches come back " Invalid Security Code" msgs?

    Now when I do a Firefox Search (whether Google, Yahoo, etc), I get a "Invalid Security Code" / "Issuer Certificate is unknown" error message train. I can't understand why these sites would produce this result but am afraid to override the error messa

  • ITunes Libary Size?

    Hey everyone, I just have a simple question. My iTunes library size is around 23GB, this is what iTunes displays in the bottom of the program. However, when I go to my iTunes music folder. It says I have around 36GB of files. Is there something wrong

  • Port configuration on WLC2006 and WLC2106

    In the WLC config guide V4.0 there is a clear explanation on how to use multiple distribution ports on the WLC440X. Is there also a similar sound description of how you can use multiple distribution ports on the WLC2006 and WLC2106 ? Somewhere in the

  • How to change the movie clip a button links to???

    I am working on a website in Flash that had already been designed by someone else. There are a number of buttons across the website that are linked to the same symbol. Those buttons link to movie clips, in the button's actions, that pop up as small w

  • With Firefox 4, pdf files don't display anylonger

    when I click on link to a pdf files (I tried in several sites, inlcuded Mozilla) a new tab opens but the pdf content doesn't dispaly; sometimes clickin on the reload button the content is displayed but deafult beahvior is not dispalying any content.