Results 1 to 16 of 16

Thread: how to dispose?

  1. #1
    justlynn is offline Member
    Join Date
    Jun 2010
    Posts
    18
    Rep Power
    0

    Default [SOLVED]how to dispose?

    my project file name is Com, and i have my main frame ComView that is my login frame.
    i wish to dispose ComView() whn i hv login and appear new frame. dispose() was no work in the ComView.
    How can i do??
    Last edited by justlynn; 06-11-2010 at 03:43 AM.

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

  3. #3
    justlynn is offline Member
    Join Date
    Jun 2010
    Posts
    18
    Rep Power
    0

    Default

    how? ComView.setVisible(false)? it cant work.

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

  5. #5
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,816
    Rep Power
    25

    Default

    What class is setVisible() a method for? Find the object for that class in your program and use setVisible() with it.

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

    Default

    Quote Originally Posted by Norm View Post
    What class is setVisible() a method for? Find the object for that class in your program and use setVisible() with it.
    That's why blindly said that. ;)

  7. #7
    justlynn is offline Member
    Join Date
    Jun 2010
    Posts
    18
    Rep Power
    0

    Default

    sorry, im new to JAVA.
    my heading
    public class ComListView extends FrameView {
    public ComListView(SingleFrameApplication app) {
    this is netbeans create itself
    this class is a login function, keyin user name and password,
    after press login button is link to the new screen and i wish to dispose the login screen.

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,816
    Rep Power
    25

    Default

    i wish to dispose the login screen
    What class is displaying the login screen?
    Look at the API doc for that class and see if it has a setVisible() method.

  9. #9
    justlynn is offline Member
    Join Date
    Jun 2010
    Posts
    18
    Rep Power
    0

    Default

    what mean of class is displaying the login screen?
    ComListView is the class.
    Sorry that i cant get understanding.

  10. #10
    mine0926 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    580
    Rep Power
    5

    Default

    try this.
    Java Code:
            getApplication().hide(this);
    hope this help.
    goodluck

  11. #11
    justlynn is offline Member
    Join Date
    Jun 2010
    Posts
    18
    Rep Power
    0

    Default

    Yes, it can work well~ thank you all of you for helping me~ Thank to use your time to help me solve this~ ^^

  12. #12
    mine0926 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    580
    Rep Power
    5

    Default

    I just want to say that it only hides the application and does NOT close or exit the whole application

  13. #13
    justlynn is offline Member
    Join Date
    Jun 2010
    Posts
    18
    Rep Power
    0

    Default

    i know that~ it is good for me~ thank

  14. #14
    Prajin's Avatar
    Prajin is offline Senior Member
    Join Date
    Jun 2010
    Location
    Ktm, Nepal
    Posts
    120
    Rep Power
    0

    Default

    dispose(); will work.
    If there are two form say 'A' and 'B', Frame A has button(say), then call frame B when we press button and use dispose();

  15. #15
    amitabh is offline Member
    Join Date
    Apr 2010
    Posts
    51
    Rep Power
    0

    Default

    if y want to dispose ComView() then simply write this.dispose();

    it will close ComView() frame if y are in ComView( ) frame

  16. #16
    mine0926 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    580
    Rep Power
    5

    Default

    I think justlynn use Java Desktop Application and not Java Application. And its rootpane is SingleFrameApplication, FrameView etc which does not have .dispose method.

Similar Threads

  1. dispose() does not work here
    By arunkumarinfo in forum NetBeans
    Replies: 5
    Last Post: 12-28-2013, 06:42 PM
  2. dispose(); not working
    By Geraldo in forum AWT / Swing
    Replies: 12
    Last Post: 06-04-2010, 04:40 PM
  3. dispose()'ing a frame from itself.
    By musasabi in forum New To Java
    Replies: 12
    Last Post: 05-13-2010, 08:41 PM
  4. dispose
    By simontkk2005 in forum AWT / Swing
    Replies: 3
    Last Post: 11-19-2009, 12:42 AM
  5. How to dispose tooltip.
    By Preethi in forum New To Java
    Replies: 1
    Last Post: 07-22-2008, 08:06 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
  •