• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

How to load same main fxml file multiple times by clicking on the new tab button?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not able to add new tab functionality to browser.I already search a lot on google but nothing work.I want to load main fxml file again nad again dynamically by clicking on new tab button.

Below is Main.java file



Here is some part of First-page.fxml file which is the main view...



Below is controller of First-page.fxml

Home_controller.java


In Controller class Tab-First-page.fxml is the copy of first-page.fxml and changes in Tab-first-page.fxml is that it does not contain Tabpane otherwise it is same as First-page.fxml
I am able to load multiple tab from First-page.fxml but not able to open new tab from Tab-first-page.fxml that is, From main page multiple tabs can be open dynamically but from those open tabs I am not able to open new tabs. Following is the error I am getting...

Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
//Lot more error...
**Caused by: java.lang.NullPointerException
at tabcheck.Home_controller.addTab(Home_controller.java:200)
... 62 more**
Home_controller.java:200 is tabpane.getTabs().add(tab); in addTab() method. I have tried every possible solution but not working,please any one can help?

I have also try to do it by adding listener in addTab() but still null pointer exception is coming...also search on other websites but nothing is working...please anybody can help??
 
This cake looks terrible, but it tastes great! Now take a bite out of this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic