Are you sure you want a JFrame, normally from within an application you would open a JDialog if you wanted another window. But either of these will involve the same process ie:
1. Add an ActionListener to the button.
2. In the ActionListener's actionPerformed method create your new JFrame/JDialog.
3. Add the required components to the frame/dialog object.
4. call pack() on the frame/dialog object.
5. call setVisible(true) on the frame/dialog object.
Here is what I want to perform
On the first page of my application I have a login, create new account, change password buttons with two text boxes(user name and password). By clicking each of the button a new window(jfram) should open with a specific task. for example on Clicking the login button(with username and password filled) a new jfram should be opened.
pack() causes the components to be laid out and the size of the window to be calculated and set so as to best display the components (within the confines of the screen).
You actually want a JDialog rather than a JFrame and you may want to make some/all of them modal. ie when the user clicks on Log In they probably shouldn't be able to click any other buttons until they have closed the login dialog, you can achieve this by making th JDialog modal.