Results 1 to 7 of 7
  1. #1
    Shien is offline Member
    Join Date
    Dec 2011
    Posts
    16
    Rep Power
    0

    Default show content on the same main Frame

    Hi I am creating program which has a lot of menu items. I want after clicking one of them that in the main Frame textboxes buttons would apear.
    I tried using another frame, but it opens in another window while I need it in the same window.

    So how to make it?

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,574
    Blog Entries
    7
    Rep Power
    21

    Default Re: show content on the same main Frame

    Simply add the JComponents (such as JButtons etc.) to the already visible parent JComponent. If all JComponents are added, call revalidate() on the parent JComponent. An alternative would be a CardLayout in the parent JComponent. Selecting that particular menu item would just show another 'card' (with all the additional JButtons etc.) in the parent JComponent.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Shien is offline Member
    Join Date
    Dec 2011
    Posts
    16
    Rep Power
    0

    Default Re: show content on the same main Frame

    Can you explain because I can't find any understandable information.

    If I have window which has in the middle label with some text and I want to change it to lets say frame with 3 texfield and few buttons. How to do this?

  4. #4
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

  5. #5
    Shien is offline Member
    Join Date
    Dec 2011
    Posts
    16
    Rep Power
    0

    Default Re: show content on the same main Frame

    By the way, can connect cardLayout Panel with radiobutton which is in another dialog?

  6. #6
    Shien is offline Member
    Join Date
    Dec 2011
    Posts
    16
    Rep Power
    0

    Default Re: show content on the same main Frame

    but this example is for manual code writing. Is there a way using designer?

  7. #7
    DarrylBurke's Avatar
    DarrylBurke is online now Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,305
    Rep Power
    20

    Default Re: show content on the same main Frame

    Boo hoo, learn to write code. In any case, it's several orders of magnitude easier than learning to use a visual designer effectively.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 7
    Last Post: 07-24-2011, 05:53 PM
  2. Replies: 7
    Last Post: 04-03-2011, 12:35 PM
  3. Java slave Frame access to its owner main frame problem
    By cagdaseckin in forum New To Java
    Replies: 0
    Last Post: 12-10-2010, 10:40 AM
  4. Replies: 4
    Last Post: 01-31-2009, 05:29 AM
  5. Replies: 2
    Last Post: 08-01-2008, 02:58 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
  •