Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: How to use a component in a JFrame inside another JFrame?

  1. #1
    Junior Member
    Join Date
    Dec 2013
    Posts
    11
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default How to use a component in a JFrame inside another JFrame?

    Hell every one

    I have two different JFrame.One of them has RadionButton and another one does not have it.

    How to use this RadioButton in second JFrame that does not have it?

    Thank you in advanced


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: How to use a component in a JFrame inside another JFrame?

    A Component can only have one parent, so you cannot add a Component to multiple Containers. You must create a new Component and add it to the second - if you wish to mimic the behavior between each (eg when one is selected the other becomes selected) you will need to coordinate ActionListeners between the two.

  3. The Following User Says Thank You to copeg For This Useful Post:

    shirin (April 1st, 2014)

Similar Threads

  1. Whats wrong with this it's not displaying inside component
    By gauravdudeja in forum What's Wrong With My Code?
    Replies: 4
    Last Post: April 9th, 2013, 12:18 AM
  2. problem with my JFrame; JFrame not closing and stay in background
    By golominator in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 6th, 2012, 08:20 AM
  3. PUTTING JSCROLLPANE INSIDE JFRAME
    By fueledbyjace in forum AWT / Java Swing
    Replies: 0
    Last Post: September 15th, 2011, 07:21 AM
  4. using objects from one jFrame on a different jFrame
    By Taskeen in forum AWT / Java Swing
    Replies: 3
    Last Post: September 14th, 2011, 08:51 AM
  5. connecting jframe to another jframe
    By ajtambalo in forum Member Introductions
    Replies: 2
    Last Post: May 11th, 2011, 11:24 AM