Hi,I've started learning Java to enhance my programming knowledge and i've written code for individual GUIs which are working perfectly. Within each GUI i have common Labels,Buttons all in a JPanel that are the same in all of the GUIs which are linked together. What I want to basically do is get rid of the common Panels into one method outside the all of the GUIs code and when each GUI is being made made, call that method and finish building the GUI.
In other words, i have two GUIs, both of which create a JLabel in the center borderlayout. How would i go about creating a separate .java file that when i run one of the GUIs it creates that JLabel but also will create the same JLabel when I click on a button, sets the visibility of the 1st one to false and the 2nd GUI is created.
I Hope I explained myself properly as to what im trying to do. Is this possible? if so, what do I have to look into and if possible a sample code.
Thanks to anyone that can help.