Results 1 to 7 of 7
  1. #1
    tpyq is offline Member
    Join Date
    Nov 2008
    Posts
    8
    Rep Power
    0

    Default [SOLVED] How to close the current form when i open a new form?

    Hi,

    I created 2 form, login and register, and i have got buttons on 2 of the form. On the login form, there is a button with ButtonMouseClicked(evt) that will open the register form.
    The code i use to open the register form is new Register().setVisible(true);. Then i added new Login().setVisible(false); to try to close the login form but it cant work.

    Can anyone help me with this?

  2. #2
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default

    Repaint? We have to call some form of repaint, which is currently somewhat convoluted, but often without a call to repaiint it take great time visible item show on screen.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

  4. #4
    tpyq is offline Member
    Join Date
    Nov 2008
    Posts
    8
    Rep Power
    0

    Default

    Thanks for the reply,

    I dun get you with the repaint part.

    I tried

    Login().dispose();
    new Register().setVisible(true);

    but there is a error which says cannot find symbol for method Login and dispose.

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

  6. #6
    tpyq is offline Member
    Join Date
    Nov 2008
    Posts
    8
    Rep Power
    0

    Default

    Thanks for the help, i got it.

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. New to this form
    By talasilasumanth in forum Introductions
    Replies: 5
    Last Post: 10-30-2008, 01:34 PM
  2. enctype=multipart/form-data with form data in struts
    By vk_satheesh in forum New To Java
    Replies: 0
    Last Post: 09-19-2008, 01:48 PM
  3. Open specific folder form JSP
    By roseline43 in forum New To Java
    Replies: 2
    Last Post: 09-02-2008, 08:53 PM
  4. How to close an open JFrame window from a jsp page?
    By kasisaiganesh in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 05-27-2008, 07:29 PM
  5. Form Help Pls
    By CoOlbOyCoOl in forum NetBeans
    Replies: 4
    Last Post: 05-27-2007, 09:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •