WhiteBoardCustomShapes Images always on top

Hi,
I am playing around with the WhiteBoardCustomShapes source and I noticed that images that are drawn on the WBcanvas are always above all the other elements after you reload the whiteboard.
At first everything is fine. The images stay in the order they are being placed on the whiteboard. But if you close and reopen the whiteboard. All the images are always above the other elements (arrows, strokes,text and so on).
Does anyone have an idea why and how to fix that?
Thank you

Okay so I found the solution and answer. If I am wrong, please correct me.
First the reason of the problem:
If you make customShapes you have to register them to the whiteboard. Well in the WhiteboardCustomShapes example they use the following code:
WBTriangle.mxml LINE 62:93
protected function onToolBarAdd(p_evt:Event):void
                if (sharedWB.isSynchronized) {
                   //.....some code here//.............                   
                    var imageShape:WBShapeToolBarDescriptor = new WBShapeToolBarDescriptor(WBShapeToolBarDescriptor.TOOL);
                    imageShape.toolTip ="Image";
                   imageShape.shapeFactory = new WBCustomShapeFactory(WBFileImageShape, WBSimpleShapeFactory.CURSOR_RECTANGLE, new WBFileImageShapeToolBar());
                    //..... and some more code
Okay so here is the code where we register our customShapaFactory. But if you check some more code com.adobe.coreUI.controls.whiteboardClasses.WBCanvas.as and debug it. You will realize that the
function protected function drawShape(p_desc:WBShapeDescriptor, p_animate:Boolean=false):void starting at line 894 is not recognizing our factory at the first call. The reason is that the whiteboard is registering its own shapeFactories somewhere at the beginning and we register our customShapeFactory after the whiteboard has already synchronized and started drawing elements on the Canvas.
SOLUTION:
Put this line of code this.sharedWB.registerFactory(new WBCustomShapeFactory(WBFileImageShape, WBSimpleShapeFactory.CURSOR_RECTANGLE, new WBFileImageShapeToolBar())); for example into the init() function [Line:70] or in the roomConnector_synchronizationChangeHandler function into the if (cSession.isSynchronized) { block (file: WBTriangle.mxml). This will register your customShapeFactory somewhere at the beginning and will make sure that your shapes are being drawn on the canvas at the same time all the regular shapes (triangles, arrows, rectangles and so on) are.
ANOTHER PROBLEM:
Well you might think that it will work now. And it does ..........SOMETIMES.
Objects do not have an order. doing something like this :
          for (var shapeID:String in _shapes) {
                returnArray.push(shapeID);
does not mean you will get the elements into the array in the same order as they are in the Object. So in line 423 file com.adobe.coreUI.controls.whiteboardClasses.SharedWBModel.as the function override public function getShapeIDs():Array does the above. To get rid of that problem i just added one line returnArray.sort(Array.NUMERIC); to that function.My changed function looks like this:
          override public function getShapeIDs():Array
             var returnArray:Array = new Array();
             for (var shapeID:String in _shapes) {
                 returnArray.push(shapeID);
             returnArray.sort(Array.NUMERIC);
             return returnArray;
After the two above mentioned changes everything is being rendered in the order it was originally drawn on the whiteboard.
If anyone knows a different or better way, please tell us. If not I hope that this will help somebody out there that had the same headache causing problem, for example you SANDY_LERMAN

Similar Messages

  • Layer Position - Images always on top

    I've been working on a large project for a month or so now and all of a sudden, when I import a new image it is always displayed over the top of other images, even when it should be behind them.
    I can correct this by moving the image in question lower down in the layers pannel, however I have loads more images in there which by that logic, should be visible over other objects, but they're not. This problem only started a few days ago.
    I'm guessing I've accidentally enabled an option somewhere without realising it?

    Assuming your groups are 2D groups then importing an object /image always comes in as the top layer in the  group or selected group if you have more than one. That means it displays above other layers below it. What you are seeing is normal behavior. Works this way when you use the apply button. If you drag and drop from library you can place it where you want in the layer list. No preference settings for this.

  • How to keep a image lways on top of internal frames?

    Hello.
    I have a main frame with sevral internal frames. I need to put a image on this
    window that can move this image remotely.
    How to keep this image always on top of these internal frames?
    Is there any panel that can put on top of these internal frame?
    Many thanks.

    Thanks for you reply and sorry for my break English.
    I mean I need a image that moving on a frame which has internal Frames.
    When the image meet a internal frame while it's moving, this image will go under of the internal frame , so that we can not see the image any more.
    What i want to do is that let the image always keep on top of the window,
    even if it meet a internal frame.
    Just imagine the windows cursor. A cursor is always visible no matter where is it.

  • 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

  • Set Always on Top Stage Javafx

    How to set always on top stage javafx?
    Help Me.
    Thanks.

    I actually found a "way around" this situation. I use transparency and a popup with a change listener to the focused property and then my window is "always on top". The only problem it's kinda like a hack and generates an exception. Here's the code:
    import br.com.vieirawebstudio.util.StageHandler;
    import sun.security.util.Resources;
    import javafx.application.Application;
    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.fxml.FXMLLoader;
    import javafx.scene.Node;
    import javafx.scene.image.Image;
    import javafx.scene.layout.HBox;
    import javafx.scene.layout.StackPane;
    import javafx.scene.paint.Color;
    import javafx.scene.shape.Rectangle;
    import javafx.stage.Popup;
    import javafx.stage.PopupBuilder;
    import javafx.stage.Screen;
    import javafx.stage.Stage;
    public class MainWindow extends Application {
         private static Stage primaryStage;
         private static final double WIDTH = 600.0;
         private static final double HEIGHT = 40.0;
         private ChangeListener<Boolean> changeListener;
         public MainWindow()
              changeListener = new ChangeListener<Boolean>() {
                   @Override
                   public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue)
                        if(!primaryStage.isFocused())
                             primaryStage.setIconified(false);
                             primaryStage.requestFocus();
         @Override
         public void start(Stage stage) throws Exception
              primaryStage = StageHandler.getStage();
              StackPane root = new StackPane();
              Rectangle frame = new Rectangle(WIDTH,HEIGHT, Color.web("#000"));
              frame.setOpacity(0.7);
              HBox pane = FXMLLoader.load(getClass().getResource("/fxml/MainWindow.fxml"), Resources.getBundle("bundle.MainWindow"));
              root.getChildren().add(frame);
              root.getChildren().add(pane);
              primaryStage.getIcons().add(new Image(getClass().getResource("/icons/logo.png").toString()));
              primaryStage.setX((Screen.getPrimary().getVisualBounds().getWidth() - WIDTH)/2);
              primaryStage.setTitle("Netuno");
              primaryStage.setIconified(false);
              primaryStage.setY(0);
              primaryStage.focusedProperty().addListener(changeListener);
              final Popup popup = getAlwaysOnTop(root);
              primaryStage.getScene().getStylesheets().add(getClass().getResource("/css/MainWindow.css").toString());
              popup.show(primaryStage);
         public Popup getAlwaysOnTop(Node root)
              Popup xmlWindow = PopupBuilder
                        .create()
                        .content(root)
                        .width(WIDTH)
                        .height(HEIGHT)
                        .x(500.0)
                        .y(0.0)
                        .build();
              return xmlWindow;
    }

  • HTA Always on Top

    Hi all,
    I've got a lovely HTA that is intended to be displayed on all our users screens at Windows startup, as defined by a GPO.  While everything is working fine, I'd really like to have it as an "always on top" window or at least grab focus/flash whenever somebody clicks away.
    Every forum thread I've found via Google says this is not possible, but other people have found 'hacks' to get this to work.  Various people mention either modal/modeless dialogues or using an onblur function.  Unfortunately, as a self taught 'coder', my VBS/HTA powers are fairly weak and I don't really know how to put this into practice.
    Would anybody be able to give me some guidance on how I could possibly launch the HTA and retain focus or keep it above other windows somehow?
    Cheers
    Andy

    You need a Third-party application
    http://www.nirsoft.net/utils/nircmd.html 32 or 64 bit version
    put nircmdc.exe in your path or in the folder with hta file,
    now use this sample .hta
    <!========================================================================
    <!
    <! NAME: RusiaToday.hta
    <!
    <! REVISION:
    <!
    <! AUTHOR: Emprear / gc.gianello[dot]gmail.com
    <!
    <! DATE  : 15/02/2013 09:03:38
    <!
    <! COMMENT:
    <!     Rusia Today en Español
    <!     Canal Internacional de Noticias
    <!
    <!======================================================================-->
    <!
    <html>
    <head>
    <title>RusiaToday</title>
    <script type="text/javascript">
    window.resizeTo(470,300);
    var intHorizontal = screen.width;
    var intVertical =screen.height;
    var left_pos = (intHorizontal - 470) / 2;
    var top_pos = (intVertical - 300) / 2;
    window.moveTo(left_pos,top_pos);
    </script>
    <HTA:APPLICATION
    ID="RusiaToday"
    APPLICATIONNAME="RusiaToday"
    BORDER="Dialog"
    BORDERSTYLE="Normal"
    CAPTION="yes"
    CONTEXTMENU="no"
    INNERBORDER="no"
    MAXIMIZEBUTTON="no"
    MINIMIZEBUTTON="no"
    ICON = "http://actualidad.rt.com/favicon.ico"
    SCROLL="no"
    SELECTION="no"
    SHOWINTASKBAR="yes"
    SINGLEINSTANCE="yes"
    SYSMENU="yes"
    WINDOWSTATE="Normal"
    >
    <script type="text/javascript">
    function ontop(){
    if ((document.getElementById('wtop').innerHTML) == 'notop') {
    document.getElementById('wtop').innerHTML = 'top';
    new ActiveXObject("WScript.Shell").Run('%comspec% /C nircmdc win settopmost title RusiaToday 0',0,true);
    }else{
    document.getElementById('wtop').innerHTML = 'notop';
    new ActiveXObject("WScript.Shell").Run('%comspec% /C nircmdc win settopmost title RusiaToday 1',0,true);
    </script>
    <style type="text/css">
    html, body{
    padding: 0;
    border: none;
    margin: 0;
    overflow: hidden;
    object#rto{
    margin: 0;
    border: none: padding: 0;
    left: 0;
    top: 0
    z-index: 1;
    button#wtop{
    top: 1%;
    right: 1%;
    z-index: 999;
    width:38px;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 4px;
    /*]]>*/
    </style>
    </head>
    <body style="background:#1E1D11">
    <object type="application/x-shockwave-flash" data="http://actualidad.rt.com/static/jwplayer/player.swf" id="rto" height='274' width='470'>
    <param name="movie" value="http://actualidad.rt.com/static/jwplayer/player.swf" />
    <param name="loop" value="false" />
    <param name="menu" value="false" />
    <param name="play" value="true" />
    <param name="wmode" value="transparent" />
    <param name='allowfullscreen' value='true'>
    <param name='allowscriptaccess' value='always'>
    <param name="flashvars" value="&autostart=true&backcolor=0x000000&bandwidth=1016&controlbar=over&file=RT_Spanish_2&frontcolor=0xffffff&image=http%3A%2F%2Factualidad.rt.com%2Fstatic%2Fvideo-player-bg.png&lightcolor=0xffffff&mute=false&plugins=viral-2d&screencolor=0x404040&skin=http%3A%2F%2Factualidad.rt.com%2Fstatic%2Fjwplayer%2Fplayer_skin.zip&streamer=rtmp%3A%2F%2Frt.fms.visionip.tv%2Flive%3Fautostart%3Dtrue&viral.onpause=false"
    />
    <param name="bgcolor" value="#1E1D11" />
    </object>
    <button onclick="ontop();" id="wtop">top</button>
    </body>
    </html>
    Look at the ontop() function and how alternate top and notop status using nircmdc command line utilitiy
    Thats all
    Regards

  • 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.

  • 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 get my images always order by file name, and not by time of captur, in all the folders in the library?

    How to get my images always order by arquive name, and not by time of captur, in all the folders in the library?
    Sorry for the poor english, but im portugues.
    In the library we can change the order of classification of image by, time of capture, name of file etc... I'm wondering if its possible define to be always by the name of file.
    It ´s possible?
    And i have other question, in print label we have an option to auto rotate to feet in page to have the image using the maximum area in the page (auto rotate, zoom etc), its possible to change the orientation of the rotation to be always in  the other direction?

    The Muvos are USB Mass Storage devices and do not have the ability to display track information based upon ID3 tags.
    The Zens all read and display track info based upon ID3 tag information that is either gathered from an online source or entered by the end-user.
    If you want the track information displayed instead of the ID3 tag information, you could edit the ID3 tags and rename the title to whatever you have as the file name. Not sure why your file names would differ so much from the ID3 tag info though, almost all of my content has the same name for the filename as it does on the ID3 tag title.

  • 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

  • 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

  • How do I keep form6.0 ALWAYS ON TOP?

    Hello friends,
    Like Oracle Help, Is there any option in forms6.0 to keep them 'always on top' of other applications.
    Thanx in advance,
    regards,
    Praveenkumar Talla

    Hello,
    Actually I want to keep the runtime form at the top of other application, How to do this?
    regards,

  • Firefox always on top, can't alt-tab to other open windows/apps

    I have updated to 11.0, windows vista. I didn't notice or have this problem before the update. for example if I have firefox open and click on my calculator, the only way I can see it is to minimize firefox. I cannot alt-tab to it nor can I click the icon in my status bar of windows.???
    I have looked through the settings, I didn't see an always on top option, but that's what it seems like.
    Any and all info will be appreciated.
    TIA,
    Jim

    When I restarted in safe mode, the firefox window was no longer stuck on top. Restarted again (firefox was set to "show my windows and tabs from last time" for both restarts) in regular mode and it stayed fixed. Maybe just a restart where "show my windows and tabs from last time" is firefox start up setting would fix stuck on top problem?

Maybe you are looking for

  • Error on Flexible Performance Management Appraisal Document

    Hello Experts, We are in the process of building Performance Management using Enhancement Package 4 in ECC 6.0. I am having issues with getting the Appraisal Document to work for MSS. Just to clarify too, I have no experience with Performance Managem

  • GR with reference to Delivery Order

    Hi How to GR with reference to the Outbound Delivery order ? Possible to do in MIGO ? My Current setting allows GR with ref to Mat.Doc/P.O/Prod.Order/Other. Thanks RG

  • Dumb instrument control

    Hello, We have developed a measurement instrument that passes raw data to the host PC via a USB interface. The instrument has little data processing capability. The host PC runs the user interface (VB6) software to carry out all the data handling and

  • Automatically rename photos?

    HI All, I have moved from a Samsung S2 to the Xperia Z1 and I think it is a brilliant phone but............. The problem I have is that I use it daily to take photos at work, and after I have taken a batch of photos I connect it to my pc and cut & pa

  • Struts configuration

    Does anyone have experience using Struts 1.1 with oc4j. I have successfully created an application, but I am having problems defining my ApplicationResources in the struts-config.xml. Everything works fine if I define them in the web.xml, but when I