Tab content is empty when tab is dragged

I have two TabPanes which can move tabs each other. This is the code of the TabPane which receives the dragged tabs from the user:
tabPane.setOnDragDropped(new EventHandler<DragEvent>()
            @Override
            public void handle(DragEvent event)
                final Dragboard dragboard = event.getDragboard();
                if (dragboard.hasString()
                        && TAB_DRAG_KEY.equals(dragboard.getString())
                        && DragBuffer.getDraggingTab().get() != null
                        && DragBuffer.getDraggingTab().get().getTabPane() != tabPane)
                    final Tab tab = DragBuffer.getDraggingTab().get();
                    tab.getTabPane().getTabs().remove(tab);
                    tabPane.getTabs().add(tab);
                    tabPane.getSelectionModel().select(tab);
                    event.setDropCompleted(true);
                    DragBuffer.getDraggingTab().set(null);
                    event.consume();
I noticed that when I drag the tab into the target TabPane the content of the tab is empty. But when I swith to the next tab of the target tabPane and return back I can see the content. This is couced by this line:
tab.getTabPane().getTabs().remove(tab);
Can you tell me how I can change the logic in order to prevent the empty tab body?
Ref javafx 2 - Tab content is empty when tab is dragged - Stack Overflow

This looks like a bug; I see the same thing in the context of your other thread. I can't seem to find a workaround. I have some sample code below which demonstrates the same problem without cluttering the code with drag and drop. This should move the selected tab in the bottom tapPane to the top tabPane ("Up" button) or the selected tab in the top tabPane to the bottom tabPane ("Down" button). When a tab is moved it is automatically selected; moving a tab to the top tabPane fails to show its content. (Strangely, moving a tab to the bottom tabPane works fine.) You should probably file a JIRA; reference this thread ("discussion" in the new forum-speak).
import java.util.Random;
import javafx.application.Application;
import javafx.beans.binding.Bindings;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class TabSelectionTest extends Application {
@Override
  public void start(Stage primaryStage) {
  final TabPane tabPane1 = new TabPane();
  final Random rng = new Random();
  final int NUM_TABS = 4 ;
  for (int i=1; i<=NUM_TABS; i++) {
    tabPane1.getTabs().add(createTab(rng, i));
  final TabPane tabPane2 = new TabPane();
    for (int i=1; i<=NUM_TABS; i++) {
      tabPane2.getTabs().add(createTab(rng, i+NUM_TABS));
  final Button moveToPane1Button = new Button("Up");
  final Button moveToPane2Button= new Button("Down");
  final HBox buttons = new HBox(10);
  buttons.getChildren().addAll(moveToPane1Button, moveToPane2Button);
  moveToPane1Button.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent event) {
        Tab selectedTab = tabPane2.getSelectionModel().getSelectedItem();
        tabPane2.getTabs().remove(selectedTab);
        tabPane1.getTabs().add(selectedTab);
        tabPane1.getSelectionModel().select(selectedTab);
    moveToPane2Button.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent event) {
        Tab selectedTab = tabPane1.getSelectionModel().getSelectedItem();
        tabPane1.getTabs().remove(selectedTab);
        tabPane2.getTabs().add(selectedTab);
        tabPane2.getSelectionModel().select(selectedTab);
    moveToPane1Button.disableProperty().bind(Bindings.isEmpty(tabPane2.getTabs()));
    moveToPane2Button.disableProperty().bind(Bindings.isEmpty(tabPane1.getTabs()));
    VBox root = new VBox(10);
  root.getChildren().addAll(tabPane1, buttons, tabPane2);
  primaryStage.setScene(new Scene(root, 600, 500));
  primaryStage.show();
  private Tab createTab(Random rng, int i) {
    Tab tab = new Tab("Tab "+i);
    Pane pane = new Pane();
    pane.setMinSize(600, 400);
    String style = String.format("-fx-background-color: rgb(%d,  %d, %d);", rng.nextInt(256), rng.nextInt(256), rng.nextInt(256));
    pane.setStyle(style);
    pane.getChildren().add(new Label("This is tab "+i));
    tab.setContent(pane);
    return tab ;
  public static void main(String[] args) {
  launch(args);

Similar Messages

  • Tab Groups are empty when loaded from tab group list

    I have several tab groups which have been working successfully.
    Today whenever I open a tab group the number of tabs is set to zero and all my tabs are lost. In the Tab Group List they show as 7, 19 etc.

    You can check for problems with the sessionstore.js and sessionstore.bak files in the Firefox Profile Folder that store session data.
    Delete the sessionstore.js file and possible sessionstore-##.js files with a number and sessionstore.bak in the Firefox Profile Folder.
    *Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    Deleting sessionstore.js will cause App Tabs and Tab Groups and open and closed (undo) tabs to get lost, so you will have to create them again (make a note or bookmark them).
    *http://kb.mozillazine.org/Multiple_profile_files_created

  • Previous versions tab in Explorer empty when changing UI language

    Hi folks,
    I encountered a strange problem today when I try to restore previous version files in Explorer from a network share.
    We are using English version of Windows 7 Enterprise and we’ve offline included Finnish language pack so that the can change UI language on the fly.
    The problem is now when I browse a network folder right click it and select “Restore previous versions” then I get the list of previous versions correctly BUT this only works when the UI language of Windows 7 is English. When I change
    the UI language to Finnish it just does not work anymore. There is no way to get a list of previous versions. It does not even say that there are no previous versions are available the whole list box where to see the files just does not appear at all.
    Do I miss some hotfix/patch or so as we only distribute security updates to our workstations and server and patches only when needed? The server OS where the share is located is 2008R2.
    Thanks for your help already. Sorry could not find any log with any error messages so I can’t post it here.
    Cheers
    Robert

    Hi Robinion,
    I have researched and found out that same issue has been asked by the others, with only the Finnish language pack, I couldn't reproduce this issue due to the restrictions of Windows update.
    Besides, I am trying to involve someone who is familiar with this topic to further look at this issue. There might be sometime delay.
    Thank you for your understanding and support.
    Best regards
    Michael Shao
    TechNet Community Support

  • PHP Form in Spry Tabbed Content Div

    I have placed some PHP forms inside some Spry Tabbed Content
    divs. When the forms are submitted, the page reloads with the
    default tabbed content displayed instead of the tab where the form
    is. If I click to the tab with the form, I can see the information
    PHP properly returned.
    Does anybody know how to make the Spry Tabbed Content script
    return to the tab that had focus when a PHP form is submitted
    instead of the default tab?
    Thanks in advance for any advice.

    Hi,
    On the main forum page you will have read the following.
    Announcement: New to Spry, or  the Spry forums?
    Hide Details
    Before you post a topic please verify that:
    You are using the latest Spry files
    The latest version of the Adobe Spry Framework is 1.6.1, this is the same version that ships with Dreamweaver CS4. If you use Dreamweaver CS3 (uses Spry 1.4), its wise to upgrade your files to the latest version. This can easily be done using the Spry Updater that can be found here.
    After you have upgraded and not removed the remarks from the Spry files, we will have another look at it.
    Ben

  • SPRY tabs content loading

    I am using SPRY tabs to display static content. I have 4
    tabs. When the page loads the content on all 4 tabs shows up one
    below the other.
    Could anybody suggest how I can stop that. The content for
    first tab should only show up on page load.
    Other tab content should load when that tab is
    clicked.

    My tabs work but the problem I have is that the content of
    all tabs loads when the page loads making it extremely slow.
    I've got galleries in the tabs, tab1 2008 tab 2 2007 tab 3
    2006 and photos in each gallery all load together.
    On another site I did I managed to get it to load the images
    in the tab when the user clicks on the tab speeding up initial load
    times for the page but I can't remember how I did it, it was
    accidental!!!

  • How to Display Repeat List In Spry Tab Content

    Hello,
    I am new to Spry. I thought I could just create an XML
    dataset, Insert a Spry Tabbed Panel, and then insert a Spry repeat
    list inside the Tabbed Content area of the Tabbed Panel. It is not
    working at all for me. Is this doable at all? If so, how?
    Thanks!

    hi,
    i have created an example in http://apex.oracle.com/pls/apex/f?p=44310:1:3623155419174978:::::
    username/password: demo/demo
    check, it may help you:)
    *please mark the thread answered if it done:)
    regards
    Little Foot

  • Links to spry tab content

    Within one html file divided into Spry-tabs, I set a named
    anchor in tab-content <div> of one tab and try to link to it
    from within a different tab-content division of the same page.
    Doesn't work - just sends me to bottom of division in the which
    link is located. Surely this is doable -- Am I missing some simple
    point?

    bob_atlanta wrote:
    > Within one html file divided into Spry-tabs, I set a
    named anchor in
    > tab-content <div> of one tab and try to link to it
    from within a different
    > tab-content division of the same page. Doesn't work -
    just sends me to bottom
    > of division in the which link is located. Surely this is
    doable -- Am I
    > missing some simple point?
    You have to know which tab the anchor is within and then you
    can show a specific tab. Check out the code on this page:
    http://labs.adobe.com/technologies/spry/samples/tabbedpanels/tabbed_panel_unobtrusive.htm
    FYI: Spry questions are probably best asked in the Spry
    forum:
    http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid=72&catid=602
    Danilo Celic
    |
    http://blog.extensioneering.com/
    | WebAssist Extensioneer
    | Adobe Community Expert

  • Multiple tabs open, will not show content on a different tab when clicking on it.

    When I have multiple tabs open on Firefox and click on one of the other tabs, it will not change to the newly clicked tab. It will continue to show the previous tab that was open. If I move the mouse around the page, then some of the pictures will appear on top of the previous page.
    The only way that I have been able to correct this is to reopen a different tab and then open the tab that I wanted open in the first place. Once I do the back and forth, the tab will show the content that is displayed on that tab.

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • When more tabs open only the new tab content gets desplayed. How can I solve this?

    I am using a macbook pro and a imac. I updated both to Firefox 5 yesterday. The imac is fine but on the macbook pro firefox behaves strange after restart. If I have more than one tab open, I can not go back to a previous tab. The animation shows that the Tab was click and is active but it doesn't change the the web content and displays only the content of the newest tab.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")
    In Firefox 4 you can use one of these to start in <u>[[Safe mode]]</u>:
    * Help > Restart with Add-ons Disabled
    * Hold down the Shift key while double clicking the Firefox desktop shortcut (Windows)
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Data tab content blank in debugging

    Hello,
    On sql developer 3222009
    At debugging a plsql store procedure, everything is doing well but when the code go to an internal procedure the data tab content became blank.
    Thnaks
    Nelson

    Jeff
    Internal procedure that I mean is a procedure inside a procedure, like a inner procedure.
    When we are in the "main" procedure the content appear normally but when the control of execution goes to one inner procedure, the content of the data tab is in blank, empty.
    Thanks
    Nelson

  • By selecting the dropdown list a new empty browser tab is getting opened

    Hi,
    When i try to pass the parameters in Bi report, by selecting the dropdown list a popup(new empty browser tab) is getting opened why is this so. Can anyone help me to sort it out.
    Edited by: user9093700 on Jul 6, 2012 8:57 AM
    Edited by: user9093700 on Jul 9, 2012 8:46 AM

    If you have tabs on top and no menu then the tabs are in a "Windows" area so there is no space to right. If you put tabs back to the bottom you will have most of your old behavior but because of the changes to tabs on top most of the tab context menu stuff all of the context menu part was lost except the customize toolbar stuff, double-clicking on an empty spot was restored, and eventually during the FF 4 beta most of the tab extensions Firefox messed up eventually worked again except in the area to the right of the tabs.
    The Windows part of that double-click has to maximize or restore to normal,
    and you have to be able to drag the window by it;'s title bar.
    You can make Firefox 4.0.1 and '''Firefox 5.0''' look like Firefox 3.6.17, see numbered items 1-10 in the following topic [http://dmcritchie.mvps.org/firefox/firefox-problems.htm#fx4interface Fix Firefox 4.0 toolbar user interface, problems (Make Firefox 4.0 look like 3.6)]

  • Purchased tab content blank

    I've been having this issue for a couple days  now.  When I go to the purchased tab in iBooks, I get a white blank page. My iPhone 6, seems to be unaffected. I've factory reset settings twice, restarted my ipad mini 2 wifi. Nothing seems to work! Any advice?

    Jeff
    Internal procedure that I mean is a procedure inside a procedure, like a inner procedure.
    When we are in the "main" procedure the content appear normally but when the control of execution goes to one inner procedure, the content of the data tab is in blank, empty.
    Thanks
    Nelson

  • How to make a specific tab the active one when loading a page.

    We need to be able to navigate between a set of pages all containing the same tabs. When going from one page to another, the active tab on the new page must be "the same" as the active tab on the previous page. In other words: there must be a mapping between one page's tab and another page's tab. To do this we need to tell the next page which tab to set as selected. Is there any way of doing this? Because we use a left-side that is tab-independant for navigation, we can not hard-code the tab-reference in the hyperlink. We have thought about using a page parameter saying which tab is active (by the use of a tab id), but it seems impossible to make a portlet change the value of a page parameter without doing so with an event. Because the content under each tab is passive, we can't send any events. Is there any other way of doing this?

    When I click on the x to close a window, all windows are closing.
    When I click on an active link to open a new window, nothing happens , only the already pen one gets replaced. It' s a pain in the butt, and there is no help or solution from FIREFOX, I studied all help resources. I will not attach screen shot to this mail, as that wouldn't help anything. My solution - I will work with SAFARI or SEAMONKEY instead and not use FIREFOX any longer.

  • Tab Content disappers : Migration from 6 to 6i

    I have a form with multiple tabs. It works fine with Forms 6.
    Now when we want to migrate to 6i, I am facing problem when I
    navigate from one tab to another tab.
    When the Form starts, it shows first tab correctly. Now if I
    click on another tab, it goes to that tab but doesn't show the
    items on the tab. If I come back to old tab, same problem.
    These are setting I have..
    Main Canvas: ( Type : Content )
    Viewport X position on Canvas : 0
    Viewport Y position on Canvas : 0
    Width : 9.2
    Height : 6.8
    Tab Canvas : ( Type:Tab )
    Viewport X position : 0.1
    Viewport Y position : 0.5
    Viewport Width : 9
    Viewport Height : 6.3
    Tab Page : ( Canvas type:Stacked )
    Viewport X position : 0.2
    Viewport Y position : 0.8
    Viewport Width : 8.8
    Viewport Height : 5.8
    Viewport X position on Canvas : 0
    Viewport Y position on Canvas : 0
    Width : 8.8
    Height : 5.8
    Any clues would be highly appreciated.
    Thanks
    Rahul

    Hello Deepak Kori,
    thanks a lot for your reply!
    I read this SAP note and the note with additional information (129352).
    As i understand we can do a homogeneous system copy as follows:
    - setting up the new server (2008x64) with a MAXDB instance (7.6.03.09)
    - Creating a backup (migration) from the source system (7.6.00.18)
    - recovery with initialization of this backup on the new server
    - upgrade of the DB instance to SAP MAXDB 7.8.02.29
    If this is correct, i think we have a good strategy!
    Thanks
    Martin

  • Flex 3 TabNavigator getting tab name when tab clicked

    Hi All, I am using Flex 3.
    I have <mx:TabNavigator  id="dbtabs" width="100%" height="100%" click="changeTabs()"  />
    I am also adding tabs dynamically. 
    In the grand scheme of things, I want to let a user add tabs as needed and chose what content is on the tab.  This is saved data, so when they come back I need to reload their saved settings.
    What I am trying to do is find out how to get the index of the tab when it is clicked. Right now I have to click the tab then click in the vbox to get the selectedIndex.  Is there a way to get the selectedIndex as soon as the tab is clicked?
    Thanks.

    private function handleTabClick(evt:IndexChangedEvent):void
           var i:int = evt.newIndex;
    <mx:TabNavigator change="handleTabClick(event)">
            <mx:Canvas width="200" height="200" label="Tab 1"/>
            <mx:Canvas width="200" height="200" label="Tab 2"/>
    </mx:TabNavigator>
    Dany

Maybe you are looking for

  • Databse polling without using logical delete or physical delete

    Hi all, Without using logical delete or physical delete how can i poll to the database???? Thanks Phani

  • Borders and shading, Move all objects at once!

    *Hi all, hope every1's good!! I hope someone can help me with this problem!, a friend has asked me to do a thank you card for him cos his hosting a dinner party for his work colleagues, now i know that pages 08 can do this because i've checked and st

  • Can I delete the .tmp files?

    In "My Adobe Captivate Projects" folder I have noticed a large number of .tmp files. Is it safe to delete these? They are not in a specific project folder and some are very large. I have about 22 projects and about 15 .tmp files. Example names are Ad

  • Message exchange between oracle and external system

    I had posted my query before. I woull appreciate if anyone could guide me that for exchange of messages bwteen Oracle and external system which AQ programmatic environment is preferred - 1. PL/SQL or 2.JMS hello WE have an Oracle database 9i. we want

  • Custom Webdynpro Proxy Page Layout

    We recently upgraded from NW04 to NW04s.  We see the new Webdynpro Proxy Page template.  I successfully created custom page layouts with the default page layouts in NW04.  However, our custom page loyouts do not appear in the drop down list for the w