You can find out about password fields here: How to Use Password Fields. You can add an ActionListener to the JTabbedPane and, if the user selected the tab you want to protect, launch the password dialog(for this you could use a JOptionPane) and decide about opening the tab depending on user response.