Close all tabs in TabPane

I have this code it is very basic and it is used to close all tabs in a TabPane.

MenuItem item4 = new MenuItem("Close All Tabs");
  item4.setOnAction(new EventHandler<ActionEvent>()
   {
   @Override
   public void handle(ActionEvent e)
   {
   System.out.println("Close All Tabs");
   int ee = tabPane.getTabs().size();
  tabPane.getTabs().remove(0, ee);
   }
   });

I want to optimize this part of the code:

int ee = tabPane.getTabs().size();
  tabPane.getTabs().remove(0, ee);

Is there a clear and optimized alternative?

tabPane.getTabs () .clear ();

Tags: Java

Similar Questions

Maybe you are looking for

  • 300 * 0.0001 =?

    I met the odd error in my career of LV: in BT 7.1 and 8.0 on XP and Win7 on Intel and AMD chips: 300 * 0.0001! = 0.03 This is the case for 3, 6, 9, 18... 300, 600,... but not 30, 60, 3000 or 6000. The numbers in question seem to be more multiples of

  • HP LaserJet MFP M127 - new cartridge Pro is recognized used als

    Hello everyone, We have a MFP HP LaserJet Pro M127 in our network. Today, I have built in a new cartridge (HP Original Product power), printing works well, but the printer itself recognises that the cartridge is new and still has the warning, that th

  • Not gen but this copy is

    OK I installed windows xp pro that I bought the e - Bay, it was still sealed in its original packaging, but when I installed I left wired modem and cannot connect to internet, I phoned my net provider, they said I would need a chip set, or reinstall

  • Updated the video card, lost my audio devices

    Hi, I'm running a Dell Precision T5400, and I upgraded my Nvidia GeForce GTX 380 for a Nvidia GeForce GTX 480 video card.  Now I have no sound.  The Audio Control Panel applet claims that I have no audio hardware.  In the Device Manager my sound, vid

  • Recycle Bin problems in Windows 7

    Using Windows 7 Normally, when I delete files and folders, they are dumped into the trash. This time, I went through most of my files temporary and deleted a whole bunch of folders and files. Surprisingly, my basket is empty. Where the folders and fi