Results 1 to 3 of 3
  1. #1
    Exhonour is offline Member
    Join Date
    Jan 2009
    Posts
    21
    Rep Power
    0

    Default How can I use one object twice?

    Like Im using a continue and exit button on different panels and I switch between these panels (meaning I dont have new windows for new panels, I just do this.remove and this.add) And when I have a panel with the same objects as before, they get removed...

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Use different buttons but have Buttons with the same action and text share the same AbstractAction or ButtonModel

  3. #3
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    8

    Default

    Build your panels, each with it own set of components and listeners. Just add and remove the panels from your JFrame, keeping references to each panel in the instance properties of the JFrame.

Similar Threads

  1. Replies: 2
    Last Post: 11-26-2010, 03:12 AM
  2. Replies: 1
    Last Post: 07-22-2008, 05:27 PM
  3. Replies: 1
    Last Post: 04-17-2008, 11:10 PM
  4. Object
    By sireesha in forum New To Java
    Replies: 1
    Last Post: 01-10-2008, 02:31 AM
  5. Creating object of Type Object class
    By venkatv in forum New To Java
    Replies: 3
    Last Post: 07-17-2007, 04:33 PM

Posting Permissions

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