Results 1 to 6 of 6
  1. #1
    AryanArs is offline Member
    Join Date
    Feb 2012
    Posts
    9
    Rep Power
    0

    Unhappy How to add Multiple Objects in Frame

    I have three class with three different shapes....How can i add them together in a Frame...I went through many materials but could not get the right one....When one shape is added another dissapears......All three does not appears together....so help pleaese

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

    Default Re: How to add Multiple Objects in Frame

    Your question is somewhat anemic on details, so let me ask some questions that might help us help you:
    • You say you're adding "shapes" to a Frame, is this an AWT program and is this Frame a java.awt.Frame object?
    • What exactly are your "shapes"? Are they objects that derive from the java.awt.Shape interface? Or do they inherit from another type?
    • How are you currently adding shapes to your Frame? Can you show your code -- using [code] [/code] tags please.
    • How are you trying to add all three shapes to the Frame? Again can you show your code? Do you need to change the Frame's layout manager to something more suitable, perhaps FlowLayout if this is AWT or Swing?


    Also, you seem to have gotten good help in your last post here, but never returned to the post to reply? Did you solve your problem? Consider thanking pbrockway for putting in the time and effort to share his expertise with you. We're all volunteers and that's how we get "paid".

  3. #3
    AryanArs is offline Member
    Join Date
    Feb 2012
    Posts
    9
    Rep Power
    0

    Default Re: How to add Multiple Objects in Frame

    Thanks

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

    Default Re: How to add Multiple Objects in Frame

    You're welcome.

  5. #5
    AryanArs is offline Member
    Join Date
    Feb 2012
    Posts
    9
    Rep Power
    0

    Default Re: How to add Multiple Objects in Frame

    I have frame From JFrame in Viewer Class. I have rectangle class, ellipse class and line class separately. I had three buttons in VIewer class. When i click Rectangle button i can draw rectanlge in frame, but i cannot draw others. But if i make Rectanlge class inactive i can draw ellipse but cannot draw line. So the problem is i cannot draw three of them together in Frame. My concern is that how can i display all in one frame. In my view problem lies in Frame but how....Please

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

    Default Re: How to add Multiple Objects in Frame

    Hopefully someone else can help you, but you're still providing not enough information for me, sorry. I have little idea on what you're doing. Try asking your question as if the folks reading it have no idea whatsoever about the program structure and the code.

Similar Threads

  1. Unable to Display Two Objects in Frame
    By AryanArs in forum AWT / Swing
    Replies: 4
    Last Post: 02-26-2012, 06:56 PM
  2. Unable to Display Two Objects in Frame
    By AryanArs in forum New To Java
    Replies: 2
    Last Post: 02-26-2012, 06:43 AM
  3. Draw multiple class objects in one frame
    By jj007 in forum AWT / Swing
    Replies: 2
    Last Post: 01-14-2012, 06:32 PM
  4. How to post multiple image in frame?
    By Miwrath in forum AWT / Swing
    Replies: 2
    Last Post: 10-14-2010, 07:43 AM
  5. Adding multiple images to frame
    By 435.mahesh in forum AWT / Swing
    Replies: 1
    Last Post: 04-24-2009, 08:31 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
  •