TableView context Menu appears when running Java 8 until Update 5 but not later

The code below works as its name suggests the update of Java 8 5 but not later:

SerializableAttribute public class TableViewShowingOnlyAnAppendContextMenuItemIfRowIsEmptyElseDeleteIsIncluded extends Application {}

final table private TableView < name > = new TableView <>();

private data of ObservableList < name > finals = FXCollections.observableArrayList (new Name("Jacob"),

New Name("Isabella"), New Name ("Ethan"), Name ("Emma") New Name ("Michael")) new;

Public Shared Sub main (String [] args) {}

Launch (args);

}

@Override

{} public void start (steps)

TableColumn < String > name, column = new TableColumn <>("name");

column.setCellValueFactory (new PropertyValueFactory <>("name"));

table.getColumns () .add (column);

table.setItems (data);

ContextMenu contextMenu = new ContextMenu();

contextMenu.getItems () .add (MenuItem ("append")) new;

table.setContextMenu (contextMenu);

table.setRowFactory (tableView-> {}

TableRow < name > line = new <>(TableRow);

row.contextMenuProperty () .bind ((in English only)

Bindings.When (Bindings.isNotNull (Row.itemProperty ()))

. Then (showOnlyAppendContextMenuItemIfRowIsEmptyElseIncludeDelete ())

.otherwise ((ContextMenu) null));

next row;

});

Scene = new Scene (table);

stage.setScene (scene);

internship. Show();

}

private ContextMenu showOnlyAppendContextMenuItemIfRowIsEmptyElseIncludeDelete() {}

RowMenu ContextMenu = new ContextMenu();

ContextMenu tableMenu = table.getContextMenu ();

If (tableMenu! = null)

rowMenu.getItems () .addAll (tableMenu.getItems ());

rowMenu.getItems () .add (MenuItem ("delete")) new;

Return rowMenu;

}

Public NotInheritable class {name}

private final SimpleStringProperty name

private (String name) {}

myIdName = new SimpleStringProperty (name);

}

public String getName() {}

Return name.get ();

}

public void setName (String name) {}

This.Name.Set (Name);

}

}

}

Can help me find the error in the code? Or if there is anything, it's a regression which must be submitted? From now on, all computers used have 8u5.

Thanks in advance.

Answered correctly by James_D:

http://StackOverflow.com/questions/28195552/JavaFX-TableView-context-menu-item-shows-up-when-run-on-Java-8-until-Update-5-Bu

pasted below:

The solution is to create new menu items which are copies of those in the context menu of the table:

private ContextMenu showOnlyAppendContextMenuItemIfRowIsEmptyElseIncludeDelete() {}
    RowMenu ContextMenu = new ContextMenu();
    ContextMenu tableMenu = table.getContextMenu ();
    If (tableMenu! = null) {}
        {for (MenuItem item: {tableMenu.getItems ())}
            RowItem MenuItem = new MenuItem (item.getText ());
            rowItem.setGraphic (item.getGraphic ());
            rowItem.setOnAction (item.getOnAction ());
            rowMenu.getItems () .add (rowItem);
        }
    }
    rowMenu.getItems () .add (MenuItem ("delete")) new;
    Return rowMenu;

}

Tags: Java

Similar Questions

  • Context menu appears several times on its own! Windows 7 Home Premium

    I can hardly get anything accomplished on my desk more because the context menu appears on its own again and again, and I have to click anywhere on the screen until it goes away. Help!

    Hello

    1 follow these steps to remove corruption and missing/damaged file system repair or replacement.

    Run DiskCleanup - start - all programs - Accessories - System Tools - Disk Cleanup

    Start - type in the search box - find command top - RIGHT CLICK – RUN AS ADMIN

    sfc/scannow

    How to fix the system files of Windows 7 with the System File Checker
    http://www.SevenForums.com/tutorials/1538-SFC-SCANNOW-Command-System-File-Checker.html

    How to analyze the log file entries that the Microsoft Windows Resource Checker
    (SFC.exe) program generates in Windows Vista (Windows 7 also) cbs.log
    http://support.Microsoft.com/kb/928228

    Then, run checkdisk - schedule it to run at next boot, then apply OK your way out, then restart.

    How to run check disk in Windows 7
    http://www.SevenForums.com/tutorials/433-disk-check.html

    -----------------------------------------------

    2nd - Contextual Menu (right click) troubleshooting questions are an exercise of the elimination process.

    Make a right-click is slow or weird behavior caused by context menus managers
    http://WindowsXP.MVPs.org/slowrightclick.htm
    and here:

    Manage the entries in the context menu for files, folders, disks, and objects in the Namespace
    http://WindowsXP.MVPs.org/context_folders.htm

    The ShellExView utility displays the details of shell extensions installed on your
    computer, and you can turn on and off easily each shell extension.
    http://www.NirSoft.NET/utils/shexview.html

    ShellMenuView is a small utility that displays the list of static menu items that
    appears in the context menu when you right click on a file/folder on Windows
    Solution Explorer, and allows you to easily disable unwanted menu items.
    http://www.NirSoft.NET/utils/shell_menu_view.html

    How to change or remove items from the right click Menu.
    http://www.WinVistaClub.com/E11.html

    I hope this helps.
    --------------------------------------------------------------------------------------------
    Rob Brown - Microsoft MVP<- profile="" -="" windows="" experience :="" bicycle="" -="" mark="" twain="" said="" it="">

  • Empty menu appears when using Photoshop. Do you know how to fix it?

    Empty menu appears when using Photoshop. Do you know how to fix it?

    It's really annoying because I can't do just restart my mac.

    A screenshot can help, but if you use a Wacom tablet, the difficulty of white window might do the trick?

    Menus, shortcuts, Lasso tool or Photoshop constantly run when using a Wacom tablet. Mac OS

    I should have asked give you a more detailed account of your problem.  Version of the OS?  I'm guessing that Yosemite

    Version of Photoshop?

  • Java will not add/remove programs uninstall. When running java get error (java script false) when trying to uninstall get error message (error application of transformations

    When running java get error (java script false) when trying to uninstall get error message (error application of transformations. Went to sunmicro systems, but can not find help. Also having problems with script errors. I'm debugging the scripts not controlled. Using windows xp IE8.

    I think I need some type of uninstaller or need assistance.

    TYVM

    Connie Pitre

    E-mail address is removed from the privacy *.

    Hello

    Try the methods provided below and check if the problem persists.

    Method 1:

    Try the steps in the link below of the Java Support to solve the problem with the error application transforms during the uninstalling of Java.

    Error application of transformations

    http://Java.com/en/download/help/error_applying_transforms.XML

    Method 2:

    To fix problems with the Script in Internet Explorer error click the link below.

    How to resolve script errors in Internet Explorer on Windows computers

    http://support.Microsoft.com/kb/308260

  • Each time I click on a folder, search companion will appear. I am interested in DISABLING research or travel companion down on the pop-up menu, or at least, put it further down in the context menu. How can I do this? My computer not used to do this.

    Each time I click on a folder, search companion will appear. I am interested in DISABLING research or travel companion down on the pop-up menu, or at least, put it further down in the context menu. How can I do this? My computer not used to do this.

    Doug Knox fix - http://www.dougknox.com/xp/scripts_desc/xp_folder_open.htm
    Search Companion starts if you double-click a folder or computer drive - http://windowsxp.mvps.org/searchwindow.htm MS - MVP - Elephant Boy - Don ' t Panic!

  • error code 0 x 80246007 appears when you try to install updates and the windows store purchases.

    error code 0 x 80246007 appears when you try to install updates and the windows store purchases.

    any help appreciated

    Original title: error code 0 x 80246007

    Hello

    Please try the patches for Windows Updates:
    And for store related issues, use Troubleshooting Windows App tool:
    Hope this helps, good luck :)
  • a new datastore iSCSI (disk/lun) appears in the inventory. Warehouses of data, but not availble for quick vMotioning...

    Hello

    We have added the new datastore iSCSI (disk/lun)

    This new data store appears in the inventory. Warehouses of data, but not availble for quick vMotioning or the creation of a new virtual machine.

    did we miss a step?

    Ty

    r

    The reason is that the data store is not presented to all hosts in a cluster. When you create the VM in vCenter Server, only warehouses of data visible to the host on which the virtual machine is created are displayed.

    Make sure the presentation on your storage system is correct and rescan your hosts.

    To check the above, take a look at the Configuration-> Storage for guests.

    André

  • Why do the topics become Chinese when I access my email via Firefox but not Internet Explorer?

    Why do the topics become Chinese when I access my email via Firefox but not Internet Explorer?

    Hello, this is a display caused the extension Advisor default McAfee site - please try to disable or remove that in case you have now until there's a mcafee update that may resolve the problem.

    http://service.McAfee.com/faqdocument.aspx?ID=TS100162
    https://community.McAfee.com/thread/76071

  • I created show and hide features in InDesign I want to export to interactive PDF format. These functions work when seen in Acrobat on the desktop, but not on iPad/Tablet - why?

    I created show and hide features in InDesign I want to export to interactive PDF format. These functions work when seen in Acrobat on the desktop, but not on iPad/Tablet - why?

    Why? Most likely because the PDF Viewer on the Tablet is too stupid to deal with show/hide functionality.

    You could try PDF Expert of Readdle on qpdf Notes Pro on Android and iOS devices.

    Depending on how the show/hide was created during the export of InDesign, it can work in viewers. Otherwise, you will need to open PDF files in Acrobat and edit features show/hide something more digests of PDF device viewers.

    BTW, you will encounter the same issues with the PDF display components in web browsers.

    I hope this can help.

  • When I dream I see - update subscription. but I don't know how

    When I dream I see - update subscription. but I don't know how

    Manage your membership and your payment. Creative cloud

    https://helpx.Adobe.com/x-productkb/policy-pricing/membership-subscription-troubleshooting-creative-cloud.html

  • Start menu appears when the letter button two times, reducing to the minimum the games or the theft of focus

    Hey all,.

    I just got a new computer with Windows 7 64 bit Home installed on it.  We have installed a few programs (Google Chrome, steam, Team Fortress 2) but quickly noticed an interesting glitch.

    A letter key is typed twice and held, it evokes sometimes the start menu.  It happens more frequently when you play, and thus minimize the and killed us.  It can also happen outside of a game - my wife had trouble typing a web address, because when she hit 'w-w-w' the menu start jump upward and she just type 'Google' or whatever in local search.

    A few notes:

    • The computer is new.  The keyboard and mouse as well - are the keyboard and the mouse are brand gear xtreme.
    • We have updated Windows from a half hour ago.
    • We have updated the graphics drivers from an hour before.
    • We run avast antivirus and have analyzed malware.  We only visited sites of confidence, since we got the computer yesterday, and the problem appeared the first time my wife ran IE, so I'm doubtful that it is malware.
    • Nothing unnecessary runs in the background - that is if I run TF2, the only other program running is steam that has to work.
    • We tested intensively - the Windows key has not been pressed.
    • The problem may appear when a program runs, but its also duplicable when simply on the desktop is open - double typing and taking much will eventually bring up the Start Menu.  However, the problem is much easier to duplicate and much more infuriating when you play full-screen.
    Thanks for any help you can provide.
    -Zack

    Hi Zack,

    ·        Is this a desktop or laptop computer?

    1. to find if the issue is with the keyboard or the operating system, I suggest you to usethe keyboard to the screen. Follow the steps for the same:

    i. Click Start

    II. in the search box type at the keyboard of the screen

    2 start theclean boot computer and check if the problem still persists. Link below will help you to start the computer in clean boot:http://support.microsoft.com/kb/929135

    If the problem does not persist, you can continue with step 2 from the link above.

    Make sure that you reset the computer in normal mode in step 7.

    With regard to:

    Samhrutha G S - Microsoft technical support.

    Visit ourMicrosoft answers feedback Forum and let us know what you think.

  • Why a strange menu appears when I pop a screen

    After I pop a screen (the one that allows users to add a contact pre-populated from my code) a small menu will appear which has the following menuitems: save the contact (my addition), hide the keyboard, Application Switch, full Menu.  Contact 'save' is my addition to the menu of the screen being burst.

    This strange menu does not appear when I use the key standard exhaust or menuitem "save the contacts' point, only when I use the Save method or cancel button on my screen.

    All three use the same code - MainUi.popScreen (MainUi.getActiveScreen ());

    Here is the

    Why does this menu appear?

    I use JDE 5.0 in eclipse 3.5.2 with plugin 1.1 and a 9530 Simulator.

    Thanks in advance.

    If your buttons are the ButtonFields standard, you can create them with the style bit ButtonField.CONSUME_CLICK (possibly in addition to other bits of style, you already specified).

  • Problem with context Menu appearance

    I didn't know where else to post this, so if this is in the wrong section, sorry.

    Whenever I right click, now my context menu looks like this: http://gyazo.com/1f8d086bf5c73137728f88124bad0911 . It is not normally look like this on the victory. 7.
    What would cause this? Is it possible to fix this?

    The menu appears fine for me. Perhaps you are wondering why it apperas in the style "classic"?

  • Do not display the context menu set when the display manager

    Hello gurus,

    I m having this error during disconnection:

    Error 404 - not found

    Of RFC 2068 Hypertext Transfer Protocol - HTTP/1.1:

    10.4.5 404 not found

    Server not found anything matching the request URI. No indication is given whether the condition is temporary or permanent.

    If the server does not wish to make this information available to the client, the status code 403 (refused) can be used instead. The 410 (Gone) status code SHOULD be used if the server knows, through a configurable mechanism, that an old resource is permanently unavailable and has no forwarding address.

    When is a declare a view in faces-config Manager. XML accordingly with the tutorial: https://technology.amis.nl/2012/08/11/supporting-multiple-languages-in-adf-applications-backed-by-resource-bundles-and-p...

    I have a stark call to a message in a pop-up window which is showned when I clicked on the modelled Logout button

    Capture.PNG

    If I Don t declare the display manager, it works (the popup is showned and redirects to the login page).

    If I Don t display the context menu, it works (redirects to the login page).

    by no reason i Don t know, they are incompatible, but I need them working.

    JDev 12.1.3.0.0

    any ideas guys?

    Thank you

    Angela

    Hello

    I ve just erased the action button (goToLogout), and it worked fine. A didn t of controlFlowCase there were more (goToLogout).

    action = "goToLogout" actionListener = "#{LoginBean.doLogout}" targetFrame = "_self" / > "

    action listener (LoginBean.doLogout) shows the pop-up message.

    the dialogListener in the context menu when you click yesButton call the invalidate session and redirects to login page programaticaly.

    It was rubbish in my code.

    KDario thanks for your help, but you could never predict that in my code.

  • Context menu appears only on the tree

    Hi all

    I use Jdev. 12.3.1.0 and I created a component of the tree with a context menu, but when I press right click it does not show the menu.

    The following XML code:

                                                   <af:tree value="#{bindings.AccAnalysisRootVO.treeModel}" var="node"
                                                         selectionListener="#{bindings.AccAnalysisRootVO.treeModel.makeCurrent}"
                                                         rowSelection="single" id="t1">
                                                    <f:facet name="nodeStamp">
                                                        <af:panelGroupLayout id="pgl2">
                                                            <af:image source="#{resource['images:ana2.jpg']}" id="i1"
                                                                      inlineStyle="margin-right:3px; vertical-align:middle; height:14px; width:16px;"/>
                                                            <af:link id="ot1" text="#{node}"
                                                                     actionListener="#{SetAnalysisCode.GetTree}"
                                                                     partialSubmit="true"/>
                                                        </af:panelGroupLayout>
                                                    </f:facet>
                                                    <f:facet name="contextMenu">
                                                        <af:popup childCreation="deferred" autoCancel="disabled" id="p1">
                                                            <af:menu text="menu 1" id="m2">
                                                                <af:commandMenuItem text="#{psmartviewcontrollerBundle.ADD}" id="cmi1"/>
                                                                <af:commandMenuItem text="#{psmartviewcontrollerBundle.DELETE}" id="cmi2"/>
                                                            </af:menu>
                                                        </af:popup>
                                                    </f:facet>
                                                </af:tree>
    

    Just tried and it works fine. Works fine in the demo of component too: tree demo

    Can you be sure if your resource package has appropriate entries? Can you try to restart the server and then deploy the application to see if it works well?

    @Ashish Awasthi

    Hello

    surround your tree with panelCollection

    Thank you

    Why?

    Arun-

Maybe you are looking for