Results 1 to 9 of 9
  1. #1
    Join Date
    Feb 2009
    Posts
    5
    Rep Power
    0

    Post How to add JFrame inside JPanel

    hi all

    It would be appreciable if anybody tell about how to add a Jframe inside JPanel which is already inside a JApplet.


    Thanks

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

    Default

    The answer is: just don't do it. You can't do it, and you would never have a reason to do this. Ever.

    Please study the Sun Swing tutorials to learn more about just what a JFrame, JPanel and JApplet are and why this isn't feasible nor recommended. You'll also learn a lot more about how to create Swing GUIs through the tutorials.

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

    Default

    Out of morbid curiosity, I have to ask: what are you trying to achieve here? Why would you want to place a root pane into a Container, a JPanel?

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,298
    Rep Power
    20

    Default

    Just another cross poster.
    Java 2D - Can we add JFrame to JPanel?

    db

  5. #5
    Belgarath is offline Member
    Join Date
    Feb 2009
    Posts
    3
    Rep Power
    0

    Default

    you cannot have a JPanel in JFrame it is the other way around

  6. #6
    albi_87m is offline Member
    Join Date
    Apr 2009
    Posts
    8
    Rep Power
    0

    Default

    this is my problem 2, take a look last post

  7. #7
    iansane is offline Member
    Join Date
    Nov 2009
    Posts
    4
    Rep Power
    0

    Default

    I think the reason might be the same as what I have just come across. I am trying to put JButtons, TextFields, etc. in a tabbed panel.

    So I came across this post looking for how to add JFrame components to a JPanel.

    Can anyone clarify for me and the OP how to put Jcomponents in the tabbed panel?

    I'm starting with this demo.

    Well it won't let me post the link but it's the tabbedPaneDemo.java provided by sun

    All it is is empty tabbed panels. So how do I put components in it?

    Thanks

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

    Default

    Hello, and welcome to the forum. I respectfully ask however that you re-ask your question in its own new thread. Thanks for your cooperation.

    edit: the key to answering this question is in the addTab method. Again, if you post your question in a new thread, I'll be happy to provide you with the details.
    Last edited by Fubarable; 12-13-2009 at 08:38 PM.

  9. #9
    iansane is offline Member
    Join Date
    Nov 2009
    Posts
    4
    Rep Power
    0

    Default

    Sorry about that Fubarable. I'll work on it some more on my own before asking. I'm trying to understand the swing tutorials but it isn't making as much sense to me as the JFrame did. I'll post a new question if I can't get it figured out.

    Thanks

Similar Threads

  1. Launch native app inside a JFrame???
    By benedums in forum Advanced Java
    Replies: 6
    Last Post: 02-25-2011, 03:23 PM
  2. scroll a Jpanel in a JFrame
    By nidhirastogi in forum SWT / JFace
    Replies: 1
    Last Post: 09-07-2008, 03:42 AM
  3. How To Add A Jbutton Inside A Rectangle
    By SANDY_INDIA in forum AWT / Swing
    Replies: 9
    Last Post: 07-06-2008, 08:06 AM
  4. string inside of a xml
    By Heather in forum XML
    Replies: 2
    Last Post: 03-28-2008, 05:21 PM
  5. How to call JSP inside Servlet
    By Swamipsn in forum Advanced Java
    Replies: 0
    Last Post: 07-31-2007, 12:50 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
  •